Skip to content

disk I/O error on Windows network drive (Y: mapped drive, SMB share) #448

@xiaoyingv

Description

@xiaoyingv

Bug Report

CodeGraph version: 0.9.4 → 0.9.5
OS: Windows 11 Pro 10.0.26100
Node: v24.12.0
Working directory: mapped network drive (Y:\, SMB share)

Description

Running codegraph index or any MCP tool call consistently fails with:

Failed to open SQLite via the built-in node:sqlite module.
CodeGraph requires node:sqlite (Node.js 22.5+).
Underlying error: disk I/O error

Steps to Reproduce

  1. Open a project on a Windows mapped network drive (e.g., Y:\)
  2. Run codegraph init → succeeds
  3. Run codegraph index → fails with disk I/O error

Workaround

  1. Disconnect CodeGraph MCP server
  2. Delete .codegraph/codegraph.db, .db-shm, .db-wal, .lock
  3. Run codegraph init && codegraph index
  4. Reconnect MCP server

This workaround works initially, but the error can recur if the MCP server connection drops and restarts while the SQLite WAL lock is held on the network share.

Root Cause

SQLite's WAL mode relies on strict file locking (flock/fcntl) which is unreliable over SMB/CIFS network shares. The .db-shm (shared memory) file in particular doesn't behave correctly on network filesystems.

Environment Details

Working directory: Y:\ → mapped network drive (SMB)
npm global: C:\Users\<user>\AppData\Roaming\npm
codegraph: 0.9.5 (via npm i -g @colbymchenry/codegraph)
codegraph status output:
- Backend: node:sqlite (Node built-in) — full WAL + FTS5
- Journal mode: wal (concurrent reads safe)
- Files indexed: 372, Nodes: 5234, Edges: 8559
- DB size: 9.51 MB

Suggestion

Consider adding an option to use SQLite in non-WAL journal mode (DELETE or TRUNCATE) when the project is detected on a network drive, or allow the user to configure the journal mode. This would trade some concurrent-read performance for compatibility with network filesystems.

Related: #238 (database is locked on concurrent access)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions