mastra-ai/mastra · critical · HTTPException

Skills storage domain is not available

Error message

Skills storage domain is not available

What it means

Storage exists but storage.getStore('skills') returns undefined, so the stored-skills list handler throws HTTPException 500 'Skills storage domain is not available'. Modern Mastra storage is split into domain stores ('skills', 'favorites', etc.); the configured adapter must implement the skills domain for these routes to work.

Source

Thrown at packages/server/src/server/handlers/stored-skills.ts:143

    perPage,
    orderBy,
    status,
    authorId,
    visibility,
    metadata,
    favoritedOnly,
    pinFavoritedFor,
  }) => {
    try {
      const storage = mastra.getStorage();

      if (!storage) {
        throw new HTTPException(500, { message: 'Storage is not configured' });
      }

      const skillStore = await storage.getStore('skills');
      if (!skillStore) {
        throw new HTTPException(500, { message: 'Skills storage domain is not available' });
      }

      const filter = resolveAuthorFilter({
        requestContext,
        resource: 'stored-skills',
        queryAuthorId: authorId,
        queryVisibility: visibility,
      });

      const scope = await getStoredResourceScope(mastra, requestContext);
      const scopedMetadata = scopeStoredResourceMetadata(metadata, scope);

      const callerId = getCallerAuthorId(requestContext);
      const favoritesEnabled = await isBuilderFeatureEnabled(mastra, 'favorites');
      const honoredStarredOnly = favoritesEnabled && favoritedOnly === true;
      const favoriteSubjectId = pinFavoritedFor ?? callerId;

      // `?favoritedOnly=true` flow: fetch caller's favorited IDs, restrict the list

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Upgrade to a storage adapter version that implements the skills domain (align @mastra/core and storage package versions)
  2. Run schema migrations/setup for the configured backend so skills tables exist
  3. Test storage.getStore('skills') directly against your deployed storage config
  4. For custom adapters, implement the skills store and return it from getStore('skills')

Example fix

// before
storage: new CustomLegacyStore(); // no skills domain

// after
storage: new LibSQLStore({ url: process.env.DATABASE_URL }); // implements skills + favorites
Defensive patterns

Strategy: validation

Validate before calling

const storage = mastra.getStorage();
if (!storage || !(await storage.getStore('skills'))) {
  throw new Error('Storage adapter does not provide the skills domain');
}

Type guard

function providesSkillsDomain(s: { getStore(d: string): Promise<unknown> } | undefined): s is { getStore(d: 'skills'): Promise<unknown> } {
  return !!s;
}

Try / catch

try {
  return await api.get('/stored/skills');
} catch (e) {
  if (isHttpError(e) && /Skills storage domain/.test(e.message)) {
    alertOps('skills domain missing from storage adapter'); return emptyPage;
  }
  throw e;
}

Prevention

When it happens

Trigger: Listing stored skills when the configured storage adapter lacks a 'skills' store — getStore('skills') resolves to undefined because the adapter class doesn't implement that domain or its registration/schema init failed.

Common situations: Older or custom storage adapters predating the skills domain; database migrations for the skills tables not applied; version mismatch between @mastra/core and the storage package so the domain isn't recognized.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/f6b4133999f4fa0b. Report an issue: GitHub.