Bugzilla – Attachment 186574 Details for
Bug 40840
Failure of an EDI SFTP account will kill edi_cron.pl preventing uploads from subsequent accounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40840: Failure of an EDI SFTP account will kill edi_cron.pl preventing uploads from subsequent accounts
Bug-40840-Failure-of-an-EDI-SFTP-account-will-kill.patch (text/plain), 1.71 KB, created by
Kyle M Hall (khall)
on 2025-09-18 17:57:46 UTC
(
hide
)
Description:
Bug 40840: Failure of an EDI SFTP account will kill edi_cron.pl preventing uploads from subsequent accounts
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-09-18 17:57:46 UTC
Size:
1.71 KB
patch
obsolete
>From 8c733f9cc60049c42499bfaa57a6c141906d4b8a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 18 Sep 2025 13:53:58 -0400 >Subject: [PATCH] Bug 40840: Failure of an EDI SFTP account will kill > edi_cron.pl preventing uploads from subsequent accounts > >EDI uploads are processed in order. If one account is unable to connect to the SFTP server, it will call die_on_error which kills the script. This does not affect regular FTP which will fail gracefully. > >Test Plan: >1) Set up an SFTP server >2) Set up 3 EDI accounts >3) Set accounts 1 and 3 to have a good SFTP server hostname >4) Set account 2 to have a bad SFTP server hostname >5) Queue an edi order for each account >6) Run edi_cron.pl >7) Note the cronjob runs and dies with an error >8) Note only 1 EDI message was uploaded >9) Apply this patch >10) Run edi_cron.pl >11) Note that the cronjob does not die >12) Verify the message for account 3 was uploaded! ( the message for > account 2 should remain as pending ). >--- > Koha/Edifact/Transport.pm | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/Koha/Edifact/Transport.pm b/Koha/Edifact/Transport.pm >index ec59ae41109..32c2febc408 100644 >--- a/Koha/Edifact/Transport.pm >+++ b/Koha/Edifact/Transport.pm >@@ -318,7 +318,12 @@ sub sftp_upload { > port => $port, > timeout => 10, > ); >- $sftp->die_on_error( "Cannot ssh to " . $self->{account}->host ); >+ if ( $sftp->error ) { >+ return $self->_abort_download( >+ $sftp, >+ "Cannot ssh to " . $self->{account}->host . " : " . $sftp->error >+ ); >+ } > $sftp->setcwd( $self->{account}->upload_directory ) > or return $self->_abort_download( > $sftp, >-- >2.39.5 (Apple Git-154)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40840
: 186574