{"record":{"id":"4c75def8a8ebe688","repo":"kubernetes/kops","slug":"error-creating-sftp-client-at-stdout-pipe-w","errorCode":null,"errorMessage":"error creating sftp client (at stdout pipe): %w","messagePattern":"error creating sftp client \\(at stdout pipe\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/sshfs.go","lineNumber":76,"sourceCode":"\t\tsftpClient, err := sftp.NewClient(p.client)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error creating sftp client: %w\", err)\n\t\t}\n\n\t\treturn sftpClient, nil\n\t}\n\ts, err := p.client.NewSession()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating sftp client (in new-session): %w\", err)\n\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","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/sshfs.go#L58-L94","documentation":"Returned by SSHPath.newClient while building an SFTP-over-SSH session: the SSH session was created and stdin piped, but obtaining the session's stdout pipe failed. This is a local ssh.Session plumbing failure (session already started or closed) before the sftp-server process is launched, not a remote error.","triggerScenarios":"Thrown at util/pkg/vfs/sshfs.go:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the underlying error; usually the SSH connection or session was closed concurrently — re-establish the connection and retry","Avoid sharing one ssh.Client across concurrent sessions if the connection is flaky"],"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"}