Repository navigation
Description
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
I am running openclaw in a container in Azure Container Apps. I deployed a container with 2026.6.1. After doing some configuration and restarting the container I am seeing this error in the web UI:
GatewayRequestError: Error: file is not a database: code=ERR_SQLITE_ERROR
The openclaw logs show several other ERR_SQLITE_ERROR messages. (below)
I redeployed the container and it resolved the issue. After another restart I observed the error one more time.
I reverted my container image back to 2026.5.27 and the container is working just fine now.
Steps to reproduce
- Deploy container image version 2026.6.1.
- Restart the container.
- Gateway report SQLITE errors.
Expected behavior
Container should continue to work after restart.
Actual behavior
Gateway display SQLITE error. Openclaw CLI refuses to work with similar SQLITE error related to plugin state database.
OpenClaw version
2026.6.1
Operating system
Docker image Debian version
Install method
docker
Model
claude-sonnet-4-6
Provider / routing chain
openclaw -> prompt security gateway -> Anthropic
Additional provider/model setup details
No response
Logs, screenshots, and evidence
2026-06-05T00:29:05.26957 Connecting to the container 'openclaw'...
2026-06-05T00:29:05.29967 Successfully Connected to container: 'openclaw' [Revision: 'heimdall-app--0000004', Replica: 'heimdall-app--0000004-7769bd8576-jjkm2']
2026-06-05T00:24:36.7380730Z stdout F 2026-06-05T00:24:36.737+00:00 [ws] ⇄ res ✓ agent.identity.get 226ms conn=880de20a…f4dc id=262e2b05…203d
2026-06-05T00:24:36.7416932Z stdout F 2026-06-05T00:24:36.740+00:00 [ws] ⇄ res ✓ health 229ms cached=true conn=880de20a…f4dc id=9d433464…e9db
2026-06-05T00:24:37.1952035Z stderr F 2026-06-05T00:24:37.194+00:00 [gateway] request handler failed: Error: file is not a database: code=ERR_SQLITE_ERROR
2026-06-05T00:24:37.1966523Z stdout F 2026-06-05T00:24:37.196+00:00 [ws] ⇄ res ✗ chat.startup 418ms errorCode=UNAVAILABLE errorMessage=Error: file is not a database: code=ERR_SQLITE_ERROR conn=880de20a…f4dc id=b89547ec…8127
2026-06-05T00:24:37.3207625Z stdout F 2026-06-05T00:24:37.320+00:00 [ws] ⇄ res ✓ agents.list 83ms conn=880de20a…f4dc id=cde13576…a687
2026-06-05T00:24:37.5809793Z stdout F 2026-06-05T00:24:37.580+00:00 [ws] ⇄ res ✓ models.authStatus 343ms conn=880de20a…f4dc id=49884b73…2f90
2026-06-05T00:24:47.9522673Z stderr F 2026-06-05T00:24:47.952+00:00 [tasks/task-registry-maintenance] Failed to list ACP sessions during task maintenance
2026-06-05T00:25:47.9417863Z stderr F 2026-06-05T00:25:47.941+00:00 [tasks/task-registry-maintenance] Failed to list ACP sessions during task maintenance
2026-06-05T00:26:41.5404355Z stdout F 2026-06-05T00:26:41.540+00:00 [ws] webchat disconnected code=1001 reason=n/a conn=880de20a-af68-4baa-9eb6-b33547dff4dc
2026-06-05T00:26:41.6584043Z stderr F 2026-06-05T00:26:41.657+00:00 [ws] Proxy headers detected from untrusted address. Connection will not be treated as local. Configure gateway.trustedProxies to restore local client detection behind your proxy.
2026-06-05T00:26:42.1028128Z stdout F 2026-06-05T00:26:42.102+00:00 [ws] webchat connected conn=b601fd8c-773e-4451-89b7-2f1293736415 remote=100.100.1.42 client=openclaw-control-ui webchat vcontrol-ui
2026-06-05T00:26:42.5402657Z stdout F 2026-06-05T00:26:42.539+00:00 [ws] ⇄ res ✓ commands.list 346ms conn=b601fd8c…6415 id=f015042b…77a1
2026-06-05T00:26:43.2201476Z stderr F 2026-06-05T00:26:43.219+00:00 [gateway] request handler failed: Error: file is not a database: code=ERR_SQLITE_ERROR
2026-06-05T00:26:43.2223519Z stdout F 2026-06-05T00:26:43.222+00:00 [ws] ⇄ res ✗ chat.startup 1072ms errorCode=UNAVAILABLE errorMessage=Error: file is not a database: code=ERR_SQLITE_ERROR conn=b601fd8c…6415 id=ac0168b4…c99a
2026-06-05T00:26:43.2601904Z stdout F 2026-06-05T00:26:43.259+00:00 [ws] ⇄ res ✓ models.list 1067ms conn=b601fd8c…6415 id=abbe1113…e57d
2026-06-05T00:26:43.6274661Z stdout F 2026-06-05T00:26:43.627+00:00 [ws] ⇄ res ✓ models.authStatus 157ms conn=b601fd8c…6415 id=be360876…324b
2026-06-05T00:26:43.7298469Z stdout F 2026-06-05T00:26:43.729+00:00 [ws] ⇄ res ✓ agents.list 260ms conn=b601fd8c…6415 id=1fd25f78…fab5
2026-06-05T00:26:47.9466808Z stderr F 2026-06-05T00:26:47.946+00:00 [tasks/task-registry-maintenance] Failed to list ACP sessions during task maintenance
2026-06-05T00:27:47.9495164Z stderr F 2026-06-05T00:27:47.949+00:00 [tasks/task-registry-maintenance] Failed to list ACP sessions during task maintenance
2026-06-05T00:28:47.9534200Z stderr F 2026-06-05T00:28:47.953+00:00 [tasks/task-registry-maintenance] Failed to list ACP sessions during task maintenanceImpact and severity
High impact. Agent is unusable.
Additional information
No response
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 5, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 4, 2026, 8:45 PM ET / 00:45 UTC.
Summary
Keep open: this is a recent external regression report, and current main still routes the reported
chat.startup, ACP maintenance, task, and plugin-state paths through shared SQLite state without an obvious unreadable-database recovery path. The 2026.6.1 release also explicitly moved several restart-sensitive state surfaces toward SQLite, matching the reporter's version window.Reproducibility: no. high-confidence current-main reproduction was established in this read-only review. The source path is clear from the provided logs:
chat.startup, ACP task maintenance, and plugin state all still read the shared SQLite state database.Ways to help us reproduce this
Next step
A maintainer-quality Docker/current-main repro is needed before a safe repair lane because the report does not identify which SQLite file became non-database data.
Review details
Best possible solution:
Reproduce the Docker restart failure against current main, identify which SQLite file becomes unreadable, then add a narrow state-database repair or diagnostic path with regression coverage for gateway startup and plugin-state access.
Do we have a high-confidence way to reproduce the issue?
No high-confidence current-main reproduction was established in this read-only review. The source path is clear from the provided logs:
chat.startup, ACP task maintenance, and plugin state all still read the shared SQLite state database.Is this the best way to solve the issue?
Unclear because no fix is proposed yet. The maintainable fix should stay in the shared SQLite/plugin-state lifecycle and prove both fresh container startup and restart/upgrade behavior.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
state/openclaw.sqlite, so the repair should identify whether the failure is shared state, per-agent state, or legacy plugin-state migration before changing recovery behavior.Codex review notes: model gpt-5.5, reasoning high; reviewed against ecb6779a1632.
Label changes
Label changes:
P1: The reported regression leaves the supported Docker image's gateway and CLI unusable after restart.impact:data-loss: The central symptom is an unreadable persisted SQLite state database after restart.impact:crash-loop: The SQLite failure makes core gateway request handling unavailable after restart.impact:session-state: The failing paths include chat startup, ACP session metadata, task maintenance, and plugin state.issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.clawsweeper:needs-live-repro: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.Label justifications:
P1: The reported regression leaves the supported Docker image's gateway and CLI unusable after restart.impact:crash-loop: The SQLite failure makes core gateway request handling unavailable after restart.impact:data-loss: The central symptom is an unreadable persisted SQLite state database after restart.impact:session-state: The failing paths include chat startup, ACP session metadata, task maintenance, and plugin state.Evidence reviewed
Acceptance criteria:
chat.startupplus CLI plugin-state access.src/state/openclaw-state-db.ts,src/plugin-state/plugin-state-store.sqlite.ts, and the gateway/task callers once the failing file owner is known.What I checked:
state/openclaw.sqlite, opens it withDatabaseSync, and runs schema setup before returning the cached handle. (src/state/openclaw-state-db.ts:695, ecb6779a1632)openOpenClawStateDatabase()and wraps failures asFailed to open the plugin state database, matching the reporter's CLI/plugin-state symptom. (src/plugin-state/plugin-state-store.sqlite.ts:328, ecb6779a1632)chat.startupstill calls the chat history handler, and task maintenance still logsFailed to list ACP sessions during task maintenancewhen ACP session listing fails. (src/gateway/server-methods/chat.ts:2520, ecb6779a1632)file is not a database,SQLITE_NOTADB,integrity_check, orquick_check. (ecb6779a1632)CHANGELOG.md:58, 2e08f0f4221f)docs/install/docker-vm-runtime.md. (docs/install/docker-vm-runtime.md:120, ecb6779a1632)Likely related people:
src/state/openclaw-state-db.ts,src/plugin-state/plugin-state-store.sqlite.ts,src/tasks/task-registry.store.sqlite.ts)CHANGELOG.md)CHANGELOG.md)CHANGELOG.md)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.AFabyTWE commentedon Jun 5, 2026
Some additional logs:
[openclaw] Could not start the CLI.
[openclaw] Reason: Failed to open the plugin state database. | file is not a database
[openclaw] Debug: set OPENCLAW_DEBUG=1 to include the stack trace.
[openclaw] Try: openclaw doctor
[openclaw] Help: openclaw --help
026-06-05T00:11:06.5067599Z stdout F 2026-06-05T00:11:06.506+00:00 [gateway] loading configuration…⚠️ Gateway is binding to a non-loopback address. Ensure authentication is configured before exposing to public networks.
2026-06-05T00:11:06.5803890Z stdout F 2026-06-05T00:11:06.580+00:00 [gateway] resolving authentication…
2026-06-05T00:11:06.5921474Z stdout F 2026-06-05T00:11:06.591+00:00 [gateway] starting...
2026-06-05T00:11:07.7801756Z stderr F 2026-06-05T00:11:07.779+00:00 [agents/subagent-registry] failed to restore subagent runs from disk: file is not a database
2026-06-05T00:11:07.8837775Z stdout F 2026-06-05T00:11:07.883+00:00 [gateway] starting HTTP server...
2026-06-05T00:11:07.8858027Z stderr F 2026-06-05T00:11:07.885+00:00 [gateway]
2026-06-05T00:11:07.9769123Z stderr F 2026-06-05T00:11:07.976+00:00 [tasks/registry] Failed to restore task registry
2026-06-05T00:11:07.9907109Z stdout F 2026-06-05T00:11:07.990+00:00 [health-monitor] started (interval: 300s, startup-grace: 60s, channel-connect-grace: 120s)
2026-06-05T00:11:10.3855876Z stdout F 2026-06-05T00:11:10.385+00:00 [gateway] agent model: prompt-security/claude-sonnet-4-6 (thinking=medium, fast=off)
2026-06-05T00:11:10.3866897Z stdout F 2026-06-05T00:11:10.386+00:00 [gateway] http server listening (9 plugins: browser, canvas, device-pair, diagnostics-otel, file-transfer, lossless-claw, memory-core, phone-control, talk-voice; 3.8s)
2026-06-05T00:11:10.3918274Z stdout F 2026-06-05T00:11:10.391+00:00 [gateway] log file: /tmp/openclaw/openclaw-2026-06-05.log
2026-06-05T00:11:10.3943582Z stdout F 2026-06-05T00:11:10.394+00:00 [gateway] starting channels and sidecars...
2026-06-05T00:11:10.6326412Z stdout F 2026-06-05T00:11:10.629+00:00 [plugins] diagnostics-otel: logs exporter enabled (OTLP/Protobuf)
2026-06-05T00:11:10.6408494Z stdout F 2026-06-05T00:11:10.640+00:00 [gateway] ready
2026-06-05T00:11:10.7347960Z stdout F 2026-06-05T00:11:10.734+00:00 [heartbeat] started
2026-06-05T00:11:10.8278575Z stderr F 2026-06-05T00:11:10.827+00:00 [gateway] Delivery recovery failed: Error: file is not a database
2026-06-05T00:11:11.2348377Z stderr F 2026-06-05T00:11:11.234+00:00 [plugins] memory-core: dreaming startup reconciliation failed: file is not a database
2026-06-05T00:11:11.9162028Z stderr F 2026-06-05T00:11:11.915+00:00 [cron] failed to start: Error: file is not a database
2026-06-05T00:11:12.0493023Z stderr F 2026-06-05T00:11:12.049+00:00 [gateway] Session delivery recovery failed: Error: file is not a database
2026-06-05T00:11:13.0237105Z stderr F 2026-06-05T00:11:13.023+00:00 [tasks/task-registry-maintenance] Failed to list ACP sessions during task maintenance
2026-06-05T00:11:14.4549970Z stdout F 2026-06-05T00:11:14.454+00:00 [gateway] provider auth state pre-warmed in 2504ms eventLoopMax=68.9ms
2026-06-05T00:11:20.6419568Z stdout F 2026-06-05T00:11:20.641+00:00 [gateway] agent runtime plugins pre-warmed in 5ms
AFabyTWE commentedon Jun 5, 2026
I found the issue. Openclaw running in Azure Container Apps leverages an Azure storage account for persistent storage mounted via NFS (for /home/node). Sqlite WAL is not supported on NFS shares. When you update the configuration for the container a new revision is spun up to replace the existing version. This can cause both revisions to use the database at the same time causing it to become corrupted.
There should be a safe way to deploy openclaw containers in environments like ACA that require an NFS mount for persistent storage.
For right now I have to stop the container completely and start it again when making changes in order to avoid data corruption.
fix(state): avoid sqlite wal on nfs state volumes
fix(state): avoid sqlite wal on nfs state volumes
fix(runtime): catch up openclaw upstream to d1b33a6 (openclaw#1733) (#99
fix(state): avoid sqlite wal on nfs state volumes