{"record":{"id":"8358c552c6df1dcb","repo":"wavetermdev/waveterm","slug":"no-connection-specified","errorCode":null,"errorMessage":"no connection specified","messagePattern":"no connection specified","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-conn.go","lineNumber":128,"sourceCode":"\t\tWriteStdout(\"no connections\\n\")\n\t\treturn nil\n\t}\n\tWriteStdout(\"%-30s %-12s\\n\", \"connection\", \"status\")\n\tWriteStdout(\"----------------------------------------------\\n\")\n\tfor _, conn := range allResp {\n\t\tstr := fmt.Sprintf(\"%-30s %-12s\", conn.Connection, conn.Status)\n\t\tif conn.Error != \"\" {\n\t\t\tstr += fmt.Sprintf(\" (%s)\", conn.Error)\n\t\t}\n\t\tWriteStdout(\"%s\\n\", str)\n\t}\n\treturn nil\n}\n\nfunc connReinstallRun(cmd *cobra.Command, args []string) error {\n\tif len(args) != 1 {\n\t\tif RpcContext.Conn == \"\" {\n\t\t\treturn fmt.Errorf(\"no connection specified\")\n\t\t}\n\t\targs = []string{RpcContext.Conn}\n\t}\n\tconnName := args[0]\n\tif err := validateConnectionName(connName); err != nil {\n\t\treturn err\n\t}\n\tdata := wshrpc.ConnExtData{\n\t\tConnName:   connName,\n\t\tLogBlockId: RpcContext.BlockId,\n\t}\n\terr := wshclient.ConnReinstallWshCommand(RpcClient, data, &wshrpc.RpcOpts{Timeout: 60000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reinstalling connection: %w\", err)\n\t}\n\tWriteStdout(\"wsh reinstalled on connection %q\\n\", connName)\n\treturn nil\n}","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-conn.go#L110-L146","documentation":"Returned by connReinstallRun (the `wsh conn reinstall` command) when no connection name argument is given and no default connection is set in RpcContext.Conn. The command needs exactly one connection name to target the reinstall operation.","triggerScenarios":"Running `wsh conn reinstall` with zero arguments while RpcContext.Conn is empty (no --conn flag and no ambient connection context).","commonSituations":"Forgetting the connection argument in scripts, omitting the --conn flag when invoking wsh remotely, or relying on an ambient connection that was never set.","solutions":["Pass the connection name as an argument: `wsh conn reinstall <connname>`","Set the connection via the --conn flag so RpcContext.Conn is populated","List available connections with `wsh conn status` to pick the right name"],"exampleFix":"// before\nwsh conn reinstall\n// error: no connection specified\n// after\nwsh conn reinstall myserver","handlingStrategy":"validation","validationCode":"connName := args[0]\nif len(args) < 1 {\n    if RpcContext.Conn == \"\" {\n        return fmt.Errorf(\"usage: wsh conn reinstall <connname> (or set --conn)\")\n    }\n    connName = RpcContext.Conn\n}\nif err := validateConnectionName(connName); err != nil {\n    return err\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass the connection name explicitly in scripts","Set the --conn flag when relying on ambient context","Run `wsh conn status` first to confirm target names","Add shell completion/usage text so the requirement is obvious"],"tags":["cli","argument-validation","connection"],"backgroundTag":"missing-required-argument","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}