GeezerVison is showing github.com — Concurrent opencode processes on one database fail prompts with "Failed to execute statement" (SQLITE_BUSY) · Issue #47566 · anomalyco/opencode
Concurrent opencode processes on one database fail prompts with "Failed to execute statement" (SQLITE_BUSY) #47566
Description
Description
Running several opencode processes against the same shared data directory makes them contend for the single SQLite write lock. Statements that wait longer than busy_timeout (5s) fail with database is locked and the error propagates as "Failed to execute statement" / "Unexpected server error", killing the whole prompt even though the statement itself is fine and would succeed on retry.
Observed on a busy VM with ~10 concurrent sessions sharing one opencode.db: 43 lock failures in one day, at Session.updateMessage, createUserMessage, and cleanup paths.
Steps to reproduce
- Start multiple long-running opencode sessions writing to the same
opencode.db (WAL mode)
- Prompt them concurrently under enough IO/CPU load that some writes exceed 5s
- Watch server log for
SqlError/LockTimeoutError: database is locked and failed prompts
OpenCode version
1.18.29
Reacted by Nathan Clonts, Ian Qvist and Snowdon Dev
Activity
github-actions commented on Sep 6, 2026
This issue might be a duplicate of existing issues. Please check:
woodsonl commented on Sep 6, 2026
Opened #47567 for the mid-session write path (retry SQLITE_BUSY with backoff in both drivers). Complements #44558, which covers init/migrations — that PR explicitly leaves these runtime failures open. Happy to close or rework #47567 if the fix is being handled differently.
thdxr commented on Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
Metadata
Metadata
Development
No branches or pull requestsIssue actions