[Bug 36421] New: REST API 500 errors say to check the logs, but suppress errors that would be there
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Bug ID: 36421 Summary: REST API 500 errors say to check the logs, but suppress errors that would be there Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com CC: tomascohen@gmail.com If a REST auth error happens that that is unblessed or uncaught, we should warn the value to the logs. Test Plan: 1) Install the curbside pickups plugin 2) create a patron with the userid 'puser' and the cardnumber 'pcard' 3) GET /api/v1/contrib/curbsidepickup/patrons/XXX/pickups using basic auth with the username 'pcard' where XXX is the patron borrowernumber 4) Note there is no error in the logs -- 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=36421 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- 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=36421 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36420 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 163856 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163856&action=edit Bug 36421: REST API 500 errors say to check the logs, but suppress errors that would be there If a REST auth error happens that that is unblessed or uncaught, we should warn the value to the logs. Test Plan: 1) Install the curbside pickups plugin 2) create a patron with the userid 'puser' and the cardnumber 'pcard' 3) GET /api/v1/contrib/curbsidepickup/patrons/XXX/pickups using basic auth with the username 'pcard' where XXX is the patron borrowernumber 4) Note there is no error in the logs 5) Apply this patch 6) Repeat step 3 7) You should now see an error in the logs! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I noticed a bug in the basic Auth code that makes it easy to highlight this issue. If you don't mind, Kyle, I'll provide an alternate patch for this. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163856|0 |1 is obsolete| | --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 163994 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163994&action=edit Bug 36421: Make sure pre-controller errors are correctly logged If something explodes in Koha::REST::V1::Auth chances are that no logging will happen. This patch makes sure they are! To test: 1. Make sure you do NOT have 36420 on your tree 2. Make sure you are looking at the logs: $ ktd --shell k$ koha-plack --restart kohadev; tail -f /var/log/koha/kohadev/*.log 3. Use Postman or similar for hitting some known endpoint. Use the user's cardnumber instead of the userid. On a default KTD launch, the generated user's cardnumber is '42'. GET /patrons => FAIL: You get a 500 error (expected, fixed on 36420) but no useful logging found. 4. Apply this patch 5. Ctrl+c on the logs and re-run the command 6. Repeat 3 => SUCCESS: You get a 500, but you also get the exception information logged! 7. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|REST API 500 errors say to |Better logging of 500 |check the logs, but |errors in V1/Auth.pm |suppress errors that would | |be there | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Kyle M Hall <kyle@bywatersolutions.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=36421 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163994|0 |1 is obsolete| | --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 163995 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163995&action=edit Bug 36421: Make sure pre-controller errors are correctly logged If something explodes in Koha::REST::V1::Auth chances are that no logging will happen. This patch makes sure they are! To test: 1. Make sure you do NOT have 36420 on your tree 2. Make sure you are looking at the logs: $ ktd --shell k$ koha-plack --restart kohadev; tail -f /var/log/koha/kohadev/*.log 3. Use Postman or similar for hitting some known endpoint. Use the user's cardnumber instead of the userid. On a default KTD launch, the generated user's cardnumber is '42'. GET /patrons => FAIL: You get a 500 error (expected, fixed on 36420) but no useful logging found. 4. Apply this patch 5. Ctrl+c on the logs and re-run the command 6. Repeat 3 => SUCCESS: You get a 500, but you also get the exception information logged! 7. Sign off :-D Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=36421 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163995|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 164117 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164117&action=edit Bug 36421: Make sure pre-controller errors are correctly logged If something explodes in Koha::REST::V1::Auth chances are that no logging will happen. This patch makes sure they are! To test: 1. Make sure you do NOT have 36420 on your tree 2. Make sure you are looking at the logs: $ ktd --shell k$ koha-plack --restart kohadev; tail -f /var/log/koha/kohadev/*.log 3. Use Postman or similar for hitting some known endpoint. Use the user's cardnumber instead of the userid. On a default KTD launch, the generated user's cardnumber is '42'. GET /patrons => FAIL: You get a 500 error (expected, fixed on 36420) but no useful logging found. 4. Apply this patch 5. Ctrl+c on the logs and re-run the command 6. Repeat 3 => SUCCESS: You get a 500, but you also get the exception information logged! 7. Sign off :-D Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> [OK] prove t/db_dependent/api/v1/items.t t/db_dependent/api/v1/unhandled_exceptions.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |m.de.rooy@rijksmuseum.nl CC| |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=36421 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|24.05.00 |24.05.00,23.11.06 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.05.00,23.11.06 |24.05.00,23.11.06,23.05.12 released in| | CC| |lucas@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 23.05.x for upcoming 23.05.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36421 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED --- Comment #9 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org