Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Summary
V2's V1 data migration fails on every service start with SQLiteError: near ",": syntax error, so legacy V1 session data is never imported into the V2 database.
Environment
- opencode version: 0.0.0-next-17055 (opencode2)
- OS: Darwin 25.2.0 (arm64)
- Terminal: TERM=xterm-256color, TERM_PROGRAM=ghostty, COLORTERM=truecolor
- Shell: /bin/zsh
- Install/channel: next (updated from 0.0.0-next-17028)
- Active plugins: none found in config
Reproduction
- Have a prior V1 (
opencode) install whose data exists under~/.local/share/opencode/storage/(andopencode.db). - Update/install the
nextchannel (e.g. 0.0.0-next-17028 → 0.0.0-next-17055) and startopencode2. - Observe the log:
timestamp=2026-08-09T01:20:47.672Z level=INFO run=d973732a message="updated OpenCode" from=0.0.0-next-17028 to=0.0.0-next-17055 method=bun role=cli
timestamp=2026-08-09T01:20:47.767Z level=INFO run=efe91eb9 message="database migration started" migration=20260808023530_workspace_domain role=server
timestamp=2026-08-09T01:20:47.787Z level=INFO run=efe91eb9 message="database migration completed" migration=20260808023530_workspace_domain durationMs=20 role=server
timestamp=2026-08-09T01:20:47.829Z level=ERROR run=efe91eb9 message="V1 migration failed" cause="Cause([Die(SQLiteError: near \",\": syntax error)])" role=server
The error repeats on every subsequent service start (each opencode2 serve --service boot logs another V1 migration failed with the same cause).
Expected Behavior
The V1 migration should run successfully and import legacy V1 sessions/messages into the V2 database, or fail with a meaningful error identifying the offending SQL.
Actual Behavior
The migration fails with SQLiteError: near ",": syntax error before any V1 data is imported. The failure is non-fatal — the service continues booting (watchers, location services, etc.) — but legacy V1 history is never migrated, and the error is logged on every service start.
Additional Context
- The regular V2 DB migrations succeed; only the V1 data migration fails. The failure began immediately after updating from 0.0.0-next-17028 to 0.0.0-next-17055.
- V1 data is present (user previously ran V1):
~/.local/share/opencode/storage/contains V1 dirs (session_diff,migration, etc.) and a legacyopencode.dbexists alongsideopencode-next.db. - The
near ","SQLite error suggests a malformed SQL statement is being generated for the migration (possibly related to the newworkspace_domainhandling). - Frequency: consistent, every service start.
- No workarounds found; the service remains otherwise healthy.
Activity
github-actions commentedon Aug 9, 2026
This issue might be a duplicate of existing issues. Please check:
SQLiteError: near ",": syntax erroron V1→V2 session migration — also triggered on every startup and includes a root cause analysis (undefinedfork_boundaryproducing invalid SQL) and a confirmed workaround.kitlangton commentedon Aug 11, 2026
Closing as an exact duplicate of #41341. Both reports hit the same previous-channel migration failure when the source
sessionschema lacksfork_boundary; follow-up and the fix should stay consolidated there.