wavetermdev/waveterm · error
error getting secret names: %w
Error message
error getting secret names: %w
What it means
GetSecretsNamesCommand enumerates all stored secret names via secretstore.GetSecretNames. Enumerating requires access to every entry in the secret backend, so any backend-level failure is wrapped as "error getting secret names". This lists names only — values are never returned.
Source
Thrown at pkg/wshrpc/wshserver/wshserver.go:1492
func (ws *WshServer) GetSecretsCommand(ctx context.Context, names []string) (map[string]string, error) {
result := make(map[string]string)
for _, name := range names {
value, exists, err := secretstore.GetSecret(name)
if err != nil {
return nil, fmt.Errorf("error getting secret %q: %w", name, err)
}
if exists {
result[name] = value
}
}
return result, nil
}
func (ws *WshServer) GetSecretsNamesCommand(ctx context.Context) ([]string, error) {
names, err := secretstore.GetSecretNames()
if err != nil {
return nil, fmt.Errorf("error getting secret names: %w", err)
}
return names, nil
}
func (ws *WshServer) SetSecretsCommand(ctx context.Context, secrets map[string]*string) error {
for name, value := range secrets {
if value == nil {
err := secretstore.DeleteSecret(name)
if err != nil {
return fmt.Errorf("error deleting secret %q: %w", name, err)
}
} else {
err := secretstore.SetSecret(name, *value)
if err != nil {
return fmt.Errorf("error setting secret %q: %w", name, err)
}
}
}View on GitHub (pinned to a4447c1563)
Solutions
- Check the wrapped cause for which backend failed.
- On Linux, verify a secret service is available or set a valid storage backend (see GetSecretsLinuxStorageBackendCommand).
- Unlock the keychain / start the keyring daemon and retry.
Defensive patterns
Strategy: try-catch
Validate before calling
if runtime.GOOS == "linux" {
if _, err := wshclient.GetSecretsLinuxStorageBackendCommand(ctx); err != nil {
return fmt.Errorf("cannot enumerate secrets, no backend: %w", err)
}
} Try / catch
names, err := wshclient.GetSecretsNamesCommand(ctx)
if err != nil && strings.Contains(err.Error(), "error getting secret names") {
// unlock keychain / start secret service, then retry
} Prevention
- Run enumeration only in sessions with a live keyring (D-Bus on Linux, unlocked Keychain on macOS).
- Cache the name list rather than re-enumerating frequently.
- Install a secrets provider on minimal Linux systems before using wsh secrets.
When it happens
Trigger: Calling GetSecretsNamesCommand when the OS secret backend cannot enumerate its collection: locked/unavailable keychain, missing Linux secret backend, or corrupt backend storage.
Common situations: Headless Linux without gnome-keyring/KWallet; macOS Keychain locked; switching Linux storage backends without migration leaving an unreadable collection.
Related errors
- error getting secret %q: %w
- error deleting secret %q: %w
- error setting secret %q: %w
- setting secret: %w
- listing secrets: %w
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/2e622efab86f1d93.
Report an issue: GitHub.