Bug 18927 - koha-rebuild-zebra is failing with "error retrieving biblio"
Summary: koha-rebuild-zebra is failing with "error retrieving biblio"
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Whiteboard:
Keywords:
: 19101 (view as bug list)
Depends on:
Blocks: 17600
  Show dependency treegraph
 
Reported: 2017-07-11 13:50 UTC by Jef Bucas
Modified: 2017-10-09 16:44 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18927: Use fully qualified subroutine names in C4::Items (8.27 KB, patch)
2017-09-04 15:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18927: Use fully qualified subroutine names in C4::Items (8.31 KB, patch)
2017-09-05 13:13 UTC, Lee Jamison
Details | Diff | Splinter Review
Bug 18927: Use fully qualified subroutine names in C4::Items (8.41 KB, patch)
2017-09-06 11:21 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jef Bucas 2017-07-11 13:50:25 UTC
Using Debian packages:
koha:~# dpkg -l | grep koha
ii  koha-common                           17.05.01-1                         all          integrated (physical) library management system
ii  libcgi-session-driver-memcached-perl  0.04-1koha2                        all          Perl module to allow CGI sessions to be stored in memcache
ii  libconvert-basen-perl                 0.01-1koha1                        all          perl module for encoding and decoding of base{2,4,8,16,32,64} strings
ii  libdbix-runsql-perl                   0.14-1~koha1                       all          module to run an SQL file via a DBI handle
ii  libjson-validator-perl                0.67+dfsg-1~koha1                  all          module to validate data against a JSON schema
ii  libmarc-record-perl                   2.0.6-1koha1                       all          Perl extension for handling MARC records
ii  libmojolicious-perl                   6.15+dfsg-1~koha1                  all          simple, yet powerful, Web Application Framework
ii  libpdf-fromhtml-perl                  0.31-1~koha1                       all          module to convert HTML documents to PDF
ii  libpdf-reuse-perl                     0.36-1koha1                        all          Reuse and mass produce PDF documents
ii  libpdf-writer-perl                    0.06-1~koha1                       all          PDF writer abstraction layer
ii  libswagger2-perl                      0.77-1~koha1                       all          Perl module for generating, parsing and transforming swagger API documentation
ii  libtemplate-plugin-htmltotext-perl    0.03-1koha1                        all          Plugin interface to HTML::FormatText
ii  libtemplate-plugin-json-escape-perl   0.2-1koha1                         all          module for embedding JSON strings in Template Toolkit
ii  libtemplate-plugin-stash-perl         1.006-1~koha1                      all          Template::Toolkit plugin that exposes the template's stash



# koha-rebuild-zebra -f -v koha
returns a lot of errors:
[...]
error retrieving biblio 94540 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.
error retrieving biblio 94541 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.
error retrieving biblio 94542 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.
error retrieving biblio 94543 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.
error retrieving biblio 94544 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.
error retrieving biblio 94545 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.
error retrieving biblio 94546 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.
error retrieving biblio 94547 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.
error retrieving biblio 94548 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.
error retrieving biblio 94549 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.
[...]


Although the 'use' is clearly defined:
use C4::Biblio;

specifying the full perl library/function name in those 2 files fixes it:
for p in /usr/share/koha/bin/migration_tools/rebuild_zebra.pl /usr/share/koha/lib/C4/Items.pm; do
for f in GetMarcFromKohaField GetMarcBiblio GetBiblionumberFromItemnumber TransformKohaToMarc GetFrameworkCode; do
sed -i -e "s/$f/C4::Biblio::$f/g" $p
done
done
Comment 1 Claudio 2017-08-17 17:02:21 UTC
Jef,

I have the same problem in a production installation. I need your opinion about to follow your suggestion to fix it. I've open bz #19101 because a similar problem.
Comment 2 Claudio 2017-08-18 14:38:27 UTC
Jef,

The problem was fixed in my installation aplying your suggestion. I think this bug is not an enhancement but a major or critical one.
Comment 3 Katrin Fischer 2017-08-18 15:25:52 UTC
*** Bug 19101 has been marked as a duplicate of this bug. ***
Comment 4 Jonathan Druart 2017-09-04 15:10:47 UTC
Created attachment 66823 [details] [review]
Bug 18927: Use fully qualified subroutine names in C4::Items

rebuild_zebra.pl fails in some conditions (perl version?)
I do not recreate but it has been reported that reindex fails with:
  error retrieving biblio 94540 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.

To fix it we can use fully qualified subroutine names for:
  GetMarcFromKohaField
  GetMarcBiblio
  GetBiblionumberFromItemnumber
  TransformKohaToMarc
  GetFrameworkCode

Test plan:
Confirm the rebuild_zebra script still works correctly after this patch
Comment 5 Lee Jamison 2017-09-05 13:13:34 UTC
Created attachment 66850 [details] [review]
Bug 18927: Use fully qualified subroutine names in C4::Items

rebuild_zebra.pl fails in some conditions (perl version?)
I do not recreate but it has been reported that reindex fails with:
  error retrieving biblio 94540 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.

To fix it we can use fully qualified subroutine names for:
  GetMarcFromKohaField
  GetMarcBiblio
  GetBiblionumberFromItemnumber
  TransformKohaToMarc
  GetFrameworkCode

Test plan:
Confirm the rebuild_zebra script still works correctly after this patch

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Script works correctly after patch is applied.
Comment 6 Marcel de Rooy 2017-09-06 11:21:34 UTC
Created attachment 66869 [details] [review]
Bug 18927: Use fully qualified subroutine names in C4::Items

rebuild_zebra.pl fails in some conditions (perl version?)
I do not recreate but it has been reported that reindex fails with:
  error retrieving biblio 94540 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751.

To fix it we can use fully qualified subroutine names for:
  GetMarcFromKohaField
  GetMarcBiblio
  GetBiblionumberFromItemnumber
  TransformKohaToMarc
  GetFrameworkCode

Test plan:
Confirm the rebuild_zebra script still works correctly after this patch

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Marcel de Rooy 2017-09-06 11:22:53 UTC
Workaround. Looks good to me. But we still do not know what disturbs perl somewhere in those C4 modules..
Comment 8 Jonathan Druart 2017-09-06 16:32:21 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 9 Fridolin SOMERS 2017-09-12 14:45:21 UTC
Depends on Bug 19040 but I can easily adapt for 17.05.x
Comment 10 Fridolin SOMERS 2017-09-12 14:54:19 UTC
Pushed to 17.05.x, will be in 17.05.04.
Comment 11 Katrin Fischer 2017-09-16 06:53:10 UTC
This patch has been pushed to 16.11.x and will be in 16.11.12.
Comment 12 jfowler 2017-09-21 21:08:25 UTC
How would I go about applying this particular patch? I just ran into this on a production instance.
Comment 13 Jonathan Druart 2017-09-21 21:21:39 UTC
(In reply to jfowler from comment #12)
> How would I go about applying this particular patch? I just ran into this on
> a production instance.

If you are using 16.05.x, 16.11.x or 17.05.x, you just need to upgrade using apt.