[Bug 8746] New: rebuild_zebra_sliced.sh don't work where Record length of 106041 is larger than the MARC spec allows
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Priority: P5 - low Change sponsored?: --- Bug ID: 8746 Assignee: gmcharlt@gmail.com Summary: rebuild_zebra_sliced.sh don't work where Record length of 106041 is larger than the MARC spec allows Severity: major Classification: Unclassified OS: All Reporter: stephane.delaune@biblibre.com Hardware: All Status: NEW Version: rel_3_10 Component: Searching Product: Koha rebuild_zebra_sliced.sh don't work where Record length of 106041 is larger than the MARC spec allows -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 stephane.delaune@biblibre.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|gmcharlt@gmail.com |julian.maurice@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 12386 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12386&action=edit Bug 8746: rebuild_zebra_sliced.sh now export/index records as MARCXML This avoid indexing failures due to "bad offset" or "bad length" error with ISO2709 format + minor improvements: - --length parameter is optional. If not given, it will execute the right sql query to find the number of records to index - new parameter --reset-index. If set, index is reset before indexing -- Exporting multiple records in the same ISO2709 file can cause problems. If one record is wrong (say a record is longer than 99999 bytes, for example), then all following records won't be parsed correctly. For example yaz-marcdump refuse to read records that follow a malformed record. This cause problems in rebuild_zebra_sliced.sh because yaz-marcdump is used to count the number of records contained in one file. So the workaround used here is to export in MARCXML. yaz-marcdump can't split MARCXML files so a piece of Perl code is used instead (I didn't succeed to achieve this job with POSIX tools) To test you can create a biblio record longer than 99999 bytes and try to index a range of biblionumbers that contain it. On master indexation of this record should fail and this should succeed with this patch. (Records longer than 99999 bytes seem to not alter indexation of following records. I've encountered this behaviour with badly encoded records) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|3.10 |master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #2 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #1)
Created attachment 12386 [details] Bug 8746: rebuild_zebra_sliced.sh now export/index records as MARCXML
This avoid indexing failures due to "bad offset" or "bad length" error with ISO2709 format
+ minor improvements: - --length parameter is optional. If not given, it will execute the right sql query to find the number of records to index - new parameter --reset-index. If set, index is reset before indexing
sorry, i could not get this script working correctly, using... $ perl ./misc/migration_tools/rebuild_zebra_sliced.sh --reset-index using the normal 'rebuild_zebra.pl' worked OK, any ideas? (an attached test .mrc file might be helpful for testing this patch?) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- Mason, did you get some error messages? I just tried misc/migration_tools/rebuild_zebra_sliced.sh --reset-index on a freshly updated install and it worked just fine. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 --- Comment #4 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 14537 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14537&action=edit Bug 8746: Fix indexation in DOM index mode When in DOM index mode, files exported by `rebuild_zebra.pl -x` are wrapped by '<collection></collection>' tag. This is a problem because splitting files produces invalid files. This is fixed by adding the missing <collection> tags in each generated file. Another problem was that the wrong zebra configuration file was used. The script now uses C4::Context->zebraconfig($server)->{config} to know which configuration file has to be used. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 --- Comment #5 from Julian Maurice <julian.maurice@biblibre.com> --- Mason I think this patch should fix the problem you encountered. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |bgkriegel@gmail.com --- Comment #6 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- I tried with small base (2K records). rebuil_zebra.pl works ok, and don't have anomalous records. Pre-patch with rebuild_zebra_sliced.sh -t biblios -s 1000 -f ... Splitting file in chunks of 1000 records Indexing /tmp/rebuild/export/biblio/exported_records_1000_00 Indexing /tmp/rebuild/export/biblio/exported_records_1000_01 Indexing /tmp/rebuild/export/biblio/exported_records_1000_02 Ok Post-patch, same arguments Splitting file in chunks of 1000 records Indexing /tmp/rebuild/export/biblio/exported_records_1000_00 Indexing /tmp/rebuild/export/biblio/exported_records_1000_01 Indexing failed. See log file /tmp/rebuild/logs/zebraidx.exported_records_1000_01.log Split file and continue... Splitting file in chunks of 500 records Indexing /tmp/rebuild/export/biblio/exported_records_1000_01_500_00 Indexing failed. See log file /tmp/rebuild/logs/zebraidx.exported_records_1000_01_500_00.log ... Indexing failed. See log file /tmp/rebuild/logs/zebraidx.exported_records_1000_01_500_00_250_00_125_00_62_00_31_00_15_01_7_00_3_00.log Split file and continue... Splitting file in chunks of 1 records Indexing /tmp/rebuild/export/biblio/exported_records_1000_01_500_00_250_00_125_00_62_00_31_00_15_01_7_00_3_00_1_00 Indexing failed. See log file /tmp/rebuild/logs/zebraidx.exported_records_1000_01_500_00_250_00_125_00_62_00_31_00_15_01_7_00_3_00_1_00.log ... Proceeds one by one. Use grs1 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 16392 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16392&action=edit Bug 8746 [Follow-up] Replace == by eq in string comparison -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- $indexmode == "dom" was returning always true even if $indexmode was not "dom" $indexmode eq "dom" works much better :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12386|0 |1 is obsolete| | --- Comment #9 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 16448 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16448&action=edit [SIGNED-OFF] Bug 8746: rebuild_zebra_sliced.sh now export/index records as MARCXML This avoid indexing failures due to "bad offset" or "bad length" error with ISO2709 format + minor improvements: - --length parameter is optional. If not given, it will execute the right sql query to find the number of records to index - new parameter --reset-index. If set, index is reset before indexing Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Work as described. No errors. Test: Edit record to make it longer than 9999. Without patch rebuild_sliced fails. With patches works. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14537|0 |1 is obsolete| | --- Comment #10 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 16449 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16449&action=edit [SIGNED-OFF] Bug 8746: Fix indexation in DOM index mode When in DOM index mode, files exported by `rebuild_zebra.pl -x` are wrapped by '<collection></collection>' tag. This is a problem because splitting files produces invalid files. This is fixed by adding the missing <collection> tags in each generated file. Another problem was that the wrong zebra configuration file was used. The script now uses C4::Context->zebraconfig($server)->{config} to know which configuration file has to be used. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #16392|0 |1 is obsolete| | --- Comment #11 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 16450 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16450&action=edit [SIGNED-OFF] Bug 8746 [Follow-up] Replace == by eq in string comparison Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #16448|0 |1 is obsolete| | Attachment #16449|0 |1 is obsolete| | Attachment #16450|0 |1 is obsolete| | --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 17263 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17263&action=edit [PASSED QA] Bug 8746: rebuild_zebra_sliced.sh now export/index records as MARCXML This avoid indexing failures due to "bad offset" or "bad length" error with ISO2709 format + minor improvements: - --length parameter is optional. If not given, it will execute the right sql query to find the number of records to index - new parameter --reset-index. If set, index is reset before indexing Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Work as described. No errors. Test: Edit record to make it longer than 9999. Without patch rebuild_sliced fails. With patches works. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 17264 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17264&action=edit [PASSED QA] Bug 8746: Fix indexation in DOM index mode When in DOM index mode, files exported by `rebuild_zebra.pl -x` are wrapped by '<collection></collection>' tag. This is a problem because splitting files produces invalid files. This is fixed by adding the missing <collection> tags in each generated file. Another problem was that the wrong zebra configuration file was used. The script now uses C4::Context->zebraconfig($server)->{config} to know which configuration file has to be used. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 17265 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17265&action=edit Bug 8746 [Follow-up] Replace == by eq in string comparison Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> All tests and QA script pass. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #15 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master and 3.12.x. Out of curiosity, why is this script written in bash when all of the actual work is done by embedded Perl code? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8746 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED --- Comment #16 from Julian Maurice <julian.maurice@biblibre.com> ---
Out of curiosity, why is this script written in bash when all of the actual work is done by embedded Perl code? My first intent was to use only existing script/programs to achieve this work, so I choose sh. Then I progressively realized that a little bit of Perl code was needed (for example, for retrieving the indexing mode). And now that I read the code again, I have to admit you're right. Script would have been much simpler if written in Perl from the beginning.
But as such it works, so I think rewriting this script in Perl is not worth it. (But anyone who wants to do it is gracefully encouraged! ;-)) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org