FlowiseAI/Flowise · error · Error

Error creating ${this.tableName} table

Error message

Error creating ${this.tableName} table

What it means

MySQLSaver.setup runs CREATE TABLE IF NOT EXISTS; any underlying DB error is logged via console.error (original stack visible there) and re-thrown as this generic message using the raw this.tableName (not the sanitized value).

Source

Thrown at packages/components/nodes/memory/AgentMemory/MySQLAgentMemory/mysqlSaver.ts:66

    private async setup(dataSource: DataSource): Promise<void> {
        if (this.isSetup) return

        try {
            const queryRunner = dataSource.createQueryRunner()
            const tableName = this.sanitizeTableName(this.tableName)
            await queryRunner.manager.query(`
                CREATE TABLE IF NOT EXISTS ${tableName} (
                    thread_id VARCHAR(255) NOT NULL,
                    checkpoint_id VARCHAR(255) NOT NULL,
                    parent_id VARCHAR(255),
                    checkpoint BLOB,
                    metadata BLOB,
                    PRIMARY KEY (thread_id, checkpoint_id)
                );`)
            await queryRunner.release()
        } catch (error) {
            console.error(`Error creating ${this.tableName} table`, error)
            throw new Error(`Error creating ${this.tableName} table`)
        }

        this.isSetup = true
    }

    async getTuple(config: RunnableConfig): Promise<CheckpointTuple | undefined> {
        const dataSource = await this.getDataSource()
        await this.setup(dataSource)

        const thread_id = config.configurable?.thread_id || this.threadId
        const checkpoint_id = config.configurable?.checkpoint_id
        const tableName = this.sanitizeTableName(this.tableName)

        try {
            const queryRunner = dataSource.createQueryRunner()
            const sql = checkpoint_id
                ? `SELECT checkpoint, parent_id, metadata FROM ${tableName} WHERE thread_id = ? AND checkpoint_id = ?`
                : `SELECT thread_id, checkpoint_id, parent_id, checkpoint, metadata FROM ${tableName} WHERE thread_id = ? ORDER BY checkpoint_id DESC LIMIT 1`

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Inspect server/console logs for the original error (console.error prints it before the re-throw).
  2. Grant CREATE (and ALTER) to the DB user, or use a privileged role for setup.
  3. Drop the conflicting checkpoints table if schema drifted, then let setup recreate it.
  4. Verify DB connectivity/storage before re-running.
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-flight: confirm CREATE privilege and connectivity
async function canCreate(ds: import('typeorm').DataSource): Promise<boolean> {
  const qr = ds.createQueryRunner()
  try { await qr.query('SELECT 1'); return true } finally { await qr.release() }
}

Try / catch

try {
  await saver.getTuple(config)
} catch (e) {
  if (/Error creating .* table/.test((e as Error).message)) {
    // check server logs for the original DDL error; grant privileges or fix schema
  }
  throw e
}

Prevention

When it happens

Trigger: DB user lacks CREATE privilege; connection dropped mid-DDL; an existing table with an incompatible schema; disk/full quota; MySQL version rejecting the DDL.

Common situations: Read-only DB role; table created by an older Flowise version with a different schema; exhausted database storage; flaky connection during setup.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/8b6790c3d0299747. Report an issue: GitHub.