Hi I'm having a problem with checkin/check out items Everytime process checkout and checkin of books I always proceed to error 500 but when I refresh the page the item was already checked-out/in to the borrower. here is my error log report [Thu Mar 14 14:49:53.514416 2024] [cgi:error] [pid 26862] [client 192.168.1.103:54220] AH01215: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'interface' in 'field list' at /usr/share/koha/lib/Koha/Object.pm line 170: /usr/share/koha/intranet/cgi-bin/svc/renew, referer: http://192.168.1.103:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=1
Oh sorry wrong error log report THis is the correct one [Thu Mar 14 15:37:06.704177 2024] [cgi:error] [pid 30561] [client 192.168.1.103:41208] AH01215: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'interface' in 'field list' at /usr/share/koha/lib/Koha/Object.pm line 170: /usr/share/koha/intranet/cgi-bin/circ/circulation.pl, referer: http://(myip):8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=1
Which version of Koha are you using (exact version as shown on the About page) and did you recently update/upgrade?
yes I recently update & upgrade I was using before koha 22.11 but I decided to install a newer version my current koha version is = Koha 23.11.03 , I found some bugs / problems with the newer version such as checking in/out and item would lead me to error500, but when I refresh the page the item is processed/ recorded to the borrower. In addition I found out that when I renew a book the due date but its not updating to a new one.
(In reply to Katrin Fischer from comment #2) > Which version of Koha are you using (exact version as shown on the About > page) and did you recently update/upgrade? yes I recently update & upgrade I was using before koha 22.11 but I decided to install a newer version my current koha version is = Koha 23.11.03 , I found some bugs / problems with the newer version such as checking in/out and item would lead me to error500, but when I refresh the page the item is processed/ recorded to the borrower. In addition I found out that when I renew a book the due date but its not updating to a new one.
This sounds like a support problem. Someone would need to look into the logs, database structure, etc for more information here. This is one of those ones where it'll be good when we do have the database auditor information web accessible I suppose...
(In reply to David Cook from comment #5) > This sounds like a support problem. Someone would need to look into the > logs, database structure, etc for more information here. > > This is one of those ones where it'll be good when we do have the database > auditor information web accessible I suppose... Because it sounds to me like this is related to the checkout_renewals table and it missing the `interface` column, but that's weird, because that was added for 22.11, so unlikely to be related to an upgrade from 22.11 to 23.11. So something strange going on here. I recently upgraded 21.05 to 23.11 and had no problems like this.
Christian, can you confirm this? Do you see the column in the DB? Use 'desc checkout_renewals;' in the database CLI.
This is a major regression. Raised priority.
We are having the same symptom, e.g. a 500 error when checking in / checking out. However, instead of an error with the database, we have the following in the Apache error log: Undefined subroutine &C4::Circulation::CheckReserves called at /[path to koha]/C4/Circulation.pm line 1179.
I can confirm everything works fine on the ByWater sandboxes as well as our local Koha Testing Docker installations, using the exact same code that is problematic with our regular installation. So it looks like it's not a problem with the code, but rather something to do with an environment variable, maybe a path, etc.
(In reply to Jonathan Druart from comment #7) > Christian, can you confirm this? Do you see the column in the DB? > > Use 'desc checkout_renewals;' in the database CLI. here is the result ------> mysql> desc checkout_renewals; +--------------+----------------------------+------+-----+-------------------+-------------------+ | Field | Type | Null | Key | Default | Extra | +--------------+----------------------------+------+-----+-------------------+-------------------+ | renewal_id | int | NO | PRI | NULL | auto_increment | | checkout_id | int | YES | | NULL | | | renewer_id | int | YES | MUL | NULL | | | seen | tinyint(1) | YES | | 0 | | | interface | varchar(16) | NO | | NULL | | | timestamp | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED | | renewal_type | enum('Automatic','Manual') | NO | | Manual | | +--------------+----------------------------+------+-----+-------------------+-------------------+ 7 rows in set (0.00 sec)
We have seen the error 500 with a broken CHECKOUT/CHECKIN or HOLD notice template. Maybe something to check (deactivate in the messaging preferences for the patron or make sure there is no hold info coming up, see if that works)
(In reply to Katrin Fischer from comment #12) > We have seen the error 500 with a broken CHECKOUT/CHECKIN or HOLD notice > template. Maybe something to check (deactivate in the messaging preferences > for the patron or make sure there is no hold info coming up, see if that > works) Deactivate the messaging preferences - not working Hold info - I disable the patrons ability to place hold in opac but its not working
What I meant was that the creation of a HOLD slip with broken syntax could cause it - slightly different as it could be a hold for another patron. Some other things to check: do your items have a b and y (homebranch, holdingbranch and itemtype) set?
(In reply to Olivier Hubert from comment #9) > We are having the same symptom, e.g. a 500 error when checking in / checking > out. However, instead of an error with the database, we have the following > in the Apache error log: > > Undefined subroutine &C4::Circulation::CheckReserves called at /[path to > koha]/C4/Circulation.pm line 1179. Were you able to solve what caused this error? I'm currently facing the same problem in my development environment.
(In reply to Emmi Takkinen from comment #15) > (In reply to Olivier Hubert from comment #9) > > We are having the same symptom, e.g. a 500 error when checking in / checking > > out. However, instead of an error with the database, we have the following > > in the Apache error log: > > > > Undefined subroutine &C4::Circulation::CheckReserves called at /[path to > > koha]/C4/Circulation.pm line 1179. > > Were you able to solve what caused this error? I'm currently facing the same > problem in my development environment. Do you have the problem using ktd? If so, which steps can I use to recreate it?
As it's CheckReserves... we once had a error 500 on checkin with a broken HOLD tt template. Could it be trying to trigger a notice?
(In reply to Emmi Takkinen from comment #15) > (In reply to Olivier Hubert from comment #9) > > We are having the same symptom, e.g. a 500 error when checking in / checking > > out. However, instead of an error with the database, we have the following > > in the Apache error log: > > > > Undefined subroutine &C4::Circulation::CheckReserves called at /[path to > > koha]/C4/Circulation.pm line 1179. > > Were you able to solve what caused this error? I'm currently facing the same > problem in my development environment. We still have the issue. The only workaround we have found so far is to add C4::Reserves before the CheckReserves call on line 1179 of Circulation.pm. So instead of my ( $restype, $res ) = CheckReserves( $item_object ); use my ( $restype, $res ) = C4::Reserves::CheckReserves( $item_object ); As we are not using the current master version in production, we have postponed investigating the actual cause of the issue.
(In reply to Jonathan Druart from comment #16) > (In reply to Emmi Takkinen from comment #15) > > (In reply to Olivier Hubert from comment #9) > > > We are having the same symptom, e.g. a 500 error when checking in / checking > > > out. However, instead of an error with the database, we have the following > > > in the Apache error log: > > > > > > Undefined subroutine &C4::Circulation::CheckReserves called at /[path to > > > koha]/C4/Circulation.pm line 1179. > > > > Were you able to solve what caused this error? I'm currently facing the same > > problem in my development environment. > > Do you have the problem using ktd? If so, which steps can I use to recreate > it? I'm using git installation with a freshly installed database and this happens every time I try to check out or check in any item. When I check out, the error happens in C4/Circulation.pm line 1179 as Olivier said. When I check in it's in C4/Circulation.pm line 2435.
Did some testing on that "Undefined subroutine &C4::Circulation::CheckReserves" error: - this happens also with old database - doesn't happen with latest 23.11 release or with sandboxes, only with master - tests using CheckReserves (without C4::Reserves:: before it) pass as far as I can tell - I made a simple test script that calls CheckReserves and it works It seems there is something in bug 27595 patch "Bug 27595: Add place_hold method to Koha::Suggestion" that causes this. Before that patch check in works as is should, after it 500 error occurs.
(In reply to Emmi Takkinen from comment #20) > Did some testing on that "Undefined subroutine > &C4::Circulation::CheckReserves" error: > > - this happens also with old database > - doesn't happen with latest 23.11 release or with sandboxes, only with > master > - tests using CheckReserves (without C4::Reserves:: before it) pass as far > as I can tell > - I made a simple test script that calls CheckReserves and it works > > It seems there is something in bug 27595 patch "Bug 27595: Add place_hold > method to Koha::Suggestion" that causes this. Before that patch check in > works as is should, after it 500 error occurs. If I remove line >use C4::Reserves qw( AddReserve ); from Suggestion.pm checkin/checkout starts to work again.
(In reply to Emmi Takkinen from comment #21) > (In reply to Emmi Takkinen from comment #20) > > Did some testing on that "Undefined subroutine > > &C4::Circulation::CheckReserves" error: > > > > - this happens also with old database > > - doesn't happen with latest 23.11 release or with sandboxes, only with > > master > > - tests using CheckReserves (without C4::Reserves:: before it) pass as far > > as I can tell > > - I made a simple test script that calls CheckReserves and it works > > > > It seems there is something in bug 27595 patch "Bug 27595: Add place_hold > > method to Koha::Suggestion" that causes this. Before that patch check in > > works as is should, after it 500 error occurs. > > If I remove line > >use C4::Reserves qw( AddReserve ); > > from Suggestion.pm checkin/checkout starts to work again. Jonathan, any ideas why removing line use C4::Reserves qw( AddReserve ); fixes this?
Circular dependencies and how the order we load the modules. No idea why it's not finding CheckReserves whereas it is in the same module... We got hit already by similar bugs, see bug 17539, bug 17600 (and I can find the other ones right now). The solution from Olivier, comment 18 is the way to go.
Created attachment 164674 [details] [review] Bug 36313: Fix Undefined subroutine &C4::Circulation::CheckReserves error On (at least) git installations of Koha checkouts and checkins fail on error 500. Logs have following error: Undefined subroutine &C4::Circulation::CheckReserves called... Error happens also when one tries to open patrons checkouts from detail page. Koha doesn't die but table just keeps loading. Solution is to add C4::Reserves before CheckReserves when it's called from Circulation.pm. To test: 1. Apply this patch. 2. Try to check out and check in item. => Confirm both operations are succesfull. 3. Attempt to open patrons checkouts from patron detail and checkout page. => Table should load Also prove t/db_dependent/Circulation.t. Sponsored-by: Koha-Suomi Oy
How can this bug reproduced in KTD?
Created attachment 164859 [details] [review] Bug 36313: Fix Undefined subroutine &C4::Circulation::CheckReserves error On (at least) git installations of Koha checkouts and checkins fail on error 500. Logs have following error: Undefined subroutine &C4::Circulation::CheckReserves called... Error happens also when one tries to open patrons checkouts from detail page. Koha doesn't die but table just keeps loading. Solution is to add C4::Reserves before CheckReserves when it's called from Circulation.pm. To test: 1. Apply this patch. 2. Try to check out and check in item. => Confirm both operations are succesfull. 3. Attempt to open patrons checkouts from patron detail and checkout page. => Table should load Also prove t/db_dependent/Circulation.t. Sponsored-by: Koha-Suomi Oy Signed-off-by: BabaJaga <babajagawgoglach@gmail.com>
(In reply to Owen Leonard from comment #25) > How can this bug reproduced in KTD? You probably can't. Sandboxes work and Olivier said in comment 10 that their KTD installations work. So this seems to be purely git installation problem.
Created attachment 165542 [details] [review] Bug 36313: Fix Undefined subroutine &C4::Circulation::CheckReserves error On (at least) git installations of Koha checkouts and checkins fail on error 500. Logs have following error: Undefined subroutine &C4::Circulation::CheckReserves called... Error happens also when one tries to open patrons checkouts from detail page. Koha doesn't die but table just keeps loading. Solution is to add C4::Reserves before CheckReserves when it's called from Circulation.pm. To test: 1. Apply this patch. 2. Try to check out and check in item. => Confirm both operations are succesfull. 3. Attempt to open patrons checkouts from patron detail and checkout page. => Table should load Also prove t/db_dependent/Circulation.t. Sponsored-by: Koha-Suomi Oy Signed-off-by: BabaJaga <babajagawgoglach@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.06
Backported to 23.05.x for upcoming 23.05.12