{"record":{"id":"41498532ed52ad37","repo":"langchain-ai/langgraph","slug":"error-executing-ttl-refresh-query-query-query","errorCode":null,"errorMessage":"Error executing TTL refresh: \n{query.query}\n{query.params}\n{e}","messagePattern":"Error executing TTL refresh: \n(.+?)\n(.+?)\n(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/checkpoint-sqlite/langgraph/store/sqlite/aio.py","lineNumber":429,"sourceCode":"        Args:\n            get_ops: Sequence of GET operations.\n            results: List to store results in.\n            cur: Database cursor.\n        \"\"\"\n        # Group all queries by namespace to execute all operations for each namespace together\n        namespace_queries = defaultdict(list)\n        for prepared_query in self._get_batch_GET_ops_queries(get_ops):\n            namespace_queries[prepared_query.namespace].append(prepared_query)\n\n        # Process each namespace's operations\n        for namespace, queries in namespace_queries.items():\n            # Execute TTL refresh queries first\n            for query in queries:\n                if query.kind == \"refresh\":\n                    try:\n                        await cur.execute(query.query, query.params)\n                    except Exception as e:\n                        raise ValueError(\n                            f\"Error executing TTL refresh: \\n{query.query}\\n{query.params}\\n{e}\"\n                        ) from e\n\n            # Then execute GET queries and process results\n            for query in queries:\n                if query.kind == \"get\":\n                    try:\n                        await cur.execute(query.query, query.params)\n                    except Exception as e:\n                        raise ValueError(\n                            f\"Error executing GET query: \\n{query.query}\\n{query.params}\\n{e}\"\n                        ) from e\n\n                    rows = await cur.fetchall()\n                    key_to_row = {\n                        row[0]: {\n                            \"key\": row[0],\n                            \"value\": row[1],","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/checkpoint-sqlite/langgraph/store/sqlite/aio.py#L411-L447","documentation":"A defensive wrapper inside AsyncSqliteStore's batch GET processing: the TTL refresh statement (UPDATE ... setting updated_at/expiry) for an item about to be read failed at the aiosqlite level, and the driver exception is re-raised as ValueError with the exact SQL and bound parameters appended for diagnosis. Root causes are typically a locked/busy database, schema drift, or an incompatible TTL table definition.","triggerScenarios":"Thrown at libs/checkpoint-sqlite/langgraph/store/sqlite/aio.py:429 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the query and params in the message to identify the failing statement and offending item","If the database is locked, ensure only one writer at a time or enable WAL journaling","If the TTL table schema was created by an older version, recreate the store schema so ttl_expired_at columns match the current code"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","contentChangedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}