[Bug 33718] New: _new_Zconn may crash on missing context
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Bug ID: 33718 Summary: _new_Zconn may crash on missing context Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org Related to enabling pref LinkerRelink and friends, and running build_sample_biblio in a test like I found with Koha/Pseudonymization.t. See test plan for enabling prefs on report 33277 Debugging brought me to this line: my $host = _common_config($server, 'listen')->{content}; The crash: {UNKNOWN}: Can't use string ("authorities") as a HASH ref while "strict refs" in use at /usr/share/koha/C4/Context.pm line 590. at /usr/share/koha/C4/Biblio.pm line 304 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com, | |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=33277 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- If it's from tests only you need to call mock_userenv. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #1)
If it's from tests only you need to call mock_userenv.
It is a weird error that cannot be reproduced consistently yet. Context passes a second 'listen' parameter to Koha::Config->get and in that routine I did not see that parameter. Needs a bit more digging still. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Got it. Patch coming. It is a more fundamental error in t::lib::Mocks. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|_new_Zconn may crash on |_new_Zconn may crash on |missing context |wrong results from | |Koha::Config->get -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|_new_Zconn may crash on |_new_Zconn crashes on a bug |wrong results from |in |Koha::Config->get |t::lib::Mocks::mock_config -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 151074 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151074&action=edit Bug 33718: Fix the mock of Koha::Config->get in mock_config It should not mock calls for other sections than 'config' in koha-conf.xml. Test plan: Without this patch: [1] Enable CatalogModuleRelink and LinkerRelink. This will trigger a SearchAuthorities call when creating a sample biblio. Note: SearchAuthorities calls Zconn and gets back information from a wrong part of koha-conf.xml. [2] Run t/db_dependent/Koha/Pseudonymization.t You should see something like: {UNKNOWN}: Can't use string ("authorities") as a HASH ref while "strict refs" in use at /usr/share/koha/C4/Context.pm line 587. at /usr/share/koha/C4/Biblio.pm line 302 With this patch: [3] Run t/db_dependent/Koha/Pseudonymization.t. Should pass now. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151074|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 151075 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151075&action=edit Bug 33718: Fix the mock of Koha::Config->get in mock_config It should not mock calls for other sections than 'config' in koha-conf.xml. Test plan: Without this patch: [1] Enable CatalogModuleRelink and LinkerRelink. This will trigger a SearchAuthorities call when creating a sample biblio. Note: SearchAuthorities calls Zconn and gets back information from a wrong part of koha-conf.xml. [2] Run t/db_dependent/Koha/Pseudonymization.t You should see something like: {UNKNOWN}: Can't use string ("authorities") as a HASH ref while "strict refs" in use at /usr/share/koha/C4/Context.pm line 587. at /usr/share/koha/C4/Biblio.pm line 302 With this patch: [3] Run t/db_dependent/Koha/Pseudonymization.t. Should pass now. [4] git grep -l mock_config | xargs -i{} prove {} Exclude Mocks.pm. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Note for QA: The crash refers to authorities (this comes from config/authorityserver in koha-conf while we expected information from the listen section in this line: my $host = _common_config($server, 'listen')->{content}; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151075|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 151101 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151101&action=edit Bug 33718: Fix the mock of Koha::Config->get in mock_config It should not mock calls for other sections than 'config' in koha-conf.xml. Test plan: Without this patch: [1] Enable CatalogModuleRelink and LinkerRelink. This will trigger a SearchAuthorities call when creating a sample biblio. Note: SearchAuthorities calls Zconn and gets back information from a wrong part of koha-conf.xml. [2] Run t/db_dependent/Koha/Pseudonymization.t You should see something like: {UNKNOWN}: Can't use string ("authorities") as a HASH ref while "strict refs" in use at /usr/share/koha/C4/Context.pm line 587. at /usr/share/koha/C4/Biblio.pm line 302 With this patch: [3] Run t/db_dependent/Koha/Pseudonymization.t. Should pass now. [4] git grep -l mock_config | xargs -i{} prove {} Exclude Mocks.pm. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #8 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. I had to enable AutoLinkBiblios to get the error message in step 2 (see comment 59 in bug 33277). 2. Tests pass with no errors after applying the patch. 3. For step 4, I ran: git grep -l mock_config | xargs -i{} prove {} => lots of tests are run and these should all pass except for t/lib/Mocks.pm t/lib/Mocks.pm .. No subtests run Test Summary Report ------------------- t/lib/Mocks.pm (Wstat: 0 Tests: 0 Failed: 0) Parse errors: No plan found in TAP output Files=1, Tests=0, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.16 cusr 0.03 csys = 0.20 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Nind from comment #8) Thx David.
1. I had to enable AutoLinkBiblios to get the error message in step 2 (see comment 59 in bug 33277).
I checked my setup. Yes, I had it enabled. Good catch.
t/lib/Mocks.pm .. No subtests run
Yes, that was expected :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151101|0 |1 is obsolete| | --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 151110 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151110&action=edit Bug 33718: Fix the mock of Koha::Config->get in mock_config It should not mock calls for other sections than 'config' in koha-conf.xml. Test plan: Without this patch: [1] Enable AutoLinkBiblios, CatalogModuleRelink and LinkerRelink. This will trigger a SearchAuthorities call when creating a sample biblio. Note: SearchAuthorities calls Zconn and gets back information from a wrong part of koha-conf.xml. [2] Run t/db_dependent/Koha/Pseudonymization.t You should see something like: {UNKNOWN}: Can't use string ("authorities") as a HASH ref while "strict refs" in use at /usr/share/koha/C4/Context.pm line 587. at /usr/share/koha/C4/Biblio.pm line 302 With this patch: [3] Run t/db_dependent/Koha/Pseudonymization.t. Should pass now. [4] git grep -l mock_config | xargs -i{} prove {} Exclude Mocks.pm. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Updated the test plan for pref AutoLinkBiblios. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151110|0 |1 is obsolete| | --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 151170 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151170&action=edit Bug 33718: Fix the mock of Koha::Config->get in mock_config It should not mock calls for other sections than 'config' in koha-conf.xml. Test plan: Without this patch: [1] Enable AutoLinkBiblios, CatalogModuleRelink and LinkerRelink. This will trigger a SearchAuthorities call when creating a sample biblio. Note: SearchAuthorities calls Zconn and gets back information from a wrong part of koha-conf.xml. [2] Run t/db_dependent/Koha/Pseudonymization.t You should see something like: {UNKNOWN}: Can't use string ("authorities") as a HASH ref while "strict refs" in use at /usr/share/koha/C4/Context.pm line 587. at /usr/share/koha/C4/Biblio.pm line 302 With this patch: [3] Run t/db_dependent/Koha/Pseudonymization.t. Should pass now. [4] git grep -l mock_config | xargs -i{} prove {} Exclude Mocks.pm. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #12)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Thx -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.05.00 released in| | Status|Passed QA |Pushed to master --- Comment #14 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 23.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.05.00 |23.05.00,22.11.07 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33718 --- Comment #15 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Nice work everyone! Pushed to 22.11.x for next release -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org