[Bug 42653] New: ILL request with log entries from multiple backends causes 500 error
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42653 Bug ID: 42653 Summary: ILL request with log entries from multiple backends causes 500 error Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: ILL Assignee: koha-bugs@lists.koha-community.org Reporter: pedro.amorim@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: lisette@bywatersolutions.com, pedro.amorim@openfifth.co.uk, tomascohen@gmail.com -- 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=42653 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=42653 --- Comment #1 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Created attachment 199339 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199339&action=edit Bug 42653: get_backend_plugin should cache results per backend name The plugin cache used a single slot, so the first backend looked up poisoned it for all subsequent calls. This caused 500 errors when viewing ILL requests that had been migrated between backends. Test plan: 1) Download and install 2 additional plugin backends that implement their own templates: https://github.com/openfifth/koha-ill-libkey-lending-tool/releases/download/... https://github.com/openfifth/koha-ill-reprintsdesk/releases/download/v4.2.0/... 2) Enable ILLModule and run the following SQL: INSERT INTO illrequests (borrowernumber, branchcode, status, backend, placed) SELECT b.borrowernumber, br.branchcode, 'COMP', 'ReprintsDesk', NOW() FROM borrowers b, branches br LIMIT 1; INSERT INTO action_logs (timestamp, user, module, action, object, info, interface) VALUES (NOW() - INTERVAL 2 HOUR, 1, 'ILL', 'INCDOCS_REQUEST_PLACED', 1, '{"log_origin":"IncDocs","response":1}', 'intranet'), (NOW() - INTERVAL 1 HOUR, 1, 'ILL', 'REPRINTS_DESK_REQUEST_ORDER_UPDATED', 1, '{"log_origin":"ReprintsDesk","response":null}', 'commandline'); 3) Attempt to open the 'Manage request' page for this newly created request: http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1 4) Notice you get a 500 error: Template process failed: file error - : not found 5) Apply all patches, restart plack, refresh. Notice the 'Manage request' page now renders correctly. 6) Click the 'ILL request log' toolbar button. Confirm that both the IncDocs and ReprintsDesk entries are shown. -- 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=42653 --- Comment #2 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Created attachment 199340 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199340&action=edit Bug 42653: Add tests prove t/db_dependent/Koha/ILL/Request.t prove t/db_dependent/Koha/Plugins/ILL/Backends.t NOTE: These must be run without having any ILL backend plugin installed -- 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=42653 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |helm.consortium@nhs.net -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42653 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Assignee|koha-bugs@lists.koha-commun |pedro.amorim@openfifth.co.u |ity.org |k -- 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=42653 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> 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=42653 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199339|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42653 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199340|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42653 --- Comment #3 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Created attachment 199368 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199368&action=edit Bug 42653: get_backend_plugin should cache results per backend name The plugin cache used a single slot, so the first backend looked up poisoned it for all subsequent calls. This caused 500 errors when viewing ILL requests that had been migrated between backends. Test plan: 1) Download and install 2 additional plugin backends that implement their own templates: https://github.com/openfifth/koha-ill-libkey-lending-tool/releases/download/... https://github.com/openfifth/koha-ill-reprintsdesk/releases/download/v4.2.0/... 2) Enable ILLModule and run the following SQL: INSERT INTO illrequests (borrowernumber, branchcode, status, backend, placed) SELECT b.borrowernumber, br.branchcode, 'COMP', 'ReprintsDesk', NOW() FROM borrowers b, branches br LIMIT 1; INSERT INTO action_logs (timestamp, user, module, action, object, info, interface) VALUES (NOW() - INTERVAL 2 HOUR, 1, 'ILL', 'INCDOCS_REQUEST_PLACED', 1, '{"log_origin":"IncDocs","response":1}', 'intranet'), (NOW() - INTERVAL 1 HOUR, 1, 'ILL', 'REPRINTS_DESK_REQUEST_ORDER_UPDATED', 1, '{"log_origin":"ReprintsDesk","response":null}', 'commandline'); 3) Attempt to open the 'Manage request' page for this newly created request: http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1 4) Notice you get a 500 error: Template process failed: file error - : not found 5) Apply all patches, restart plack, refresh. Notice the 'Manage request' page now renders correctly. 6) Click the 'ILL request log' toolbar button. Confirm that both the IncDocs and ReprintsDesk entries are shown. Signed-off-by: Hannah Prince <helm.consortium.nhs.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42653 --- Comment #4 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Created attachment 199369 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199369&action=edit Bug 42653: Add tests prove t/db_dependent/Koha/ILL/Request.t prove t/db_dependent/Koha/Plugins/ILL/Backends.t NOTE: These must be run without having any ILL backend plugin installed Signed-off-by: Hannah Prince <helm.consortium.nhs.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42653 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremy.evans@ukhsa.gov.uk -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org