mastra-ai/mastra · error
[Slack] No storage available. SlackProvider requires persist
Error message
[Slack] No storage available. SlackProvider requires persistent storage, configure a storage backend on your Mastra instance. See https://mastra.ai/docs/storage
What it means
This is the final guard of #resolveStorage: after attempting all resolution paths without an exception, no storage could be found on the Mastra instance. SlackProvider requires persistent storage to persist installations, pending OAuth state, and config tokens, so it refuses to operate without one.
Source
Thrown at channels/slack/src/provider.ts:418
// Ensure storage is initialized (creates tables if needed)
await store.init();
const channelsStorage = (await store.getStore('channels')) as ChannelsStorage | undefined;
if (channelsStorage) {
this.#storage = channelsStorage;
this.#storageResolved = true;
return this.#storage;
}
}
} catch (err) {
throw new Error(
'[Slack] Failed to resolve Mastra storage. Ensure your Mastra instance has storage configured (e.g. LibSQLStore or PostgresStore). See https://mastra.ai/docs/storage',
{ cause: err },
);
}
}
throw new Error(
'[Slack] No storage available. SlackProvider requires persistent storage, configure a storage backend on your Mastra instance. See https://mastra.ai/docs/storage',
);
}
// ===========================================================================
// Storage Helpers - Parse/serialize between ChannelInstallation and typed Slack data
// ===========================================================================
/**
* Parse a ChannelInstallation record into a typed SlackInstallation.
*/
#parseInstallation(record: ChannelInstallation): SlackInstallation {
const data = SlackInstallationDataSchema.parse(record.data);
return {
id: record.id,
agentId: record.agentId,
webhookId: record.webhookId ?? '',
configHash: record.configHash ?? '',View on GitHub (pinned to 75dd419e61)
Solutions
- Add a storage backend to your Mastra instance: new Mastra({ storage: new LibSQLStore({ url: 'file:./mastra.db' }) }) or PostgresStore.
- Confirm __attach(mastra) was called with the actual Mastra instance that has storage, not a bare object.
- Ensure the storage package (@mastra/libsql, @mastra/pg, etc.) is installed and imported.
Example fix
// before
export const mastra = new Mastra({ agents: { slackAgent } });
// after
export const mastra = new Mastra({
agents: { slackAgent },
storage: new LibSQLStore({ url: process.env.DATABASE_URL ?? 'file:./mastra.db' }),
}); Defensive patterns
Strategy: validation
Validate before calling
if (!mastra.getConfig?.().storage) {
throw new Error('SlackProvider requires storage: pass storage: new LibSQLStore(...) to new Mastra()');
} Try / catch
try {
await provider.initialize();
} catch (err) {
if (err instanceof Error && err.message.includes('No storage available')) {
console.error('Add storage: new Mastra({ storage: new LibSQLStore({ url: "file:./mastra.db" }) })');
process.exit(1);
} else throw err;
} Prevention
- Make storage part of your standard Mastra bootstrap template.
- Fail fast at startup: probe storage availability before registering channels.
- Remember in-memory setups do not satisfy SlackProvider's persistence requirement.
When it happens
Trigger: Calling initialize(), connect(), or any storage-dependent SlackProvider method when the attached Mastra instance has no storage configured and no channels storage is available — resolution completes with nothing found.
Common situations: Dev environments where storage was omitted for simplicity; instantiating SlackProvider and attaching it to a Mastra instance built without the storage option; forgetting that in-memory setups don't satisfy the requirement.
Related errors
- [Slack] Failed to resolve Mastra storage. Ensure your Mastra
- AcpAgent does not support resuming suspended generate calls
- ACP prompt stopped before completing: ${response.stopReason}
- MastraAuthBetterAuth needs a database to build its own bette
- Slack refresh token is invalid. Get fresh tokens from https:
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/b19e4a9c3c88151a.
Report an issue: GitHub.