thedotmack/claude-mem · warning

FTS5 table creation failed — search will use ChromaDB and LI

Error message

FTS5 table creation failed — search will use ChromaDB and LIKE queries

What it means

Logged during schema init when the FTS5 probe succeeded but createFTSTablesAndTriggers() threw while creating the real full-text tables and triggers. The service sets _fts5Available = false and degrades gracefully: text search falls back to ChromaDB vector search plus SQL LIKE queries. It is a capability warning, not data loss.

Source

Thrown at src/services/sqlite/SessionSearch.ts:61

    const hasFTS = tables.some(t => t.name === 'observations_fts' || t.name === 'session_summaries_fts');

    if (hasFTS) {
      return;
    }

    if (!this.isFts5Available()) {
      logger.warn('DB', 'FTS5 not available on this platform — skipping FTS table creation (search uses ChromaDB)');
      return;
    }

    logger.info('DB', 'Creating FTS5 tables');

    try {
      this.createFTSTablesAndTriggers();
      logger.info('DB', 'FTS5 tables created successfully');
    } catch (error) {
      this._fts5Available = false;
      logger.warn('DB', 'FTS5 table creation failed — search will use ChromaDB and LIKE queries', {}, error instanceof Error ? error : undefined);
    }
  }

  private isFts5Available(): boolean {
    try {
      this.db.run('CREATE VIRTUAL TABLE _fts5_probe USING fts5(test_column)');
      this.db.run('DROP TABLE _fts5_probe');
      return true;
    } catch (error) {
      logger.debug('DB', 'FTS5 probe failed — FTS5 unavailable on this platform', undefined, error instanceof Error ? error : new Error(String(error)));
      return false;
    }
  }

  private createFTSTablesAndTriggers(): void {
    this.db.run(`
      CREATE VIRTUAL TABLE IF NOT EXISTS observations_fts USING fts5(
        title,

View on GitHub (pinned to e2d1df569a)

Solutions

  1. Enable debug logging and restart — the error object attached to this warning names the exact SQL statement that failed
  2. Verify FTS5 against the same file in a sqlite shell: CREATE VIRTUAL TABLE _t USING fts5(x); DROP TABLE _t;
  3. If stale shadow tables are the cause: back up the DB, drop the *_fts tables and their _data/_idx/_content/_docsize/_config shadow tables, then restart so they are recreated
  4. Ensure the DB file and its directory are writable and on a local filesystem
  5. If FTS5 is genuinely unavailable on the platform, accept the fallback (ChromaDB + LIKE) or switch to a runtime with FTS5 compiled in
Defensive patterns

Strategy: fallback

Validate before calling

import Database from 'better-sqlite3';

function fts5Available(db: Database): boolean {
  try {
    db.exec('CREATE VIRTUAL TABLE _fts5_probe USING fts5(x);');
    db.exec('DROP TABLE _fts5_probe;');
    return true;
  } catch {
    return false;
  }
}

// before relying on text search
if (!fts5Available(db)) {
  // plan for ChromaDB + LIKE search from the start
}

Prevention

When it happens

Trigger: initializeFTS() runs at startup: CREATE VIRTUAL TABLE _fts5_probe USING fts5(test_column) works, then the actual observations/sessions FTS table or trigger creation fails. Typical failures: stale FTS shadow tables left from an older schema version, a locked or read-only database file, or a corrupt database.

Common situations: A driver/runtime SQLite build with partial FTS5 support; a DB upgraded from an older version whose FTS table shape changed; the DB file placed on a read-only, network, or cloud-synced volume; another process holding the write lock during startup.

Related errors


AI-assisted analysis of thedotmack/claude-mem@e2d1df569a (2026-08-20). Data as JSON: /api/errors/2557a804553a4c02. Report an issue: GitHub.