You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to run a second opencode process while one is already running, the following error occurs:
SQLiteError: locking protocol
at run (unknown)
at run (bun:sqlite:322:21)
at (src/storage/db.ts:73:12)
Root Cause
OpenCode uses a single global SQLite database (~/.local/share/opencode/opencode.db) to store state for ALL projects. This design prevents multiple opencode instances from running concurrently, as SQLite requires exclusive access for write operations.
~/.local/share/opencode/
├── opencode.db ← 990MB, shared by all processes
├── opencode.db-wal ← WAL mode enabled (but still single-writer)
└── opencode.db-shm
Impact
Cannot work on multiple projects simultaneously in separate terminals
WSL 1 users are particularly affected due to incomplete file locking protocol support
Even on normal systems, SQLite's single-writer limitation blocks concurrent use
Environment
OS: WSL 1 (Linux 4.4.0-26100-Microsoft)
OpenCode version: latest
Database: SQLite with WAL mode enabled
Plugins
oh my opencode
OpenCode version
1.2.14
Steps to reproduce
Open a terminal and start opencode in any project:
cd~/project-a
opencode
2. Open a second terminal (while first opencode is still running) and start opencode in any directory:
cd~/another-project # or even same directory
opencode
3. The second opencode instance will immediately crash with: SQLiteError: locking protocol
Expected: Both opencode instances should run without conflict
Actual: Second instance fails with locking protocol error
### Screenshot and/or share link
_No response_
### Operating System
WSL 1 on Windows 11
### Terminal
Windows Terminal(Powershell)
For anyone landing here from the SQLiteError: locking protocol message: I posted a workaround in #14970 that has held up under 8-way parallel runs — give each process its own data dir so they stop sharing the global DB:
Config and the models cache stay shared, so there's no re-auth/re-fetch cost. Only fits parallel one-shot runs (--continue won't see sessions written to the throwaway dir). Details and caveats: #14970 (comment)
Activity
github-actions commentedon Feb 26, 2026
This issue might be a duplicate of existing issues. Please check:
SQLiteError: locking protocolerror when starting multiple opencode instances on WSL 1If your issue is distinct or not addressed by the above, please add a comment explaining the difference.
github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
oldantique commentedon Jul 11, 2026
For anyone landing here from the
SQLiteError: locking protocolmessage: I posted a workaround in #14970 that has held up under 8-way parallel runs — give each process its own data dir so they stop sharing the global DB:Config and the models cache stay shared, so there's no re-auth/re-fetch cost. Only fits parallel one-shot runs (
--continuewon't see sessions written to the throwaway dir). Details and caveats: #14970 (comment)