{"record":{"id":"0ba3594580676503","repo":"wavetermdev/waveterm","slug":"invalid-path-type-q-must-be-one-of-config-data","errorCode":null,"errorMessage":"invalid path type %q. must be one of: config, data, log","messagePattern":"invalid path type %q\\. must be one of: config, data, log","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-wavepath.go","lineNumber":48,"sourceCode":"\nfunc wavepathRun(cmd *cobra.Command, args []string) (rtnErr error) {\n\tdefer func() {\n\t\tsendActivity(\"wavepath\", rtnErr == nil)\n\t}()\n\n\tif len(args) == 0 {\n\t\tOutputHelpMessage(cmd)\n\t\treturn fmt.Errorf(\"no arguments. wsh wavepath requires a type argument (config, data, or log)\")\n\t}\n\tif len(args) > 1 {\n\t\tOutputHelpMessage(cmd)\n\t\treturn fmt.Errorf(\"too many arguments. wsh wavepath requires exactly one argument\")\n\t}\n\n\tpathType := args[0]\n\tif pathType != \"config\" && pathType != \"data\" && pathType != \"log\" {\n\t\tOutputHelpMessage(cmd)\n\t\treturn fmt.Errorf(\"invalid path type %q. must be one of: config, data, log\", pathType)\n\t}\n\n\ttail, _ := cmd.Flags().GetBool(\"tail\")\n\tif tail && pathType != \"log\" {\n\t\treturn fmt.Errorf(\"--tail can only be used with the log path type\")\n\t}\n\n\topen, _ := cmd.Flags().GetBool(\"open\")\n\topenExternal, _ := cmd.Flags().GetBool(\"open-external\")\n\n\ttabId := getTabIdFromEnv()\n\tif tabId == \"\" {\n\t\treturn fmt.Errorf(\"no WAVETERM_TABID env var set\")\n\t}\n\n\tpath, err := wshclient.PathCommand(RpcClient, wshrpc.PathCommandData{\n\t\tPathType:     pathType,\n\t\tOpen:         open,","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-wavepath.go#L30-L66","documentation":"wsh wavepath accepts exactly one argument naming which Wave Terminal path to print: 'config', 'data', or 'log'. This error is thrown by wavepathRun when the argument is any other string. It is a client-side argument validation guard before any RPC is made.","triggerScenarios":"Running `wsh wavepath <arg>` where <arg> is not exactly \"config\", \"data\", or \"log\" (e.g. typo like `wsh wavepath logs`, `wsh wavepath --tail` alone, or an extra positional arg being interpreted as the path type).","commonSituations":"Users guessing path type names (e.g. 'conf', 'logs', 'home'), scripting with variable path types from old wsh versions, or accidentally passing a filename as the argument.","solutions":["Run the command with one of the exact keywords: `wsh wavepath config`, `wsh wavepath data`, or `wsh wavepath log`.","Run `wsh wavepath --help` to see the accepted values.","Check scripts for typos or stale path type names from older wsh versions."],"exampleFix":"// before\nwsh wavepath logs --tail\n// after\nwsh wavepath log --tail","handlingStrategy":"validation","validationCode":"p=$(case \"$1\" in config|data|log) echo \"$1\";; *) echo \"invalid: $1 (use config|data|log)\" >&2; exit 2;; esac)","typeGuard":"func isValidPathType(s string) bool { return s == \"config\" || s == \"data\" || s == \"log\" }","tryCatchPattern":null,"preventionTips":["Memorize the three valid values: config, data, log.","Use shell completion or --help to confirm accepted args.","Validate variables before interpolating into wsh commands in scripts."],"tags":["cli","argument-validation","wsh"],"backgroundTag":"invalid-cli-argument","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}