Summary: | koha-rebuild-zebra is failing with "error retrieving biblio" | ||
---|---|---|---|
Product: | Koha | Reporter: | Jef Bucas <jef> |
Component: | Command-line Utilities | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | critical | ||
Priority: | P5 - low | CC: | costalc, dcook, fridolin.somers, ian.bays, jfowler, jhonmerced5, jonathan.druart, lyle, m.de.rooy, mtj, robin |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19101 | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 17600, 19687 | ||
Attachments: |
Bug 18927: Use fully qualified subroutine names in C4::Items
Bug 18927: Use fully qualified subroutine names in C4::Items Bug 18927: Use fully qualified subroutine names in C4::Items |
Description
Jef Bucas
2017-07-11 13:50:25 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. 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. *** Bug 19101 has been marked as a duplicate of this bug. *** 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 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. 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> Workaround. Looks good to me. But we still do not know what disturbs perl somewhere in those C4 modules.. Pushed to master for 17.11, thanks to everybody involved! Depends on Bug 19040 but I can easily adapt for 17.05.x Pushed to 17.05.x, will be in 17.05.04. This patch has been pushed to 16.11.x and will be in 16.11.12. How would I go about applying this particular patch? I just ran into this on a production instance. (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. After recent upgrade to 17.05.04.000 bulkmarcimport started to fail on all items attempted to be added. ERROR: Adding items to bib 1 failed: Undefined subroutine &C4::Items::TransformMarcToKoha called at /usr/share/koha/lib/C4/Items.pm line 382, <GEN46> line 1 So I manually added the prefix and the next error came up: ERROR: Adding items to bib 74925 failed: Undefined subroutine &C4::Items::GetMarcStructure called at /usr/share/koha/lib/C4/Items.pm line 2307, <GEN46> line 14. Manually adding the prefix to that line seems to have worked, but it does not feel like the right solution. (In reply to Ian Bays from comment #15) > After recent upgrade to 17.05.04.000 bulkmarcimport started to fail on all > items attempted to be added. i created a separate bug for this... bug 19687 (In reply to Katrin Fischer from comment #11) > This patch has been pushed to 16.11.x and will be in 16.11.12. Pushed to 16.05.x, for 16.05.17 release This is an interesting one... I have the exact same Koha code running on Debian Jessie and OpenSUSE. The code on OpenSUSE works fine, but the code on Debian is creating the error reported in this bug. Debian is Perl 5.20.2 using Koha apt repository and Debian apt repo for dependencies. Exporter is 5.71. OpenSUSE is Perl 5.18.2 using CPAN for dependencies. Exporter is 5.68. -- Doesn't look like there's anything important in the Exporter changelog: https://metacpan.org/changes/distribution/Exporter. -- Hmm, the C4::Items::Item2Marc function looks exactly the same in 17.05.xx as it does in older versions of Koha that worked fine on Debian. When I try the older Koha library code on Debian with a little script I've written, it works fine (notwithstanding expected database schema errors). It's an issue with the newer Koha library code... The exports look basically the same in C4::Biblio between versions. -- So it looks like something we must have done... yet it also looks like it depends on the system Perl too. Going to try a different Perl on OpenSUSE and see if that makes a difference... (In reply to Marcel de Rooy from comment #7) > Workaround. Looks good to me. But we still do not know what disturbs perl > somewhere in those C4 modules.. This is what is really bothering me... In Item2Marc, I'm doing the following: my @keys = keys %C4::Items::; use Data::Dumper; warn Dumper(\@keys); This outputs the following: $VAR1 = [ 'ModClassSource', 'getFacets', 'ModClassSortRule', 'getnbpages', 'GetLogs', 'GetMarcStructure', 'GetItemnumberFromBarcode', 'AddItem', 'b', 'ItemSafeToDelete', 'GetLatestAcquisitions', 'GetSourcesForSortRule', 'GetVariationsOfISSN', 'GetItemnumbersForBiblio', 'MoveItemFromBiblio', 'ShelfToCart', 'GetItemsByBiblioitemnumber', 'GetItemsLocationInfo', 'Dumper', 'ISA', 'get_itemnumbers_of', 'getitemtypeinfo', 'GetNormalizedOCLCNumber', 'ModZebra', 'CartToShelf', 'GetClassSortRules', 'GetVariationsOfISBN', 'ToggleNewStatus', 'ModItemTransfer', 'ModItem', 'GetFrameworkCode', 'output_pref', 'import', 'GetItem', 'GetItemInfosOf', '_parse_unlinked_item_subfields_from_xml', '__ANON__', 'GetClassSources', 'CheckItemPreSave', '_set_derived_columns_for_mod', 'getitemtypeimagedir', 'xml_escape', 'BEGIN', '_repack_item_errors', 'AddClassSource', '_find_value', 'GetMarcBiblio', 'cronlogaction', '_do_column_fixes_for_mod', 'any', '_set_derived_columns_for_add', 'dt_from_string', '_set_defaults_for_add', 'Item2Marc', '_build_default_values_for_mod_marc', 'GetAnalyticsCount', 'GetNormalizedEAN', '_mod_item_dates', 'displaylog', '_get_single_item_column', 'getitemtypeimagesrc', '_get_unlinked_subfields_xml', 'GetHiddenItemnumbers', 'GetNormalizedUPC', 'get_hostitemnumbers_of', 'GetNormalizedISBN', 'SearchItemsByField', 'EXPORT', 'GetPrinter', 'DEBUG', 'a', 'GetVariationsOfISBNs', 'ModDateLastSeen', 'Load', 'AddItemFromMarc', 'GetLastAcquisitions', 'GetItemsInfo', 'carp', 'TransformKohaToMarc', 'GetHostItemsInfo', '_get_unlinked_item_subfields', 'GetMarcItem', 'ModItemFromMarc', 'GetClassSort', 'DelItem', 'GetItemTypesCategorized', 'AUTOLOAD', 'format_sqldatetime', 'GetBarcodeFromItemnumber', 'GetLogStatus', 'getallthemes', '_marc_from_item_hash', 'AddClassSortRule', 'getitemtypeimagelocation', '_calc_items_cn_sort', 'GetPrinters', '_koha_delete_item', 'SearchItems', 'DelClassSource', 'GetClassSortRule', 'GetVariationsOfISSNs', '_SearchItems_build_where_fragment', 'NormalizeISBN', 'TransformMarcToKoha', 'GetClassSource', 'NormalizeISSN', 'GetMarcFromKohaField', 'DelItemCheck', 'GetAuthorisedValues', 'confess', 'GetLostItems', 'PrepareItemrecordDisplay', 'DelClassSortRule', '_koha_modify_item', 'AddItemBatchFromMarc', 'logaction', 'croak', 'IsMarcStructureInternal', '_koha_new_item', 'GetItemsForInventory' ]; TransformKohaToMarc appears in that list. I can use "carp" or "C4::Items::carp", but I can't use "TransformKohaToMarc" or "C4::Items::TransformKohaToMarc". But the function seems to have been imported... |