{"record":{"id":"0c8150663bd9832f","repo":"ComposioHQ/composio","slug":"nodefaultstore","errorCode":"NoDefaultStore","errorMessage":"NoDefaultStore","messagePattern":"NoDefaultStore","errorType":"error_code","errorClass":"KeyringError","httpStatus":null,"severity":"error","filePath":"ts/packages/cli-keyring/src/core/store.ts","lineNumber":100,"sourceCode":" * The CLI calls this once at startup; tests call it to inject a mock.\n */\nexport function setDefaultStore(store: CredentialStore): void {\n  defaultStore = store;\n}\n\n/** Clear the registered store — mostly useful for test teardown. */\nexport function unsetDefaultStore(): void {\n  defaultStore = null;\n}\n\n/**\n * Return the active default store or throw `NoDefaultStore` if none is\n * registered. Callers that want a non-throwing check should use\n * `hasDefaultStore()` instead.\n */\nexport function getDefaultStore(): CredentialStore {\n  if (defaultStore === null) {\n    throw new KeyringError({ kind: 'NoDefaultStore' });\n  }\n  return defaultStore;\n}\n\nexport function hasDefaultStore(): boolean {\n  return defaultStore !== null;\n}\n","sourceCodeStart":82,"sourceCodeEnd":108,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli-keyring/src/core/store.ts#L82-L108","documentation":"getDefaultStore() throws KeyringError kind 'NoDefaultStore' because no CredentialStore implementation has been registered as the default. The keyring entry has no overrideStore and no global default was set.","triggerScenarios":"Creating an Entry without overrideStore and calling any secret operation before a registerDefaultStore(...)/set-default call ran.","commonSituations":"Forgetting to initialize the keyring store in a fresh process, or an init race where the entry is used before store registration.","solutions":["Register a default store during app startup before using Entry","Pass an explicit overrideStore when constructing the Entry","Guard with hasDefaultStore() before use"],"exampleFix":"// before\nconst e = new Entry('svc','user'); await e.getSecret();\n// after\nregisterDefaultStore(myStore);\nconst e = new Entry('svc','user'); await e.getSecret();","handlingStrategy":"validation","validationCode":"if (!hasDefaultStore()) registerDefaultStore(myStore);","typeGuard":"import { hasDefaultStore } from '.../store';\n// hasDefaultStore(): boolean acts as the runtime guard","tryCatchPattern":"catch (e) { if (e instanceof KeyringError && e.kind === 'NoDefaultStore') { registerDefaultStore(fallback); retry(); } else throw e; }","preventionTips":["Register the store once at app bootstrap","Pass overrideStore explicitly in tests"],"tags":["keyring","initialization","typescript"],"backgroundTag":"service-not-registered","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}