From ee99cb7ba1d9295b13e2ca169bb2580e86fe9d92 Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Sun, 12 Oct 2025 21:42:26 +0200 Subject: [PATCH] fix: Skip FTS5 validation for sql.js databases in Docker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves Docker test failures where sql.js databases (which don't support FTS5) were failing validation checks. The validateDatabaseHealth() method now checks FTS5 support before attempting FTS5 table queries. Changes: - Check db.checkFTS5Support() before FTS5 table validation - Log warning for sql.js databases instead of failing - Allows Docker containers using sql.js to start successfully Fixes: Docker entrypoint integration tests Related: feature/session-persistence-phase-1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/mcp/server.ts | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/mcp/server.ts b/src/mcp/server.ts index bc440ec..1408e1f 100644 --- a/src/mcp/server.ts +++ b/src/mcp/server.ts @@ -285,18 +285,26 @@ export class N8NDocumentationMCPServer { throw new Error('Database is empty. Run "npm run rebuild" to populate node data.'); } - // Check if FTS5 table exists - const ftsExists = this.db.prepare(` - SELECT name FROM sqlite_master - WHERE type='table' AND name='nodes_fts' - `).get(); + // Check FTS5 support before attempting FTS5 queries + // sql.js doesn't support FTS5, so we need to skip FTS5 validation for sql.js databases + const hasFTS5 = this.db.checkFTS5Support(); - if (!ftsExists) { - logger.warn('FTS5 table missing - search performance will be degraded. Please run: npm run rebuild'); + if (!hasFTS5) { + logger.warn('FTS5 not supported (likely using sql.js) - search will use basic queries'); } else { - const ftsCount = this.db.prepare('SELECT COUNT(*) as count FROM nodes_fts').get() as { count: number }; - if (ftsCount.count === 0) { - logger.warn('FTS5 index is empty - search will not work properly. Please run: npm run rebuild'); + // Only check FTS5 table if FTS5 is supported + const ftsExists = this.db.prepare(` + SELECT name FROM sqlite_master + WHERE type='table' AND name='nodes_fts' + `).get(); + + if (!ftsExists) { + logger.warn('FTS5 table missing - search performance will be degraded. Please run: npm run rebuild'); + } else { + const ftsCount = this.db.prepare('SELECT COUNT(*) as count FROM nodes_fts').get() as { count: number }; + if (ftsCount.count === 0) { + logger.warn('FTS5 index is empty - search will not work properly. Please run: npm run rebuild'); + } } }