[Bug 38857] New: Cronjobs should log their start and command line parameters before processing options
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38857 Bug ID: 38857 Summary: Cronjobs should log their start and command line parameters before processing options Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz When a cronjob is passed bad parameters it may fail. If it does so before logging its start, there is no trace that it was even attempted We should move the logging to before the options are fetched to ease troubleshooting To test: 1 - Enable CronjobLog 2 - On command line: perl misc/cronjobs/cleanup_database.pl --old_reservers 550 3 - Error on command line 4 - In staff client, go to Tools->Log viewer, check 'Cronjobs' and submit 5 - No entries -- 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=38857 Nick Clemens (kidclamp) <nick@bywatersolutions.com> 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=38857 --- Comment #1 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 176304 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176304&action=edit Bug 38857: Update cronjobs to log run before processing parameters A few notes: - I grabbed this list by looking for things in misc/ that had cronlogaction - I didn't touch scripts that aren't in the cronjobs directory, except fix_invalid_dates where I follow import_patrons and only log if confirmed since they aren't crons, I figure this seems reasonable - purge_suggestions I moved the logggin up and changed the addition of effective days to a verbose message - this seems more consistent To test: 1 - Enable CronjobLog 2 - On command line: perl misc/cronjobs/cleanup_database.pl --old_reservers 550 3 - Error on command line 4 - In staff client, go to Tools->Log viewer, check 'Cronjobs' and submit 5 - No entries 6 - Apply patch 7 - Repeat and see run is logged with wrong parameter 8 - Fix parameter and confirm 9 - Spot check other files until you are satisfied 10 - Sign it off! -- 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=38857 William Lavoie <william.lavoie@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=38857 William Lavoie <william.lavoie@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176304|0 |1 is obsolete| | --- Comment #2 from William Lavoie <william.lavoie@inLibro.com> --- Created attachment 176369 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176369&action=edit Bug 38857: Update cronjobs to log run before processing parameters A few notes: - I grabbed this list by looking for things in misc/ that had cronlogaction - I didn't touch scripts that aren't in the cronjobs directory, except fix_invalid_dates where I follow import_patrons and only log if confirmed since they aren't crons, I figure this seems reasonable - purge_suggestions I moved the logggin up and changed the addition of effective days to a verbose message - this seems more consistent To test: 1 - Enable CronjobLog 2 - On command line: perl misc/cronjobs/cleanup_database.pl --old_reservers 550 3 - Error on command line 4 - In staff client, go to Tools->Log viewer, check 'Cronjobs' and submit 5 - No entries 6 - Apply patch 7 - Repeat and see run is logged with wrong parameter 8 - Fix parameter and confirm 9 - Spot check other files until you are satisfied 10 - Sign it off! Signed-off-by: William Lavoie <william.lavoie@inLibro.com> -- 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=38857 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | CC| |martin.renvoize@ptfs-europe | |.com QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.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=38857 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176369|0 |1 is obsolete| | --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 176370 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176370&action=edit Bug 38857: Update cronjobs to log run before processing parameters A few notes: - I grabbed this list by looking for things in misc/ that had cronlogaction - I didn't touch scripts that aren't in the cronjobs directory, except fix_invalid_dates where I follow import_patrons and only log if confirmed since they aren't crons, I figure this seems reasonable - purge_suggestions I moved the logggin up and changed the addition of effective days to a verbose message - this seems more consistent To test: 1 - Enable CronjobLog 2 - On command line: perl misc/cronjobs/cleanup_database.pl --old_reservers 550 3 - Error on command line 4 - In staff client, go to Tools->Log viewer, check 'Cronjobs' and submit 5 - No entries 6 - Apply patch 7 - Repeat and see run is logged with wrong parameter 8 - Fix parameter and confirm 9 - Spot check other files until you are satisfied 10 - Sign it off! Signed-off-by: William Lavoie <william.lavoie@inLibro.com> Signed-off-by: Martin Renvoize <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=38857 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 176371 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176371&action=edit Bug 38857: (QA follow-up) Fix perltidy errors Signed-off-by: Martin Renvoize <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=38857 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> 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=38857 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.05.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=38857 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.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=38857 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.05.00 | released in| | CC| |david@davidnind.com Text to go in the| |This fixes all cronjobs so release notes| |that if they fail because | |of bad parameters, | |information is now | |available in the log viewer | |to help with | |troubleshooting (when the | |CronjobLog system | |preference is enabled). | | | |Notes: | |- This changed all | |the cronjobs in | |misc/cronjobs that had the | |'cronlogaction'. | |- It also | |changed | |misc/maintenance/fix_invali | |d_dates.pl (not a cronjob, | |but now only logs if | |confirmed - similar to | |misc/import_patrons.pl). | |- | |For | |misc/cronjobs/purge_suggest | |ions.pl, a verbose option | |was added for consistency. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38857 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de Version(s)| |25.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38857 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.05.00 |25.05.00,24.11.04 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38857 --- Comment #6 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 24.11.x for 24.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38857 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to stable |Needs documenting --- Comment #7 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38857 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #8 from David Nind <david@davidnind.com> --- Bug fix, no changes to the manual required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org