[Bug 42993] New: Koha::Edifact::Transport should log transport failures via Koha::Logger
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42993 Bug ID: 42993 Summary: Koha::Edifact::Transport should log transport failures via Koha::Logger Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Koha::Edifact::Transport reports every transport failure (no transport configured, connect failure, directory-change failure, file-listing failure and per-file download/upload failure) with carp. Under misc/cronjobs/edi_cron.pl these go to STDERR, so on a normal cron run the messages are lost: EDI simply goes quiet with nothing in editrace.log to explain why. This routes those failures through Koha::Logger on the 'edi' interface (the same interface edi_cron.pl already uses) so they are recorded in the EDI log. The two ingest()-level data warnings (duplicate filename, unreadable file) are intentionally left as carp: one is asserted by the existing unit test and neither is a transport failure. No change to the transfer logic. Test plan: 1. prove t/db_dependent/Koha/Edifact/Transport.t 2. Point an EDI account at an unreachable transport and run misc/cronjobs/edi_cron.pl; confirm the failure is now written to the EDI log rather than only to STDERR. -- 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=42993 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 201497 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201497&action=edit Bug 42993: EDI: log transport failures via Koha::Logger instead of carp Koha::Edifact::Transport reported every transport failure (no transport configured, connect failure, directory-change failure, file-listing failure and per-file download/upload failure) with carp. Under edi_cron.pl these go to STDERR, so on a normal cron run the messages are lost and EDI simply goes quiet with nothing in editrace.log to explain why. Route these failures through Koha::Logger on the 'edi' interface (the same interface edi_cron.pl already uses) so they are recorded in the EDI log. The two ingest()-level data warnings (duplicate filename, unreadable file) are intentionally left as carp: one is asserted by the existing unit test and neither is a transport failure. No change to the transfer logic. Test plan: 1) prove t/db_dependent/Koha/Edifact/Transport.t 2) Point an EDI account at an unreachable transport and run edi_cron.pl; confirm the failure is now written to the edi log rather than only to STDERR. -- 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=42993 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- 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=42993 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42993 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> 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=42993 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=42993 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201497|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=42993 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 201502 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201502&action=edit Bug 42993: EDI: log transport failures via Koha::Logger instead of carp Koha::Edifact::Transport reported every transport failure (no transport configured, connect failure, directory-change failure, file-listing failure and per-file download/upload failure) with carp. Under edi_cron.pl these go to STDERR, so on a normal cron run the messages are lost and EDI simply goes quiet with nothing in editrace.log to explain why. Route these failures through Koha::Logger on the 'edi' interface (the same interface edi_cron.pl already uses) so they are recorded in the EDI log. The two ingest()-level data warnings (duplicate filename, unreadable file) are intentionally left as carp: one is asserted by the existing unit test and neither is a transport failure. No change to the transfer logic. Test plan: 1) prove t/db_dependent/Koha/Edifact/Transport.t 2) Point an EDI account at an unreachable transport and run edi_cron.pl; confirm the failure is now written to the edi log rather than only to STDERR. 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=42993 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- This only shows one error, but hope this is sufficient for the sign off. Testing notes (using KTD): 1. Enable the EDI system preference: EDIFACT 2. Enable the CronjobLog system preference: set to "Log" 3. Add an EDI account (Administration > Aquisition parameters > EDI accounts): - Doens't need to be a real account - Don't set up or select a file transport - Message types: select all 4. Before the patch: misc/cronjobs/edi_cron.pl Failed to connect to file transport: 3 at misc/cronjobs/edi_cron.pl line 62. Failed to connect to file transport: 3 at misc/cronjobs/edi_cron.pl line 83. Failed to connect to file transport: 3 at misc/cronjobs/edi_cron.pl line 101. 5. There are no entries in the log file viewer: vi /var/log/koha/kohadev/editrace.log 6. Apply the patch and restart everything: restart_all 7. Run misc/cronjobs/edi_cron.pl again Note: - no output to the screen - now have entries in the /var/log/koha/kohadev/editrace.log 1 [2026/07/05 00:52:49] [3301] [ERROR] [undef]@[undef]: No file transport configured for EDI account 1 Koha::Edifact::Transport::download_messa ges /kohadevbox/koha/Koha/Edifact/Transport.pm (68) 2 [2026/07/05 00:52:49] [3301] [ERROR] [undef]@[undef]: No file transport configured for EDI account 1 Koha::Edifact::Transport::download_messa ges /kohadevbox/koha/Koha/Edifact/Transport.pm (68) 3 [2026/07/05 00:52:49] [3301] [ERROR] [undef]@[undef]: No file transport configured for EDI account 1 Koha::Edifact::Transport::download_messa ges /kohadevbox/koha/Koha/Edifact/Transport.pm (68) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org