{"record":{"id":"2765f15c6586b7a8","repo":"wavetermdev/waveterm","slug":"conn-parameter-is-required","errorCode":null,"errorMessage":"--conn parameter is required","messagePattern":"--conn parameter is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-connserver.go","lineNumber":463,"sourceCode":"\t\tlogFilePath := fmt.Sprintf(\"/tmp/waveterm-connserver-%d.log\", os.Getuid())\n\t\tlogFile, err = os.OpenFile(logFilePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"failed to open log file: %v\\n\", err)\n\t\t\tlog.SetFlags(log.LstdFlags | log.Lmicroseconds)\n\t\t\tlog.SetPrefix(fmt.Sprintf(\"[PID:%d] \", os.Getpid()))\n\t\t} else {\n\t\t\tdefer logFile.Close()\n\t\t\tlogWriter := io.MultiWriter(os.Stderr, logFile)\n\t\t\tlog.SetOutput(logWriter)\n\t\t\tlog.SetFlags(log.LstdFlags | log.Lmicroseconds)\n\t\t\tlog.SetPrefix(fmt.Sprintf(\"[PID:%d] \", os.Getpid()))\n\t\t}\n\t}\n\tif connServerConnName == \"\" {\n\t\tif logFile != nil {\n\t\t\tfmt.Fprintf(logFile, \"--conn parameter is required\\n\")\n\t\t}\n\t\treturn fmt.Errorf(\"--conn parameter is required\")\n\t}\n\tinstallErr := wshutil.InstallRcFiles()\n\tif installErr != nil {\n\t\tif logFile != nil {\n\t\t\tfmt.Fprintf(logFile, \"error installing rc files: %v\\n\", installErr)\n\t\t}\n\t\tlog.Printf(\"error installing rc files: %v\", installErr)\n\t}\n\tsigutil.InstallSIGUSR1Handler()\n\tif connServerRouter {\n\t\terr := serverRunRouter()\n\t\tif err != nil && logFile != nil {\n\t\t\tfmt.Fprintf(logFile, \"serverRunRouter error: %v\\n\", err)\n\t\t}\n\t\treturn err\n\t}\n\tif connServerRouterDomainSocket {\n\t\tjwtToken, err := askForJwtToken()","sourceCodeStart":445,"sourceCodeEnd":481,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-connserver.go#L445-L481","documentation":"serverRun validates that the --conn flag (connServerConnName) was provided before starting the connection server. Without a connection name it cannot determine which remote to serve, so it returns this validation error (also written to the log file if one is open).","triggerScenarios":"Running `wsh connserver` without --conn (and without a configuration default that fills connServerConnName), e.g. manually invoking the command for debugging.","commonSituations":"Hand-crafting an SSH RemoteCommand line and omitting --conn; quoting issues in an SSH config that drop the flag; copying an example command that left the placeholder out.","solutions":["Add --conn <connection-name> matching the connection name in Wave's connections settings","Check your ~/.ssh/config RemoteCommand/ProxyCommand line includes the --conn flag","Verify no shell quoting strips the flag from the spawned command line"],"exampleFix":"// before\nwsh connserver --jwt \"$JWT\"\n// after\nwsh connserver --conn myserver --jwt \"$JWT\"","handlingStrategy":"validation","validationCode":"if [ -z \"$CONN_NAME\" ]; then\n  echo \"usage: wsh connserver --conn <name> ...\" >&2\n  exit 2\nfi\nwsh connserver --conn \"$CONN_NAME\" --jwt \"$JWT\"","typeGuard":null,"tryCatchPattern":"if err := serverRun(cmd, args); err != nil {\n\tif strings.Contains(err.Error(), \"--conn parameter is required\") {\n\t\tfmt.Fprintln(os.Stderr, \"add --conn <connection-name> from Wave's connection settings\")\n\t}\n\treturn err\n}","preventionTips":["Always include --conn in generated SSH RemoteCommand lines","Template the full command (conn + jwt) in one place, e.g. a script","Validate flags with --help before deploying config changes","Keep the connection name identical to the one configured in Wave"],"tags":["cli","validation","configuration","ssh"],"backgroundTag":"missing-required-flag","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}