FlowiseAI/Flowise · error · Error

Error listing ${tableName}

Error message

Error listing ${tableName}

What it means

Thrown by PostgresSaver.list() async generator when the SELECT listing query (optionally filtered by before/limit) fails. The whole generator is wrapped in one try/catch; dataSource.destroy() runs in finally, so iteration errors tear down the connection.

Source

Thrown at packages/components/nodes/memory/AgentMemory/PostgresAgentMemory/pgSaver.ts:198

                                checkpoint_id: row.checkpoint_id
                            }
                        },
                        checkpoint: (await this.serde.parse(rows[0].checkpoint.toString())) as Checkpoint,
                        metadata: (await this.serde.parse(rows[0].metadata.toString())) as CheckpointMetadata,
                        parentConfig: row.parent_id
                            ? {
                                  configurable: {
                                      thread_id: row.thread_id,
                                      checkpoint_id: row.parent_id
                                  }
                              }
                            : undefined
                    }
                }
            }
        } catch (error) {
            console.error(`Error listing ${tableName}`, error)
            throw new Error(`Error listing ${tableName}`)
        } finally {
            await dataSource.destroy()
        }
    }

    async put(config: RunnableConfig, checkpoint: Checkpoint, metadata: CheckpointMetadata): Promise<RunnableConfig> {
        const dataSource = await this.getDataSource()
        await this.setup(dataSource)

        if (!config.configurable?.checkpoint_id) return {}
        try {
            const queryRunner = dataSource.createQueryRunner()
            const row = [
                config.configurable?.thread_id || this.threadId,
                checkpoint.id,
                config.configurable?.checkpoint_id,
                Buffer.from(this.serde.stringify(checkpoint)), // Encode to binary
                Buffer.from(this.serde.stringify(metadata)) // Encode to binary

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Inspect console.error for the true Postgres error and address it (table/column/connection).
  2. Pre-create or migrate the checkpoints table so the list query's columns exist.
  3. Confirm limit is a positive number and before (if provided) is a valid RunnableConfig with a string checkpoint_id.
  4. Increase the Postgres connection pool / max connections if the error is connection-exhaustion under concurrent list calls.
  5. Maintainer: rethrow with cause.

Example fix

// before
} catch (error) {
    console.error(`Error listing ${tableName}`, error)
    throw new Error(`Error listing ${tableName}`)
}
// after
} catch (error) {
    throw new Error(`Error listing ${tableName}: ${(error as Error).message}`, { cause: error })
}
Defensive patterns

Strategy: try-catch

Validate before calling

function validateListArgs(limit?: number, before?: { configurable?: { checkpoint_id?: unknown } }) {
  if (limit !== undefined && (!Number.isInteger(limit) || limit <= 0)) throw new Error('limit must be a positive integer')
  if (before && before.configurable?.checkpoint_id !== undefined && typeof before.configurable.checkpoint_id !== 'string') {
    throw new Error('before.configurable.checkpoint_id must be a string')
  }
}

Type guard

function isListError(e: unknown): boolean {
  return e instanceof Error && /^Error listing .+$/.test(e.message)
}

Try / catch

try {
  for await (const tuple of saver.list(config, limit, before)) { /* ... */ }
} catch (e) {
  if (e instanceof Error && /Error listing/.test(e.message)) {
    // inspect server log; verify table/schema; reduce concurrency if pool exhausted
  }
  throw e
}

Prevention

When it happens

Trigger: Iterating list(config, limit, before) when the underlying query fails: missing table, bad column, connection drop, or a malformed before?.configurable?.checkpoint_id being interpolated/bound incorrectly.

Common situations: UI/API flows that list thread history. Schema drift. Concurrent connection limits on managed Postgres hitting during a list scan. Passing a non-string before checkpoint_id.

Related errors


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