{"record":{"id":"e7f3315264a85ca4","repo":"mastra-ai/mastra","slug":"datasets-store-not-available","errorCode":"DATASETS_STORE_NOT_AVAILABLE","errorMessage":"Datasets store not available. Ensure your storage adapter provides a datasets domain.","messagePattern":"Datasets store not available\\. Ensure your storage adapter provides a datasets domain\\.","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/datasets/dataset.ts","lineNumber":79,"sourceCode":"  // Lazy storage resolution\n  // ---------------------------------------------------------------------------\n\n  async #getDatasetsStore(): Promise<DatasetsStorage> {\n    if (this.#datasetsStore) return this.#datasetsStore;\n\n    const storage = this.#mastra.getStorage();\n    if (!storage) {\n      throw new MastraError({\n        id: 'DATASETS_STORAGE_NOT_CONFIGURED',\n        text: 'Storage not configured. Configure storage in Mastra instance.',\n        domain: 'STORAGE',\n        category: 'USER',\n      });\n    }\n\n    const store = await storage.getStore('datasets');\n    if (!store) {\n      throw new MastraError({\n        id: 'DATASETS_STORE_NOT_AVAILABLE',\n        text: 'Datasets store not available. Ensure your storage adapter provides a datasets domain.',\n        domain: 'STORAGE',\n        category: 'USER',\n      });\n    }\n\n    this.#datasetsStore = store;\n    return store;\n  }\n\n  async #getExperimentsStore(): Promise<ExperimentsStorage> {\n    if (this.#experimentsStore) return this.#experimentsStore;\n\n    const storage = this.#mastra.getStorage();\n    if (!storage) {\n      throw new MastraError({\n        id: 'DATASETS_STORAGE_NOT_CONFIGURED',","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/datasets/dataset.ts#L61-L97","documentation":"Storage is configured but its adapter does not expose a `datasets` store. #getDatasetsStore() calls storage.getStore('datasets') and throws DATASETS_STORE_NOT_AVAILABLE when it returns undefined/null. This indicates an unsupported or older storage adapter lacking the datasets domain.","triggerScenarios":"Calling any Dataset API against a storage adapter that has not implemented the datasets domain, so getStore('datasets') returns undefined.","commonSituations":"Using an older/custom storage adapter predating datasets support; upgrading Mastra core without upgrading the storage package; using a minimal in-house storage implementation.","solutions":["Upgrade your @mastra/storage adapter (libsql/pg/upstash/etc.) to a version that implements the datasets domain.","Switch to an officially supported adapter that provides the datasets store.","If using custom storage, implement and register the datasets domain store in your adapter."],"exampleFix":"// before\nstorage: new MastraLibsqlStorage({ url: 'file:./old.db' }) // outdated adapter version\n// after\npnpm add @mastra/libsql@latest  # then reuse the same storage config","handlingStrategy":"validation","validationCode":"const store = await storage.getStore?.('datasets');\nif (!store) throw new Error('Storage adapter does not provide a datasets domain');","typeGuard":"function hasDatasetsStore(s: unknown): s is { getStore: (d: 'datasets') => Promise<unknown> } { return typeof s === 'object' && s !== null && typeof (s as any).getStore === 'function'; }","tryCatchPattern":"try { await dataset.listItems(); } catch (e) { if (e?.id === 'DATASETS_STORE_NOT_AVAILABLE') { /* upgrade adapter */ } else throw e; }","preventionTips":["Pin storage adapter versions compatible with datasets support","Check adapter changelogs when upgrading @mastra/core","Smoke-test storage.getStore('datasets') after upgrades"],"tags":["storage","datasets","adapter-compatibility"],"backgroundTag":"storage-domain-not-supported","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}