Repository navigation
Description
Summary
On every opencode2 startup, the server logs V1 migration failed with SQLiteError: near ",": syntax error while running the V1→V2 database migration. The service still starts and is usable, but the V1 migration never completes, so legacy data is presumably never migrated.
Environment
- opencode version: 0.0.0-next-17403
- OS: Linux 5.15.153.1-microsoft-standard-WSL2 (linux x64)
- Terminal: TERM=xterm-256color, COLORTERM=truecolor
- Shell: /bin/bash
- Install/channel: next
- Active plugins: herdr-agent-state.js (global,
~/.config/opencode/plugins/), herdr-tui-session.js (viatui.jsoncpluginentry)
Reproduction
- Have an existing install with a pre-V2 SQLite database (upgraded in place from a V1-era version).
- Start
opencode2(or let the background service start). - Observe the server log.
Expected Behavior
The V1→V2 migration runs successfully (or reports a meaningful, actionable failure).
Actual Behavior
The server logs an unhelpful SQL syntax error from the V1 migration path on every startup:
timestamp=2026-08-28T03:49:52.550Z level=ERROR run=7882e373 message="V1 migration failed" cause="Cause([Die(SQLiteError: near \",\": syntax error)])" role=server
This has occurred on three separate startups (2026-08-15 14:02, 2026-08-15 18:36, 2026-08-28 03:49), i.e. it is consistent and not transient. The built-in Drizzle migrations before it (20260811161259_execution_claim_attempts, 20260812181746_session_inbox, 20260812213948_worktree) all complete successfully in milliseconds, so the failure is specific to the V1 migration step, which appears to generate malformed SQL (a stray comma).
Additional Context
- The failure occurs before any project copy refresh, every time the background service starts.
- The client still connects and sessions work; the visible impact is the failed V1 migration (legacy data not migrated) plus the recurring ERROR log.
- Searched existing issues: opencode2 service startup fails while V1 migration scans a large SQLite database #41739 hits the same V1 migration code path but fails differently (large-DB stall /
database is locked), and server: V1 data migration fails with SQLite syntax error on every start #41346 is referenced there as distinct. I did not find a report of thenear ",": syntax errorvariant. - All config files (
opencode.json,tui.json,tui.jsonc,cli.json,service.json) parse as valid JSON, ruling out config syntax as the cause. - Log file:
~/.local/share/opencode/log/opencode.log - Version detail: client started with
version=0.0.0-next-17403 channel=next, an update check found0.0.0-beta-18414available (automatic update skipped: installation method not found).
Activity
github-actions commentedon Aug 28, 2026
This issue might be a duplicate of existing issues. Please check:
SQLiteError: near ",": syntax errorin V1 migration on every startup (now closed, but the fix may not have landed in thenextchannel build you are running)opencode-next.dbschemas missing columns expected by the current importer, causing empty SQL interpolation and thenear ","parse errorYour report is consistent with the root cause described in #43139. If #41346 was closed as fixed, it may not yet be present in
0.0.0-next-17403.MilkyWay008 commentedon Aug 28, 2026
Ran into the same
near ",": syntax erroron the V1 migration path with the next channel a few days ago, it's the importer building SQL from an empty column list when the oldopencode-next.dbschema is missing fields the V1 importer expects, #41346 had the same error and got closed fixed but the fix hasn't landed in the build you're on. Two ways out: update past0.0.0-next-17403(0.0.0-beta-18414 is out) since the auto-updater skips with "installation method not found" on manual installs, or if you don't care about the legacy session data, back up~/.local/share/opencode/opencode-next.dband move it aside so the migration is skipped entirely. Either way keep a copy of that DB before you touch it, that file is the only thing holding the old sessions.rekram1-node commentedon Oct 21, 2026
Fixed by #43142, which landed after the
0.0.0-next-17403build this was reported on. Please reopen if you still seenear ","on a current 2.x build.