[Bug 37552] New: Automatic renewals cronjob can die when an item scheduled for renewal is checked in
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 Bug ID: 37552 Summary: Automatic renewals cronjob can die when an item scheduled for renewal is checked in Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com We start the automatic_renewal cron by getting all the checkouts that might be renewed We then loop through and try to renew each. In a large system this can take some time. If during that time an item in the list is checked in the cronjob will die when it tries to update the checkout. In my testing it only happens for items that will not be renewed. To recreate: 1 - Checkout an item to a patron and mark it for auto renewal 2 - Add 'sleep(10);' to the cronjob at line 194 3 - perl misc/cronjobs/automatic_renewals.pl -v -c 4 - Check the item in (quickly) 5 - The cron dies: DBIx::Class::Row::update(): Can't update Koha::Schema::Result::Issue=HASH(0x586e1a674fb0): row not found at /kohadevbox/koha/Koha/Object.pm line 172 DBIx::Class::Row::update(): Can't update Koha::Schema::Result::Issue=HASH(0x586e1a674fb0): row not found at /kohadevbox/koha/Koha/Object.pm line 172 -- 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=37552 --- Comment #1 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 169966 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169966&action=edit Bug 37552: Wrap auto renewal attempt in eval to ensure script does not die When libraries have a lot of checkouts, or an AMH, checkins can happen while the cron is running. This patch simply adds an eval around the auto renewal attempt in case of early check in or other errors. You can verify cron completed by enabling cronjob log in system preferences and checking the action logs To test: 1 - Add 'sleep(10);' to automatic_renewals.pl 2 - Set circulation rules to enable automatic renewals 3 - Issue an item to a patron 4 - perl misc/cronjobs/automatic_renewals.pl -v 5 - Confirm item would not be renewed 6 - perl misc/cronjobs/automatic_renewals.pl -v -c 7 - Quickly check in the item 8 - The cronjob dies DBIx::Class::Row::update(): Can't update Koha::Schema::Result::Issue=HASH(0x586e1a674fb0): row not found at /kohadevbox/koha/Koha/Object.pm line 172 9 - Apply patch 10 - Checkout the item again 11 - perl misc/cronjobs/automatic_renewals.pl -v -c 12 - Quickly checkin the item 13 - You get a warning, but the cron completes -- 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=37552 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |nick@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=37552 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 CJ Lynce <cj.lynce@westlakelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #169966|0 |1 is obsolete| | --- Comment #2 from CJ Lynce <cj.lynce@westlakelibrary.org> --- Created attachment 170043 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170043&action=edit Bug 37552: Wrap auto renewal attempt in eval to ensure script does not die When libraries have a lot of checkouts, or an AMH, checkins can happen while the cron is running. This patch simply adds an eval around the auto renewal attempt in case of early check in or other errors. You can verify cron completed by enabling cronjob log in system preferences and checking the action logs To test: 1 - Add 'sleep(10);' to automatic_renewals.pl 2 - Set circulation rules to enable automatic renewals 3 - Issue an item to a patron 4 - perl misc/cronjobs/automatic_renewals.pl -v 5 - Confirm item would not be renewed 6 - perl misc/cronjobs/automatic_renewals.pl -v -c 7 - Quickly check in the item 8 - The cronjob dies DBIx::Class::Row::update(): Can't update Koha::Schema::Result::Issue=HASH(0x586e1a674fb0): row not found at /kohadevbox/koha/Koha/Object.pm line 172 9 - Apply patch 10 - Checkout the item again 11 - perl misc/cronjobs/automatic_renewals.pl -v -c 12 - Quickly checkin the item 13 - You get a warning, but the cron completes Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 CJ Lynce <cj.lynce@westlakelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cj.lynce@westlakelibrary.or | |g Status|Needs Signoff |Signed Off --- Comment #3 from CJ Lynce <cj.lynce@westlakelibrary.org> --- Confirmed that the existing script appears to die only with items that would not be renewed. The patch corrects this so that the script no longer dies, but produces an error and moves on, when an item is checked-in mid-processing of automatic renewals. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170043|0 |1 is obsolete| | --- Comment #4 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- Created attachment 170320 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170320&action=edit Bug 37552: Wrap auto renewal attempt in eval to ensure script does not die When libraries have a lot of checkouts, or an AMH, checkins can happen while the cron is running. This patch simply adds an eval around the auto renewal attempt in case of early check in or other errors. You can verify cron completed by enabling cronjob log in system preferences and checking the action logs To test: 1 - Add 'sleep(10);' to automatic_renewals.pl 2 - Set circulation rules to enable automatic renewals 3 - Issue an item to a patron 4 - perl misc/cronjobs/automatic_renewals.pl -v 5 - Confirm item would not be renewed 6 - perl misc/cronjobs/automatic_renewals.pl -v -c 7 - Quickly check in the item 8 - The cronjob dies DBIx::Class::Row::update(): Can't update Koha::Schema::Result::Issue=HASH(0x586e1a674fb0): row not found at /kohadevbox/koha/Koha/Object.pm line 172 9 - Apply patch 10 - Checkout the item again 11 - perl misc/cronjobs/automatic_renewals.pl -v -c 12 - Quickly checkin the item 13 - You get a warning, but the cron completes Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emily.lamancusa@montgomeryc | |ountymd.gov QA Contact|testopia@bugs.koha-communit |emily.lamancusa@montgomeryc |y.org |ountymd.gov Status|Signed Off |Passed QA --- Comment #5 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- I squashed in a perltidy, but otherwise the code looks good and the QA script is happy. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- There are some terminology "glitches" in the script (issue vs. checkout and borrower vs. patron), but I think that's for another day. Thanks for the patch! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! 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=37552 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_24_05_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 171199 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171199&action=edit Bug 37552: (24.05.x) Wrap auto renewal attempt in eval to ensure script does not die -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- If someone wants to have a look at the 24.05.x specific patch I'd be happy to backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_24_05_candidate | Version(s)|24.11.00 |24.11.00,24.05.04 released in| | Status|Pushed to main |Pushed to stable --- Comment #10 from Lucas Gass <lucas@bywatersolutions.com> --- Nick OK'd the 24.05.x patch. Backported to 24.05.x for upcoming 24.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|24.11.00,24.05.04 |24.11.00,24.05.04,23.11.09 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #12 from wainuiwitikapark@catalyst.net.nz --- Not backporting to 23.05.x unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37552 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting --- Comment #13 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