[Bug 32612] New: Koha background worker should log to the worker-error.log
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Bug ID: 32612 Summary: Koha background worker should log to the worker-error.log Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org -- 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=32612 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | CC| |jonathan.druart+koha@gmail. | |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=32612 Nick Clemens <nick@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=32612 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145218 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145218&action=edit Bug 32612: Add worker-error to log4perl conf To test: 1 - Apply patch 2 - vim /etc/koha/sites/kohadev/log4perl.conf, Add lines below: log4perl.logger.worker = WARN, WORKER log4perl.appender.WORKER=Log::Log4perl::Appender::File log4perl.appender.WORKER.filename=/var/log/koha/kohadev/worker-error.log log4perl.appender.WORKER.mode=append log4perl.appender.WORKER.layout=PatternLayout log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n log4perl.appender.WORKER.utf8=1 3 - Restart all 4 - Edit misc/background_jobs_worker.pl - my $job = Koha::BackgroundJobs->find($args->{job_id}); + my $job;# = Koha::BackgroundJobs->find($args->{job_id}); 5 - In another terminal: tail -f /var/log/koha/kohadev/koha-worker-error.log 6 - Force enqueue a job (that won't be found because of #4 perl -e 'use Koha::BackgroundJob::BatchUpdateItem; my $bg = Koha::BackgroundJob::BatchUpdateItem->new(); $bg->enqueue({ record_ids=>['888888']});' 7 - Note error in log like: [2023/01/11 19:26:10] [WARN] No job found for id=2983 main:: /kohadevbox/koha/misc/background_jobs_worker.pl (111) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Nick Clemens <nick@bywatersolutions.com> 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=32612 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |32393 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32393 [Bug 32393] background job worker explodes if JSON is incorrect -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I am wondering if it's a good idea, or if we should just warn and let daemon deals with the logging. debian/scripts/koha-worker 69 DAEMONOPTS="--name=${worker_name} \ 70 --errlog=/var/log/koha/$name/worker-error.log \ 71 --stdout=/var/log/koha/$name/worker.log \ 72 --output=/var/log/koha/$name/worker-output.log \ Tomas, what do you think? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #2)
I am wondering if it's a good idea, or if we should just warn and let daemon deals with the logging.
Sounds good to me -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #3)
(In reply to Jonathan Druart from comment #2)
I am wondering if it's a good idea, or if we should just warn and let daemon deals with the logging.
Sounds good to me
Just warning and letting daemon deal with the logging that is -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to David Cook from comment #4)
(In reply to David Cook from comment #3)
(In reply to Jonathan Druart from comment #2)
I am wondering if it's a good idea, or if we should just warn and let daemon deals with the logging.
Sounds good to me
Just warning and letting daemon deal with the logging that is
That's actually not a solution. The worker will call Koha methods which will log using Koha::Logger. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #5)
That's actually not a solution. The worker will call Koha methods which will log using Koha::Logger.
Koha::Logger can be configured to log to STDERR which would then be handled via "daemon", so it should work. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to David Cook from comment #6)
(In reply to Jonathan Druart from comment #5)
That's actually not a solution. The worker will call Koha methods which will log using Koha::Logger.
Koha::Logger can be configured to log to STDERR which would then be handled via "daemon", so it should work.
Are you referring to Koha::Logger->debug_to_screen? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #7)
(In reply to David Cook from comment #6)
(In reply to Jonathan Druart from comment #5)
That's actually not a solution. The worker will call Koha methods which will log using Koha::Logger.
Koha::Logger can be configured to log to STDERR which would then be handled via "daemon", so it should work.
Are you referring to Koha::Logger->debug_to_screen?
No, I mean in log4perl.conf. We typically use Log::Log4perl::Appender::File in Koha but you can use Log::Log4perl::Appender::Screen instead. You can then choose STDERR instead of STDOUT for that "screen" output. Looks like it's been mentioned (mostly by me) on bug 25284, bug 28477, bug 16357, and bug 8190. Not enough time and too much inertia to change existing things on those bugs, but we have a chance here to use Log::Log4perl::Appender::Screen from the start. Happy to chat more about it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- David is correct. Everything should go through Koha::Logger. This gives the most control over where the messages end up. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145218|0 |1 is obsolete| | --- Comment #10 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145960 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145960&action=edit Bug 32612: Add worker-error to log4perl conf To test: 1 - Apply patch 2 - vim /etc/koha/sites/kohadev/log4perl.conf, Add lines below: log4perl.logger.worker = WARN, WORKER log4perl.appender.WORKER=Log::Log4perl::Appender::Screen log4perl.appender.WORKER.stderr=1 log4perl.appender.WORKER.mode=append log4perl.appender.WORKER.layout=PatternLayout log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n log4perl.appender.WORKER.utf8=1 3 - Restart all 4 - Edit misc/background_jobs_worker.pl - my $job = Koha::BackgroundJobs->find($args->{job_id}); + my $job;# = Koha::BackgroundJobs->find($args->{job_id}); 5 - In another terminal: tail -f /var/log/koha/kohadev/koha-worker-error.log 6 - Force enqueue a job (that won't be found because of #4 perl -e 'use Koha::BackgroundJob::BatchUpdateItem; my $bg = Koha::BackgroundJob::BatchUpdateItem->new(); $bg->enqueue({ record_ids=>['888888']});' 7 - Note error in log like: [2023/01/11 19:26:10] [WARN] No job found for id=2983 main:: /kohadevbox/koha/misc/background_jobs_worker.pl (111) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145960|0 |1 is obsolete| | --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 145972 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145972&action=edit Bug 32612: Add worker-error to log4perl conf To test: 1 - Apply patch 2 - vim /etc/koha/sites/kohadev/log4perl.conf, Add lines below: log4perl.logger.worker = WARN, WORKER log4perl.appender.WORKER=Log::Log4perl::Appender::Screen log4perl.appender.WORKER.stderr=1 log4perl.appender.WORKER.mode=append log4perl.appender.WORKER.layout=PatternLayout log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n log4perl.appender.WORKER.utf8=1 3 - Restart all 4 - Edit misc/background_jobs_worker.pl - my $job = Koha::BackgroundJobs->find($args->{job_id}); + my $job;# = Koha::BackgroundJobs->find($args->{job_id}); 5 - In another terminal: tail -f /var/log/koha/kohadev/koha-worker-error.log 6 - Force enqueue a job (that won't be found because of #4 perl -e 'use Koha::BackgroundJob::BatchUpdateItem; my $bg = Koha::BackgroundJob::BatchUpdateItem->new(); $bg->enqueue({ record_ids=>['888888']});' 7 - Note error in log like: [2023/01/11 19:26:10] [WARN] No job found for id=2983 main:: /kohadevbox/koha/misc/background_jobs_worker.pl (111) 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=32612 --- Comment #12 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 145973 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145973&action=edit Bug 32612: (QA Follow-up) Remove superfluous line 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=32612 --- Comment #13 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 145974 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145974&action=edit Bug 32612: (QA Follow-up) Append to worker-error.log -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145974|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #14 from David Cook <dcook@prosentient.com.au> --- Thought about doing a follow-up but thought it might make more sense to fail QA. These patches are missing the update to /etc/koha/log4perl-site.conf.in -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #15 from David Cook <dcook@prosentient.com.au> --- Tomas was mentioning in IRC how he doesn't like how we update log4perl config in koha-common.postinst and that's given me an idea for bug 32791 I'm not going to add it as a dependency as I think it's really out of scope for this change, but just flagging it here in the hopes that he sees it and it makes him happier :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=32791 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #16 from David Cook <dcook@prosentient.com.au> --- Also, the stanza in debian/koha-common.postinst shouldn't be at the bottom. It should be up with the others (until bug 32791 can take over...) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #17 from David Cook <dcook@prosentient.com.au> --- Looks like debian/koha-core.postinst needs to be updated too... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #18 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 145995 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145995&action=edit Bug 32612: (QA Follow-up) Update package files -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #19 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to David Cook from comment #14)
Thought about doing a follow-up but thought it might make more sense to fail QA.
As a developer and QA'er, my mantra is "Follow-up if you can, fail is you must" ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 David Nind <david@davidnind.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=32612 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145972|0 |1 is obsolete| | --- Comment #20 from David Nind <david@davidnind.com> --- Created attachment 146025 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146025&action=edit Bug 32612: Add worker-error to log4perl conf To test: 1 - Apply patch 2 - vim /etc/koha/sites/kohadev/log4perl.conf, Add lines below: log4perl.logger.worker = WARN, WORKER log4perl.appender.WORKER=Log::Log4perl::Appender::Screen log4perl.appender.WORKER.stderr=1 log4perl.appender.WORKER.mode=append log4perl.appender.WORKER.layout=PatternLayout log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n log4perl.appender.WORKER.utf8=1 3 - Restart all 4 - Edit misc/background_jobs_worker.pl - my $job = Koha::BackgroundJobs->find($args->{job_id}); + my $job;# = Koha::BackgroundJobs->find($args->{job_id}); 5 - In another terminal: tail -f /var/log/koha/kohadev/koha-worker-error.log 6 - Force enqueue a job (that won't be found because of #4 perl -e 'use Koha::BackgroundJob::BatchUpdateItem; my $bg = Koha::BackgroundJob::BatchUpdateItem->new(); $bg->enqueue({ record_ids=>['888888']});' 7 - Note error in log like: [2023/01/11 19:26:10] [WARN] No job found for id=2983 main:: /kohadevbox/koha/misc/background_jobs_worker.pl (111) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145973|0 |1 is obsolete| | --- Comment #21 from David Nind <david@davidnind.com> --- Created attachment 146026 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146026&action=edit Bug 32612: (QA Follow-up) Remove superfluous line Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145995|0 |1 is obsolete| | --- Comment #22 from David Nind <david@davidnind.com> --- Created attachment 146027 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146027&action=edit Bug 32612: (QA Follow-up) Update package files Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #23 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Step 5: I don't have a /var/log/koha/kohadev/koha-worker-error.log, but do have a worker-error.log and worker-output.log 2. The error was logged in worker-output.log: [2023/02/02 19:15:09] [WARN] No job found for id=2 main:: /kohadevbox/koha/misc/background_jobs_worker.pl (114) 3. I think I had to do another restart_all after making the change to the file for the error to appear in the log. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #24 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- * Commit title does not contain 'follow-up' correctly spelt - f8e52c1569 * Commit title does not contain '(QA follow-up)' correctly spelt - f8e52c1569 * Commit title does not contain 'follow-up' correctly spelt - 8df1eff282 * Commit title does not contain '(QA follow-up)' correctly spelt - 8df1eff282 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |BLOCKED QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | --- Comment #25 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QAing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #26 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Confirming that warns and Koha::Logger go to worker-output now. The start/stop statements end up in worker-error. Worker.log is not used. koha-worker does this: DAEMONOPTS="--name=${worker_name} \ --errlog=/var/log/koha/$name/worker-error.log \ --stdout=/var/log/koha/$name/worker.log \ --output=/var/log/koha/$name/worker-output.log \ Since --output includes stdout, it seems that the --stdout line is useless. The client stdout is formally included in --output. But it seems to be discarded anyway since we are running in the background. I tested print statements in background-worker and they go nowhere. Removed the worker.log line in a follow-up. Daemon docs says: -l spec, --errlog=spec Send daemon's standard output and error to the syslog destination or file specified by spec. If spec is of the form "facility.priority", then output is sent to syslog(3). Otherwise, output is appended to the file whose path is given in spec. By default, output is sent to daemon.err. -O spec, --stdout=spec Capture the client's standard output and send it to the syslog destination or file specified by spec. If spec is of the form "facility.priority", then output is sent to syslog(3). Otherwise, stdout is appended to the file whose path is given in spec. By default, stdout is discarded unless the --foreground option is present, in which case, the client's stdout is propagated to daemon's stdout. -o spec, --output=spec Capture the client's standard output and error and send it to the syslog destination or file specified by spec. If spec is of the form "facility.priority", then output is sent to syslog (3). Otherwise, output is appended to the file whose path is given in spec. By default, output is discarded unless the --foreground option is present. In this case, the client's stdout and stderr are propagated to daemon's stdout and stderr respectively. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Koha background worker |Koha background worker |should log to the |should log to |worker-error.log |worker-error/output.log -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=32811 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146025|0 |1 is obsolete| | --- Comment #27 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146061 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146061&action=edit Bug 32612: Add worker-error to log4perl conf To test: 1 - Apply patch 2 - vim /etc/koha/sites/kohadev/log4perl.conf, Add lines below: log4perl.logger.worker = WARN, WORKER log4perl.appender.WORKER=Log::Log4perl::Appender::Screen log4perl.appender.WORKER.stderr=1 log4perl.appender.WORKER.mode=append log4perl.appender.WORKER.layout=PatternLayout log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n log4perl.appender.WORKER.utf8=1 3 - Restart all 4 - Edit misc/background_jobs_worker.pl - my $job = Koha::BackgroundJobs->find($args->{job_id}); + my $job;# = Koha::BackgroundJobs->find($args->{job_id}); 5 - In another terminal: tail -f /var/log/koha/kohadev/koha-worker-error.log 6 - Force enqueue a job (that won't be found because of #4 perl -e 'use Koha::BackgroundJob::BatchUpdateItem; my $bg = Koha::BackgroundJob::BatchUpdateItem->new(); $bg->enqueue({ record_ids=>['888888']});' 7 - Note error in log like: [2023/01/11 19:26:10] [WARN] No job found for id=2983 main:: /kohadevbox/koha/misc/background_jobs_worker.pl (111) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <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=32612 --- Comment #28 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146062 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146062&action=edit Bug 32612: (QA follow-up) Remove superfluous line Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <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=32612 --- Comment #29 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146063 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146063&action=edit Bug 32612: (QA follow-up) Update package files Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <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=32612 --- Comment #30 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146064 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146064&action=edit Bug 32612: (QA follow-up) Remove more unneeded appender lines To be more consistent ;) Signed-off-by: Marcel de Rooy <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=32612 --- Comment #31 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146065 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146065&action=edit Bug 32612: (QA follow-up) Remove worker.log It is not used; overruled by daemon's --output option. Signed-off-by: Marcel de Rooy <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=32612 --- Comment #32 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146066 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146066&action=edit Bug 32612: (QA follow-up) Add missing interface for Logger Signed-off-by: Marcel de Rooy <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=32612 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146026|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146027|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.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=32612 --- Comment #33 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Jacob O'Mara <jacob.omara@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.05.00 |23.05.00,22.11.03 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #34 from Jacob O'Mara <jacob.omara@ptfs-europe.com> --- Nice work, thanks everyone! Pushed to 22.11.x for the next release. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #35 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- prove t/db_dependent/SIP/SIPServer.t t/db_dependent/SIP/SIPServer.t .. Can't locate object method "BINMODE" via package "C4::SIP::Trapper" at /usr/share/perl5/Log/Log4perl/Appender/Screen.pm line 22. Compilation failed in require at t/db_dependent/SIP/SIPServer.t line 40. BEGIN failed--compilation aborted at t/db_dependent/SIP/SIPServer.t line 40. # Looks like your test exited with 255 before it could output anything. t/db_dependent/SIP/SIPServer.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 1/1 subtests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #36 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 146315 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146315&action=edit Bug 32612: (QA follow-up) Add BINMODE method to C4::SIP::Trapper The module Log::Log4perl::Appender::Screen is attempting to change binmode during unit tests for SIPServer and is failing because of our tie in SIPServer.pm for reasons unknown. This patch implements the perltie method TIEHANDLE which allows the binmode to be handled in the C4::SIP::Trapper package. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #37 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #35)
prove t/db_dependent/SIP/SIPServer.t t/db_dependent/SIP/SIPServer.t .. Can't locate object method "BINMODE" via package "C4::SIP::Trapper" at /usr/share/perl5/Log/Log4perl/Appender/Screen.pm line 22. Compilation failed in require at t/db_dependent/SIP/SIPServer.t line 40. BEGIN failed--compilation aborted at t/db_dependent/SIP/SIPServer.t line 40. # Looks like your test exited with 255 before it could output anything. t/db_dependent/SIP/SIPServer.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 1/1 subtests
Whats the relation with worker? log4perl.logger.sip = DEBUG, SIP log4perl.appender.SIP=Log::Log4perl::Appender::File log4perl.appender.SIP.filename=/var/log/koha/myclone/sip.log log4perl.appender.SIP.mode=append log4perl.appender.SIP.layout=PatternLayout log4perl.appender.SIP.layout.ConversionPattern=[%d] [%P] [%p] %X{accountid}@%X{peeraddr}: %m %l%n log4perl.appender.SIP.utf8=1 Please check the configuration for sip ? Note that the SIP configuration always goes to Appender::File too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #38 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Follow-up pushed to master, thanks Kyle! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #39 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 146353 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146353&action=edit Bug 32612: (QA follow-up) Add POD and fix typo Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #40 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Follow-up pushed to 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #41 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Nobody willing to comment on questions in comment37 ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #42 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #37)
(In reply to Jonathan Druart from comment #35)
prove t/db_dependent/SIP/SIPServer.t t/db_dependent/SIP/SIPServer.t .. Can't locate object method "BINMODE" via package "C4::SIP::Trapper" at /usr/share/perl5/Log/Log4perl/Appender/Screen.pm line 22. Compilation failed in require at t/db_dependent/SIP/SIPServer.t line 40. BEGIN failed--compilation aborted at t/db_dependent/SIP/SIPServer.t line 40. # Looks like your test exited with 255 before it could output anything. t/db_dependent/SIP/SIPServer.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 1/1 subtests
Whats the relation with worker?
I have no idea! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #43 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #41)
Nobody willing to comment on questions in comment37 ?
I missed the context of your question there, as the error you commented had no relation to a worker or smth. I guess you meant the third patch, in which Nick silently added some missing log4perl entries for worker in the different debian/*.postinst files. It felt out of place, but as it had your QA stamp I didn't worry. It is good in my opinion should've happened on a separate bug. Thanks for raising it! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #44 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Hmm. Thx Joubu and Tomas for responding. But these SIP::Trapper patches here still feel completely out of scope. Never mind ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Jacob O'Mara <jacob.omara@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.05.00,22.11.03 |23.05.00,22.11.03,22.11.03 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 --- Comment #45 from Jacob O'Mara <jacob.omara@ptfs-europe.com> --- Nice work, thanks everyone! Pushed to 22.11.x for the next release. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |lucas@bywatersolutions.com Version(s)|23.05.00,22.11.03,22.11.03 |23.05.00,22.11.03,22.05.10 released in| | --- Comment #46 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcoming 22.05.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Bug 32612 depends on bug 32393, which changed state. Bug 32393 Summary: background job worker explodes if JSON is incorrect https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32393 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED CC| |arthur.suzuki@biblibre.com Resolution|--- |FIXED --- Comment #47 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- depends on 32393, can't backport to 21.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32612 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org