{"record":{"id":"1a741e24476f4433","repo":"dapr/dapr","slug":"secret-store-q-not-found","errorCode":null,"errorMessage":"secret store %q not found","messagePattern":"secret store %q not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/compstore/secretstore.go","lineNumber":64,"sourceCode":"\nfunc (c *ComponentStore) DeleteSecretStore(name string) {\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\n\tdelete(c.secrets, name)\n}\n\nfunc (c *ComponentStore) SecretStoresLen() int {\n\tc.lock.RLock()\n\tdefer c.lock.RUnlock()\n\n\treturn len(c.secrets)\n}\n\nfunc (c *ComponentStore) GetSecret(ctx context.Context, storeName, secretName, secretKey string) (string, error) {\n\tstore, ok := c.GetSecretStore(storeName)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"secret store %q not found\", storeName)\n\t}\n\tresp, err := store.GetSecret(ctx, secretstores.GetSecretRequest{Name: secretName})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get secret %q from store %q: %w\", secretName, storeName, err)\n\t}\n\tval, ok := resp.Data[secretKey]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"key %q not found in secret %q (store: %q)\", secretKey, secretName, storeName)\n\t}\n\treturn val, nil\n}\n","sourceCodeStart":46,"sourceCodeEnd":76,"githubUrl":"https://github.com/dapr/dapr/blob/74ad41702745709bb15fe2114ff693b8c59bc3cc/pkg/runtime/compstore/secretstore.go#L46-L76","documentation":"Thrown by ComponentStore.GetSecret (pkg/runtime/compstore/secretstore.go:64) when no secret store component with the given name is registered in the runtime's component store. Dapr only registers secret stores whose component YAML loaded successfully during init, so this is a pure lookup failure: the request never reached any secrets backend. It means the store name is unknown to the process, not that the secret is missing.","triggerScenarios":"Calling compstore.GetSecret(ctx, \"myvault\", secret, key) when no component with metadata.name == \"myvault\" and kind SecretStore was loaded, or when that component's Init failed so it was never added to c.secrets via AddSecretStore.","commonSituations":"A component's secretstores.secretstoreRef (or secretKeyRef) names a store that does not exist; the SecretStore YAML is missing from --components-path; the component failed auth/spec validation at startup; in Kubernetes the Component lives in a different namespace than the one the sidecar watches.","solutions":["List the loaded components (`dapr components -k` or inspect the components dir) and verify the secret store's metadata.name matches the requested storeName exactly","Check daprd startup logs for an init error on that secret store component and fix the component spec/auth so it loads","Add the missing SecretStore component YAML to the components directory (or apply the k8s Component resource) and restart the sidecar","Fix the referencing component/configuration so the store name matches the registered name (no typos, no namespace prefix in standalone mode)"],"exampleFix":"# before (component references a wrong store name)\nspec:\n  type: state.redis\n  metadata:\n  - name: redisPassword\n    secretKeyRef:\n      name: redis-secret\n      key: password\n      secretStore: keyvaultx   # no such store registered\n\n# after\n      secretStore: keyvault    # matches metadata.name of the loaded SecretStore","handlingStrategy":"validation","validationCode":"if _, ok := compStore.GetSecretStore(storeName); !ok {\n\treturn fmt.Errorf(\"skip: secret store %q is not loaded; check components\", storeName)\n}\nval, err := compStore.GetSecret(ctx, storeName, secretName, secretKey)","typeGuard":"func hasSecretStore(c *compstore.ComponentStore, name string) bool {\n\t_, ok := c.GetSecretStore(name)\n\treturn ok\n}","tryCatchPattern":null,"preventionTips":["Name-match the secretstoreRef in every component with the SecretStore's metadata.name before deploying","Fail CI when a component references a secret store that no loaded SecretStore provides","After sidecar start, assert the store appears in the components list before the app fetches secrets"],"tags":["go","dapr","secrets","components","configuration"],"backgroundTag":null,"analyzedSha":"74ad41702745709bb15fe2114ff693b8c59bc3cc","analyzedAt":"2026-08-16T04:22:26.543Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}