{"record":{"id":"9e177dd46ea3dcc8","repo":"FlowiseAI/Flowise","slug":"error-listing-checkpoints","errorCode":null,"errorMessage":"Error listing checkpoints","messagePattern":"Error listing checkpoints","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/memory/AgentMemory/MySQLAgentMemory/mysqlSaver.ts","lineNumber":161,"sourceCode":"                                checkpoint_id: row.checkpoint_id\n                            }\n                        },\n                        checkpoint: (await this.serde.parse(row.checkpoint.toString())) as Checkpoint,\n                        metadata: (await this.serde.parse(row.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 checkpoints`, error)\n            throw new Error(`Error listing checkpoints`)\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":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/memory/AgentMemory/MySQLAgentMemory/mysqlSaver.ts#L143-L179","documentation":"MySQLSaver.list wraps the listing SELECT (with optional LIMIT interpolated directly); any DB error is logged via console.error and re-thrown as 'Error listing checkpoints'.","triggerScenarios":"Connection drop during the list query; malformed limit value interpolated into LIMIT ${limit}; table/schema drift; permission error.","commonSituations":"limit passed as a non-numeric value causing SQL syntax error; long-running enumeration over a large checkpoints table timing out; revoked SELECT.","solutions":["Check server/console logs for the original error.","Ensure limit (if provided) is a positive integer before calling list.","Verify the checkpoints table exists with the expected schema and SELECT privileges.","Add an index or bound the listing if the table is large."],"exampleFix":"// before\nfor await (const t of saver.list(cfg, 'ten')) {}\n// after\nfor await (const t of saver.list(cfg, 10)) {}","handlingStrategy":"try-catch","validationCode":"// Validate limit is a positive integer before calling list (it is interpolated into SQL)\nfunction safeLimit(n: unknown): number | undefined {\n  if (n == null) return undefined\n  const i = Number(n)\n  if (!Number.isInteger(i) || i <= 0) throw new Error('limit must be a positive integer')\n  return i\n}","typeGuard":"function isPositiveInt(n: unknown): n is number {\n  return typeof n === 'number' && Number.isInteger(n) && n > 0\n}","tryCatchPattern":"try {\n  for await (const t of saver.list(cfg, safeLimit(limit))) { /* ... */ }\n} catch (e) {\n  if (/Error listing checkpoints/.test((e as Error).message)) {\n    // inspect logs; verify table and SELECT privilege\n  }\n  throw e\n}","preventionTips":["Pass limit as a number, never a string.","Verify SELECT privilege on the checkpoints table.","Bound listing over large tables to avoid timeouts.","Watch console.error for the original query error."],"tags":["mysql","agent-memory","database","query","list","memory"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}