{"record":{"id":"c0a3124f6879fdfc","repo":"wavetermdev/waveterm","slug":"setting-config-w","errorCode":null,"errorMessage":"setting config: %w","messagePattern":"setting config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-setconfig.go","lineNumber":39,"sourceCode":"\nfunc init() {\n\trootCmd.AddCommand(setConfigCmd)\n}\n\nfunc setConfigRun(cmd *cobra.Command, args []string) (rtnErr error) {\n\tdefer func() {\n\t\tsendActivity(\"setconfig\", rtnErr == nil)\n\t}()\n\n\tmetaSetsStrs := args[:]\n\tmeta, err := parseMetaSets(metaSetsStrs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcommandData := wshrpc.MetaSettingsType{MetaMapType: meta}\n\terr = wshclient.SetConfigCommand(RpcClient, commandData, &wshrpc.RpcOpts{Timeout: 2000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"setting config: %w\", err)\n\t}\n\tWriteStdout(\"config set\\n\")\n\treturn nil\n}\n","sourceCodeStart":21,"sourceCodeEnd":44,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-setconfig.go#L21-L44","documentation":"`wsh setconfig` validates its key=value arguments locally, then sends the parsed metadata map to the running Wave Terminal via SetConfigCommand with a 2-second timeout. Any RPC failure (no connection, timeout, or server-side rejection of the config change) is wrapped with \"setting config\". The local parsing succeeded but the configuration was not applied.","triggerScenarios":"Running `wsh setconfig` outside a Wave Terminal context; the terminal connection dropped; the RPC exceeded the 2000ms timeout on slow/SSH remotes; or the server rejected the settings payload.","commonSituations":"Running wsh from a plain shell not attached to Wave; transient network issues on remote connections; hung terminal causing the 2s timeout to fire.","solutions":["Run the command from within a Wave Terminal block so an RPC client is available","Retry the command after confirming the terminal is responsive (e.g. `wsh ls`)","Check the Wave Terminal connection; restart the terminal connection if it is hung","Inspect the wrapped error after the colon for the server-side cause"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# confirm connectivity before applying config\nwsh ls / >/dev/null 2>&1 || { echo \"no wsh connection\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"const { execSync } = require(\"child_process\");\ntry {\n  execSync(`wsh setconfig ${args}`);\n} catch (e) {\n  if (String(e.stderr).includes(\"setting config\")) {\n    console.error(\"RPC failed; check terminal connection and retry\");\n  } else throw e;\n}","preventionTips":["Run wsh setconfig from inside a Wave Terminal block","Confirm the terminal responds (wsh ls) before config changes","Retry transient timeout failures; avoid running during connection churn","Keep wsh and waveterm versions in sync"],"tags":["cli","rpc","config","network"],"backgroundTag":"rpc-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}