{"record":{"id":"61afc6fcd6162b3f","repo":"wavetermdev/waveterm","slug":"listing-secrets-w","errorCode":null,"errorMessage":"listing secrets: %w","messagePattern":"listing secrets: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-secret.go","lineNumber":145,"sourceCode":"\n\tsecrets := map[string]*string{name: &value}\n\terr = wshclient.SetSecretsCommand(RpcClient, secrets, &wshrpc.RpcOpts{Timeout: 2000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"setting secret: %w\", err)\n\t}\n\n\tWriteStdout(\"secret set: %s\\n\", name)\n\treturn nil\n}\n\nfunc secretListRun(cmd *cobra.Command, args []string) (rtnErr error) {\n\tdefer func() {\n\t\tsendActivity(\"secret\", rtnErr == nil)\n\t}()\n\n\tnames, err := wshclient.GetSecretsNamesCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 2000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"listing secrets: %w\", err)\n\t}\n\n\tfor _, name := range names {\n\t\tWriteStdout(\"%s\\n\", name)\n\t}\n\treturn nil\n}\n\nfunc secretDeleteRun(cmd *cobra.Command, args []string) (rtnErr error) {\n\tdefer func() {\n\t\tsendActivity(\"secret\", rtnErr == nil)\n\t}()\n\n\tname := args[0]\n\tif !secretNameRegex.MatchString(name) {\n\t\treturn fmt.Errorf(\"invalid secret name: must start with a letter and contain only letters, numbers, and underscores\")\n\t}\n","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-secret.go#L127-L163","documentation":"`wsh secret list` fetches all secret names via GetSecretsNamesCommand with a 2000ms timeout; any RPC failure — unreachable daemon, timeout, or server-side handler error — is surfaced wrapped in this message. Since there is no local validation on this path, essentially only connectivity or daemon-side store problems produce it.","triggerScenarios":"Running `wsh secret list` when no Wave daemon is reachable (Wave not running, stale CLI connection), the RPC exceeds 2000ms, or the daemon errors reading the secret store (e.g. Linux keyring/D-Bus failure while enumerating entries).","commonSituations":"Running wsh over SSH into a box where Wave isn't running; keyring daemon hung so enumeration times out; version mismatch where the running daemon predates the secrets feature; corrupt or inaccessible secret store after OS upgrade.","solutions":["Confirm general wsh connectivity with another command (e.g. `wsh ls`); if all fail, start Wave Terminal or restart it to restore the daemon connection.","If the wrapped error is a timeout, check whether your keyring service (gnome-keyring/kwallet/secret-service) is hung and restart it.","Update Wave Terminal and wsh to the same version so the GetSecretsNames RPC exists on the daemon.","If the store itself is failing, inspect the wrapped error for keyring/D-Bus details and repair the OS secret service before retrying."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Probe connectivity first:\n// if err := exec.Command(\"wsh\", \"ls\").Run(); err != nil { /* daemon not running */ }","typeGuard":null,"tryCatchPattern":"var names []string\nvar err error\nfor i := 0; i < 2; i++ {\n    names, err = wshclient.GetSecretsNamesCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 2000})\n    if err == nil { break }\n    time.Sleep(500 * time.Millisecond) // single retry for transient RPC/keyring hiccups\n}\nif err != nil {\n    return fmt.Errorf(\"listing secrets: %w\", err)\n}","preventionTips":["Run wsh from a session where the Wave daemon is alive; restart Wave on stale connections","Bump the RpcOpts timeout if your keyring is slow to respond","Keep daemon and CLI versions aligned so the RPC exists","Investigate keyring/D-Bus health on Linux if list reliably times out"],"tags":["rpc","network","timeout","secrets"],"backgroundTag":"rpc-call-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}