mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-17 20:51:55 +01:00
fix: allow retry after ssh auth failure
Previously, the error status was not set when an ssh connection failed. Because of this, an ssh connection failure would lock the failed remote until waveterm was rebooted. This fix properly sets the error status so this cannot happen.
This commit is contained in:
parent
37821738d8
commit
1547fc856e
@ -1338,13 +1338,17 @@ func (NewLauncher) Launch(msh *MShellProc, interactive bool) {
|
|||||||
var client *ssh.Client
|
var client *ssh.Client
|
||||||
client, err = ConnectToClient(remoteCopy.SSHOpts)
|
client, err = ConnectToClient(remoteCopy.SSHOpts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
msh.WriteToPtyBuffer("*error, ssh cannot connect to client: %v\n", err)
|
statusErr := fmt.Errorf("ssh cannot connect to client: %w", err)
|
||||||
|
msh.WriteToPtyBuffer("*error, %s\n", statusErr.Error())
|
||||||
|
msh.setErrorStatus(statusErr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var session *ssh.Session
|
var session *ssh.Session
|
||||||
session, err = client.NewSession()
|
session, err = client.NewSession()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
msh.WriteToPtyBuffer("*error, ssh cannot create session: %v\n", err)
|
statusErr := fmt.Errorf("ssh cannot create session: %w", err)
|
||||||
|
msh.WriteToPtyBuffer("*error, %s\n", statusErr.Error())
|
||||||
|
msh.setErrorStatus(statusErr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cproc, initPk, err = shexec.MakeClientProc(makeClientCtx, shexec.SessionWrap{Session: session, StartCmd: MakeServerRunOnlyCommandStr()})
|
cproc, initPk, err = shexec.MakeClientProc(makeClientCtx, shexec.SessionWrap{Session: session, StartCmd: MakeServerRunOnlyCommandStr()})
|
||||||
|
Loading…
Reference in New Issue
Block a user