[Bug 40324] New: Can't get details of patron: 500 error
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40324 Bug ID: 40324 Summary: Can't get details of patron: 500 error Change sponsored?: --- Product: Koha Version: 24.11 Hardware: PC OS: Linux Status: NEW Severity: critical Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: joek@churchrenewal.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Created attachment 183850 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183850&action=edit Entire log. Is very short. (I've replaced my domain name(s) and hostname(s) with MY_DOMAIN below) I click on the patron like normal in the table that shows which copy of the book is out to which patron, and I'm served a 500 error page. The URL the link goes to is MY_DOMAIN/cgi-bin/koha/members/moremember.pl?borrowernumber=2518 I've attached the entirety of plack-error.log. The log file must've rotated recently. Koha version: 24.11.04.000 OS version ('uname -a'): Linux MY_DOMAIN 6.8.0-63-generic #66-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:25:30 UTC 2025 x86_64 Perl interpreter: /usr/bin/perl Perl version: 5.038002 MySQL version: 5.5.5-10.11.13-MariaDB-0ubuntu0.24.04.1 Apache version: Server version: Apache/2.4.58 (Ubuntu) PSGI: Plack (deployment) Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_koha | Status: running. | Config read from: koha-conf.xml Zebra version: Zebra 2.2.7 (C) 1994-2023, [...] SHA1 ID: ac40f289672405a299436d73c1532f9906774cc6 Using ICU Zebra status: Running Message broker: Using RabbitMQ Date and time: 2025-07-07 04:09 PM Time zone: Used: America/Winnipeg | Config: America/Winnipeg | Environment (TZ): Undefined Feel free to ask for more details. -- 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=40324 --- Comment #1 from Joe Koop <joek@churchrenewal.com> --- I've done some more poking around. 0 of my 2150 unrestricted patrons[1] have this issue. 257 of my 827 restricted patrons[2] have this issue. ----- [1]: SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.surname, borrowers.firstname, borrowers.debarred, borrowers.debarredcomment FROM borrowers WHERE borrowers.debarred IS NULL AND NOT EXISTS ( SELECT 1 FROM borrower_debarments WHERE borrower_debarments.borrowernumber = borrowers.borrowernumber ) ORDER BY borrowers.cardnumber [2]: SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.surname, borrowers.firstname, borrowers.debarred, borrowers.debarredcomment FROM borrowers WHERE borrowers.debarred IS NOT NULL OR EXISTS ( SELECT 1 FROM borrower_debarments WHERE borrower_debarments.borrowernumber = borrowers.borrowernumber ) ORDER BY borrowers.cardnumber -- 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=40324 --- Comment #2 from Joe Koop <joek@churchrenewal.com> --- I've done even more poking around. The patrons who are broken are missing a "borrower_debarments" record. We have a custom script that wrangles patrons, syncing them with another system, and barring them if they don't exist in the other system. Our custom script must be misbehaving. There is still an issue, however. Koha should handle missing "borrower_debarments" records, even if it's automatically adding a placeholder one, or doing something else. I'm leaving this bug open. -- 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=40324 Joe Koop <joek@churchrenewal.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |minor -- 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=40324 Joe Koop <joek@churchrenewal.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Can't get details of |moremember.pl crashes when |patron: 500 error |a barred patron doesn't | |have a borrower_debarments | |record -- 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=40324 Ray Delahunty <r.delahunty@arts.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |r.delahunty@arts.ac.uk --- Comment #3 from Ray Delahunty <r.delahunty@arts.ac.uk> --- We have 206 records in our 24.11.09 system that have this problem. It appears to happen where the debarred field is '9999-12-31' but where there is nothing in the debarredcomment. SELECT borrowernumber, debarred, debarredcomment FROM borrowers WHERE length(debarredcomment)=0 AND debarred='9999-12-31' -- 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=40324 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 187717 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187717&action=edit Bug 40324: Prevent 500 when no borrower_debarments for debarred patrons There are reports of crash when viewing patron records that are debarred but does not have a borrower_debarments entry. We should know how those records have been created. It's data inconsistency and I don't think we should deal with that in the code. The DB structure is not really correct: we should not have borrowers.debarred, but we kept it for historical reasons (and reports). This patch fixes the 500, but there are then other problems on the screen: Top of the screen: " Account restricted since " Under the "Restrictions (0)" tab: "Patron is currently unrestricted." -- 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=40324 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com Status|NEW |In Discussion --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- https://chat.koha-community.org/koha-community/pl/g6978mah9f8dtgiycwnnpzmufr I've attached a patch but I don't think it's a problem that should be fixed, it's an import problem it seems. however we could: Improve the import code (if the problem still exists in recent versions) Add a data inconsistency check to catch this proble -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org