{"record":{"id":"d1a342faeba7c4cf","repo":"kubernetes/kops","slug":"error-starting-sftp-executing-sudo-usr-lib-open","errorCode":null,"errorMessage":"error starting sftp (executing 'sudo /usr/lib/openssh/sftp-server'): %w","messagePattern":"error starting sftp \\(executing 'sudo /usr/lib/openssh/sftp-server'\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/sshfs.go","lineNumber":86,"sourceCode":"\t}\n\n\tstdin, err := s.StdinPipe()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating sftp client (at stdin pipe): %w\", err)\n\t}\n\tstdout, err := s.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating sftp client (at stdout pipe): %w\", err)\n\t}\n\n\terr = s.Start(\"sudo /usr/lib/openssh/sftp-server\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating sftp client (executing 'sudo /usr/lib/openssh/sftp-server'): %w\", err)\n\t}\n\n\tc, err := sftp.NewClientPipe(stdout, stdin)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error starting sftp (executing 'sudo /usr/lib/openssh/sftp-server'): %w\", err)\n\t}\n\treturn c, nil\n}\n\nfunc (p *SSHPath) Path() string {\n\treturn \"ssh://\" + p.server + p.path\n}\n\nfunc (p *SSHPath) String() string {\n\treturn p.Path()\n}\n\nfunc (p *SSHPath) Remove(ctx context.Context) error {\n\tsftpClient, err := p.newClient(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sftpClient.Close()","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/sshfs.go#L68-L104","documentation":"Returned by SSHPath.newClient when sftp.NewClientPipe over the launched sftp-server process fails — the subprocess started but the SFTP protocol handshake over stdin/stdout did not complete. Typically the remote sftp-server exited immediately (bad binary, sudo failure surfaced late) or the stream became unusable.","triggerScenarios":"Thrown at util/pkg/vfs/sshfs.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for EOF, which indicates the remote sftp-server died — verify the binary and sudo setup on the host","Retry after re-establishing the SSH connection; transient protocol handshakes failures occur on loaded links"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}