From 83a366beae52a6a52d3379ab560e8ea0dec469c1 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 1 Jun 2026 13:04:58 +0100 Subject: [PATCH] sftp: don't retry permanent connection errors The connection pacer in getSftpConnection used to retry every error, so permanent failures (host key mismatch, certificate rejection, auth failure, etc.) were looped 10 times before reporting to the user. Switch to using fserrors.ShouldRetry which matches the pattern other backends use so only genuinely retriable errors (timeouts, EOF, network blips) are retried and permanent errors are surfaced immediately. --- backend/sftp/sftp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.go index f798d7a49..1d14e17f2 100644 --- a/backend/sftp/sftp.go +++ b/backend/sftp/sftp.go @@ -824,7 +824,7 @@ func (f *Fs) getSftpConnection(ctx context.Context) (c *conn, err error) { err = f.pacer.Call(func() (bool, error) { c, err = f.sftpConnection(ctx) if err != nil { - return true, err + return fserrors.ShouldRetry(err), err } return false, nil })