{"record":{"id":"9342f1b852bd8f5f","repo":"wavetermdev/waveterm","slug":"invalid-ssh-remote-name-s-w-9342f1","errorCode":null,"errorMessage":"invalid ssh remote name (%s): %w","messagePattern":"invalid ssh remote name \\((.+?)\\): %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/blockcontroller/shellcontroller.go","lineNumber":356,"sourceCode":"\t\twslName := strings.TrimPrefix(remoteName, \"wsl://\")\n\t\twslConn := wslconn.GetWslConn(wslName)\n\t\tif wslConn == nil {\n\t\t\treturn ConnUnion{}, fmt.Errorf(\"wsl connection not found: %s\", remoteName)\n\t\t}\n\t\tconnStatus := wslConn.DeriveConnStatus()\n\t\tif connStatus.Status != conncontroller.Status_Connected {\n\t\t\treturn ConnUnion{}, fmt.Errorf(\"wsl connection %s not connected, cannot start shellproc\", remoteName)\n\t\t}\n\t\trtn.ConnType = ConnType_Wsl\n\t\trtn.WslConn = wslConn\n\t\trtn.WshEnabled = wshEnabled && wslConn.WshEnabled.Load()\n\t} else if conncontroller.IsLocalConnName(remoteName) {\n\t\trtn.ConnType = ConnType_Local\n\t\trtn.WshEnabled = wshEnabled\n\t} else {\n\t\topts, err := remote.ParseOpts(remoteName)\n\t\tif err != nil {\n\t\t\treturn ConnUnion{}, fmt.Errorf(\"invalid ssh remote name (%s): %w\", remoteName, err)\n\t\t}\n\t\tconn := conncontroller.MaybeGetConn(opts)\n\t\tif conn == nil {\n\t\t\treturn ConnUnion{}, fmt.Errorf(\"ssh connection not found: %s\", remoteName)\n\t\t}\n\t\tconnStatus := conn.DeriveConnStatus()\n\t\tif connStatus.Status != conncontroller.Status_Connected {\n\t\t\treturn ConnUnion{}, fmt.Errorf(\"ssh connection %s not connected, cannot start shellproc\", remoteName)\n\t\t}\n\t\trtn.ConnType = ConnType_Ssh\n\t\trtn.SshConn = conn\n\t\trtn.WshEnabled = wshEnabled && conn.WshEnabled.Load()\n\t}\n\terr := rtn.getRemoteInfoAndShellType(blockMeta)\n\tif err != nil {\n\t\treturn ConnUnion{}, err\n\t}\n\treturn rtn, nil","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/blockcontroller/shellcontroller.go#L338-L374","documentation":"Wraps an error from remote.ParseOpts when the remoteName is neither a WSL name nor a local connection name and cannot be parsed as a valid SSH target string. ParseOpts validates user@host:port syntax, so any malformed specifier produces this wrapped error.","triggerScenarios":"DoRunShellCommand on a block whose remoteName is not IsLocalConnName and fails remote.ParseOpts — e.g. empty string, stray whitespace, invalid port, or malformed user@host syntax.","commonSituations":"Block metadata retains a stale/corrupted connection name after a remote was deleted or renamed; user hand-edited the connection string in settings; a connection name with unsupported characters was imported from another machine's config.","solutions":["Fix the connection name stored in the block's connection: meta so it is a valid user@host[:port] SSH specifier","Verify the remote still exists in the saved remotes list (it may have been deleted or renamed); re-select a valid remote","Check for typos/whitespace/invalid port in the connection string before passing it","If the block is meant to be local, set the connection to the local connection name instead"],"exampleFix":"// before: passing a malformed remote name from block meta\nremoteName := blockMeta[waveobj.MetaKey_Connection]\n\n// after: validate parseability first\nif _, err := remote.ParseOpts(remoteName); err != nil {\n    return fmt.Errorf(\"fix connection name %q: %w\", remoteName, err)\n}","handlingStrategy":"validation","validationCode":"if !conncontroller.IsLocalConnName(remoteName) {\n    if _, err := remote.ParseOpts(remoteName); err != nil {\n        return fmt.Errorf(\"reject bad remote %q before shell start: %w\", remoteName, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"proc, err := bc.setupAndStartShellProcess(logCtx, rc, blockMeta)\nvar pe *remote.ParseOptsError\nif errors.As(err, &pe) {\n    // prompt user to fix the connection string in block settings\n}","preventionTips":["Always pick remotes from the saved remote list, never type free-form strings","Validate connection strings (user@host[:port]) on input/save","Clean up blocks referencing deleted remotes during workspace restore"],"tags":["ssh","parsing","configuration"],"backgroundTag":"invalid-ssh-remote-name","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}