GeezerVison is showing github.com — [BUG]: Error: no such column: name · Issue #31119 · anomalyco/opencode
[BUG]: Error: no such column: name #31119DescriptionDescription
Background
I haven't used Opencode in some time and coming back to I was asked to update the version. I updated the version and now the app is no longer letting me use it. I receive the image I have provided.
Plugins
No response
OpenCode version
1.16.2
Steps to reproduce
- open opencode running version 1.16.2
Screenshot and/or share link
Operating System
Windows 11
Terminal
Windows Terminal Reacted by xelemorf, Thibaut Rousseau, Rahmat Sunjani, Ali Hatem, zifiii, Tan Zi Yang, Yaroslav Novikov, ard1102, Luo Chen, QuartzOrange and 9 more Activitygithub-actions commented on Jun 6, 2026 This issue might be a duplicate of existing issues. Please check:
hguilla commented on Jun 7, 2026 Removing ~/.local/share/opencode/opencode.db solved the issue for me, though I don't care for any previous sessions or data that could have been lost by this. Otherwise, it seems to be related to the issue mentioned and there's a PR with a fix Reacted by Marie Edcel Balite, xelemorf, AndrewShear, 0xKyle, Michel Boucey, Florent Teyssou, Yuqian Zhang, Trevor Allen, ropepop, Ali Hatem and 29 more baoanhng commented on Jun 11, 2026 If on Windows, access %USERPROFILE%\.local\share\ and delete the opencode folder. Reacted by Marek Brož, YuuAnnooo, Xiao-Yamin, Miguel Ángel YAPIAS VELI, conetyon, Branimir Rijavec, JustChenk, KN94, MoshiLL, Andrei Ilievici and 9 more ZiFy commented on Jun 18, 2026 Reacted by Dirty Mike And The Boys conetyon commented on Jun 19, 2026
如果是Windows,访问并删除opencode文件夹。%USERPROFILE%\.local\share\
这个好使 optimasupport commented on Jun 20, 2026 How to Fix OpenCode Error: no such column: name (#31119) – Windows Solution
If you're encountering the following error in OpenCode:
Error: no such column: name
#31119
You can resolve it by resetting the local OpenCode data folder.
Solution (Windows)
Press Windows + R.
Enter the following path and press Enter:
%USERPROFILE%.local\share
Delete the opencode folder.
Restart OpenCode.
After restarting, OpenCode should recreate the required files and the error should be resolved.
 sapwavino commented on Jun 20, 2026
same problem on macOS
Any solutions yet? a-n-d-a-i commented on Jun 24, 2026 Same issue when running as my agent user with sudo su (or via machinectl), or via SSH.
Could not run opencode (the cli) nor opencode web.
opencode caused a systemd coredump, while the web command crashed immediately with the error described in the first post of this issue thread.
Deleting ~/.local/share/opencode/opencode.db solved it for me. ssg135 commented on Jul 3, 2026
Same issue when running as my agent user with sudo su (or via machinectl), or via SSH.
Could not run opencode (the cli) nor opencode web.
opencode caused a systemd coredump, while the web command crashed immediately with the error described in the first post of this issue thread.
Deleting ~/.local/share/opencode/opencode.db solved it for me.
Thank you, your method works on Ubuntu 20.04. kde2podfreebsd commented on Jul 6, 2026 If u have mac, try this, thats helped for me.
- Close opencode
- Find database file: for example
~/.local/share/opencode/opencode.db
mv ~/.local/share/opencode/opencode.db ~/.local/share/opencode/opencode.db.bak
- Reopen OpenCode - on open opencode create database with right struct and all will work fine
Reacted by Andrea Raccagni and Barış Gökmen MoshiLL commented on Jul 17, 2026
If on Windows, access %USERPROFILE%\.local\sha
it's useful, thanks shawnboutilier-tech commented on Jul 17, 2026 Any solutions that do not nuke the session DB? I want to continue my sessions. Any SQLite queries I could run? tianhuil commented on Jul 17, 2026 simonliska commented on Jul 21, 2026
Any solutions that do not nuke the session DB? I want to continue my sessions. Any SQLite queries I could run?
There are multiple PRs open to fully fix the issue, #37707 , #34188 and the closed one #31121.
For session and message table you can follow manual migration:
mv ~/.local/share/opencode/opencode.db ~/.local/share/opencode/opencode.db.bak
- Open/close Opencode to create new DB.
- Connect to DB:
sqlite3 ~/.local/share/opencode/opencode.db
- Check the ID for the project in the old and the new DB (for me it changed):
SELECT id, worktree, name FROM project;
- Attach old DB:
ATTACH DATABASE '.local/share/opencode/opencode.db.bak' AS old;
- Import the sessions (replace project IDs):
INSERT INTO session (
id, project_id, workspace_id, parent_id, slug, directory, path, title, version, share_url,
summary_additions, summary_deletions, summary_files, summary_diffs, metadata,
cost, tokens_input, tokens_output, tokens_reasoning, tokens_cache_read, tokens_cache_write,
revert, permission, agent, model, time_created, time_updated, time_compacting, time_archived
)
SELECT
s.id,
'<NEW_PROJECT_ID>',
NULL, s.parent_id, s.slug, s.directory, NULL, s.title, s.version, s.share_url,
s.summary_additions, s.summary_deletions, s.summary_files, s.summary_diffs, NULL,
0, 0, 0, 0, 0, 0,
s.revert, s.permission, NULL, NULL, s.time_created, s.time_updated, s.time_compacting, s.time_archived
FROM old.session s
WHERE s.project_id = '<OLD_PROJECT_ID>';
- Import messages (replace project ID):
INSERT INTO message
SELECT m.* FROM old.message m
WHERE m.session_id IN (
SELECT id FROM old.session WHERE project_id = '<OLD_PROJECT_ID>'
);
INSERT INTO part
SELECT p.* FROM old.part p
WHERE p.session_id IN (
SELECT id FROM old.session WHERE project_id = '<OLD_PROJECT_ID>'
);
- You should see sessions and messages restored
- If you need other tables you need to migrate them
builderjackm commented on Aug 6, 2026 Still reproducible on 1.18.14 (desktop, Electron build) on Windows 11, upgrading from a ~Feb 2026 version.
Diagnostics from the exported debug bundle:
renderer.log: fatal renderer error: Error: no such column: name (at oc://renderer/index.html)
utility.log: sidecar exited { code: 1 } — the server process dies immediately on startup, so the renderer has no backend
main.log: gets as far as spawning sidecar / awaiting server ready, then nothing
State of the old database (~/.local/share/opencode/opencode.db):
__drizzle_migrations contains only 3 rows, latest created_at = 2026-02-13
migration table is empty
- So the migration path from that era's schema to current appears to be broken — the server queries a
name column that doesn't exist yet and exits
Workaround that worked: delete (or rename) ~/.local/share/opencode/opencode.db and let the app recreate it on next launch. Session history is lost unless manually migrated via the SQL steps above.
Happy to provide the full debug zip if useful. alexnotes commented on Aug 6, 2026 for Mac:
- mv ~/.local/share/opencode ~/.local/share/opencode_bak
- rm -rf ~/.local/share/opencode
- restart opencode
Reacted by Mohammad R. Rashid Mohammad-R-Rashid commented on Aug 17, 2026 @alexnotes solution worked on my mac. Issue still exists in the latest update of open code as of Aug 16, 2026. bgzo commented on Aug 22, 2026 Run this DDL:
DROP TABLE IF EXISTS workspace;
CREATE TABLE `workspace` (
`id` text PRIMARY KEY,
`type` text NOT NULL,
`name` text DEFAULT '' NOT NULL,
`branch` text,
`directory` text,
`extra` text,
`project_id` text NOT NULL,
`time_used` integer NOT NULL,
CONSTRAINT `fk_workspace_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON
DELETE
CASCADE
);thdxr commented on Oct 11, 2026 Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|