From 9e2900ebe4bd967ea313a21edcbdb3559715f0cc Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Wed, 8 Jul 2026 21:12:04 +0000 Subject: [PATCH] improve SFTP integration error message shown upon SSH connection failure Attempts to connect to an SSH server which does not accept password authentication can result in the following error when no ssh key has been configured for the SFTP integration: plakar: EOF Change this message to show the root cause of the problem on stderr: SSH connection to example.com failed: failed to start ssh master: exit status 255: user@example.com: Permission denied (publickey,keyboard-interactive). plakar: EOF --- sftp/exporter/sftp.go | 1 + sftp/importer/sftp.go | 1 + 2 files changed, 2 insertions(+) diff --git a/sftp/exporter/sftp.go b/sftp/exporter/sftp.go index bd7aa1f..163ba26 100644 --- a/sftp/exporter/sftp.go +++ b/sftp/exporter/sftp.go @@ -85,6 +85,7 @@ func NewExporter(ctx context.Context, opt *connectors.Options, name string, conf client, err := plakarsftp.Connect(parsed, config) if err != nil { + fmt.Fprintf(os.Stderr, "SSH connection to %s failed: %s\n", parsed.Host, err) return nil, err } diff --git a/sftp/importer/sftp.go b/sftp/importer/sftp.go index 67ee935..b211d2f 100644 --- a/sftp/importer/sftp.go +++ b/sftp/importer/sftp.go @@ -90,6 +90,7 @@ func NewImporter(appCtx context.Context, opts *connectors.Options, name string, client, err := plakarsftp.Connect(parsed, config) if err != nil { + fmt.Fprintf(os.Stderr, "SSH connection to %s failed: %s\n", parsed.Host, err) return nil, err }