GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SQLiteError: locking protocol - Cannot run multiple opencode processes simultaneously · Issue #15188 · anomalyco/opencode

SQLiteError: locking protocol - Cannot run multiple opencode processes simultaneously #15188

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
SQLiteError: locking protocol - Cannot run multiple opencode processes simultaneously#15188
Copy link
Assignees
jlongster

Description

@shoa-lin
shoa-lin
opened on Feb 26, 2026
Issue body actions

Description

Problem

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

  1. 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)
Reacted by Emerson Gomes and licheng-xz
Reacted by Denis Zaitsev

Activity

  1. shoa-lin
    added
    bugSomething isn't working
    on Feb 26, 2026
  2. github-actions
    assigned
    thdxr
    on Feb 26, 2026
  3. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    windows
    on Feb 26, 2026
  4. github-actions commented on Feb 26, 2026

    @github-actions
    github-actionsBot
    on Feb 26, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • cannot start 2 & more opencode terminal on win wsl1 #14425: Same SQLiteError: locking protocol error when starting multiple opencode instances on WSL 1
    • SQLite database corruption (database disk image is malformed) when running concurrent sessions on NFS #14970: Related SQLite database locking/concurrency issue (NFS context, but same root cause)

    If your issue is distinct or not addressed by the above, please add a comment explaining the difference.

  5. thdxr
    assigned
    jlongster
    and unassigned
    thdxr
    on Apr 26, 2026
  6. thdxr
    removed
    bugSomething isn't working
    windows
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  7. github-actions commented on Jul 4, 2026

    @github-actions
    github-actionsBot
    on Jul 4, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  8. github-actions
    closed this as not plannedon Jul 4, 2026
  9. oldantique commented on Jul 11, 2026

    @oldantique
    oldantique
    on Jul 11, 2026
    More actions

    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:

    d=$(mktemp -d)
    mkdir -p "$d/share/opencode"
    cp ~/.local/share/opencode/auth.json "$d/share/opencode/" 2>/dev/null || true
    XDG_DATA_HOME="$d/share" XDG_STATE_HOME="$d/state" opencode run "your prompt"
    rm -rf "$d"

    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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jlongster
    jlongster

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402792 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.