{"record":{"id":"2e623557ad98cf75","repo":"FlowiseAI/Flowise","slug":"error-listing-tablename","errorCode":null,"errorMessage":"Error listing ${tableName}","messagePattern":"Error listing (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/memory/AgentMemory/PostgresAgentMemory/pgSaver.ts","lineNumber":198,"sourceCode":"                                checkpoint_id: row.checkpoint_id\n                            }\n                        },\n                        checkpoint: (await this.serde.parse(rows[0].checkpoint.toString())) as Checkpoint,\n                        metadata: (await this.serde.parse(rows[0].metadata.toString())) as CheckpointMetadata,\n                        parentConfig: row.parent_id\n                            ? {\n                                  configurable: {\n                                      thread_id: row.thread_id,\n                                      checkpoint_id: row.parent_id\n                                  }\n                              }\n                            : undefined\n                    }\n                }\n            }\n        } catch (error) {\n            console.error(`Error listing ${tableName}`, error)\n            throw new Error(`Error listing ${tableName}`)\n        } finally {\n            await dataSource.destroy()\n        }\n    }\n\n    async put(config: RunnableConfig, checkpoint: Checkpoint, metadata: CheckpointMetadata): Promise<RunnableConfig> {\n        const dataSource = await this.getDataSource()\n        await this.setup(dataSource)\n\n        if (!config.configurable?.checkpoint_id) return {}\n        try {\n            const queryRunner = dataSource.createQueryRunner()\n            const row = [\n                config.configurable?.thread_id || this.threadId,\n                checkpoint.id,\n                config.configurable?.checkpoint_id,\n                Buffer.from(this.serde.stringify(checkpoint)), // Encode to binary\n                Buffer.from(this.serde.stringify(metadata)) // Encode to binary","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/memory/AgentMemory/PostgresAgentMemory/pgSaver.ts#L180-L216","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect console.error for the true Postgres error and address it (table/column/connection).","Pre-create or migrate the checkpoints table so the list query's columns exist.","Confirm limit is a positive number and before (if provided) is a valid RunnableConfig with a string checkpoint_id.","Increase the Postgres connection pool / max connections if the error is connection-exhaustion under concurrent list calls.","Maintainer: rethrow with cause."],"exampleFix":"// before\n} catch (error) {\n    console.error(`Error listing ${tableName}`, error)\n    throw new Error(`Error listing ${tableName}`)\n}\n// after\n} catch (error) {\n    throw new Error(`Error listing ${tableName}: ${(error as Error).message}`, { cause: error })\n}","handlingStrategy":"try-catch","validationCode":"function validateListArgs(limit?: number, before?: { configurable?: { checkpoint_id?: unknown } }) {\n  if (limit !== undefined && (!Number.isInteger(limit) || limit <= 0)) throw new Error('limit must be a positive integer')\n  if (before && before.configurable?.checkpoint_id !== undefined && typeof before.configurable.checkpoint_id !== 'string') {\n    throw new Error('before.configurable.checkpoint_id must be a string')\n  }\n}","typeGuard":"function isListError(e: unknown): boolean {\n  return e instanceof Error && /^Error listing .+$/.test(e.message)\n}","tryCatchPattern":"try {\n  for await (const tuple of saver.list(config, limit, before)) { /* ... */ }\n} catch (e) {\n  if (e instanceof Error && /Error listing/.test(e.message)) {\n    // inspect server log; verify table/schema; reduce concurrency if pool exhausted\n  }\n  throw e\n}","preventionTips":["Bound list() concurrency in API handlers to avoid Postgres connection exhaustion.","Always pass limit to keep result sets bounded.","Version-pin your checkpoints schema."],"tags":["postgres","query","list","error-masking","generator"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}