Description
If you run opencode locally and in docker and share ~/.local/share/opencode/, ~/.local/state/opencode/ and ~/.config/opencode/ with the container it will lead to sqlite corruption if you try to run two sessions at the same time:
┃ 588 | session_id: sessionID,
589 | time_created,
590 | data, GitHub Copilot
591 | })▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
592 | .onConflictDoUpdate({ target: MessageTable.id, set: { data } }) ctrl+t variants tab agents ctrl+p commands
593 | .run()
^
SQLiteError: database disk image is malformed
errno: 11,
byteOffset: -1,
code: "SQLITE_CORRUPT"
at #run (bun:sqlite:185:20)
at <anonymous> (src/session/index.ts:593:10)
at run (node:async_hooks:62:22)
at use (src/storage/db.ts:111:28)
at <anonymous> (src/session/index.ts:584:14)
at process (src/session/processor.ts:411:25)
Plugins
No response
OpenCode version
No response
Steps to reproduce
- Run opencode session locally
- Run another opencode session in Docker container with
-v "$HOME/.local/state/opencode:/home/node/.local/state/opencode" \
-v "$HOME/.local/share/opencode:/home/node/.local/share/opencode" \
-v "$HOME/.config/opencode:/home/node/.config/opencode" \
- Start agent session (e.g. ask it to review the codebase)
Screenshot and/or share link
It crashes immediately when the next session starts
https://opncd.ai/share/fbRFgNq0
Operating System
macOS 15.7.4
Terminal
iTerm
Description
If you run opencode locally and in docker and share
~/.local/share/opencode/,~/.local/state/opencode/and~/.config/opencode/with the container it will lead to sqlite corruption if you try to run two sessions at the same time:Plugins
No response
OpenCode version
No response
Steps to reproduce
Screenshot and/or share link
It crashes immediately when the next session starts
https://opncd.ai/share/fbRFgNq0
Operating System
macOS 15.7.4
Terminal
iTerm