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 — [sqlite] duplicate column name: cost migration error when upgrading from v1.14.41 to v1.17.11 · Issue #34584 · anomalyco/opencode

[sqlite] duplicate column name: cost migration error when upgrading from v1.14.41 to v1.17.11 #34584

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
[sqlite] duplicate column name: cost migration error when upgrading from v1.14.41 to v1.17.11#34584
Copy link
Assignees
kitlangton

Description

@Mr-j-yangyu
Mr-j-yangyu
opened on Jun 30, 2026
Issue body actions

Description

I upgraded OpenCode from v1.14.41 to v1.17.11. Upon starting the container (using opencode serve --port 4096 --hostname 0.0.0.0), the application crashes during startup with the following error:

2026-06-30T13:35:31.315099944+08:00 Error: Unexpected error  
2026-06-30T13:35:31.315224249+08:00
2026-06-30T13:35:31.315250727+08:00 duplicate column name: cost

The service is running in a Docker container, with the entrypoint:

ENTRYPOINT ["/usr/bin/tini", "--"] 
CMD ["opencode", "serve", "--port", "4096", "--hostname", "0.0.0.0"]

Plugins

No response

OpenCode version

v1.14.41

Steps to reproduce

To Reproduce

  1. Previously had OpenCode v1.14.41 running with persisted data (likely in a mounted volume, e.g., ~/.local/share/opencode).
  2. Upgraded the container image to v1.17.11.
  3. Restarted the container with the same persistent data volume.
  4. The startup process attempts to perform a schema migration and fails with duplicate column name: cost.

Expected behavior

The migration should handle existing columns gracefully (e.g., check if column exists before adding) and complete successfully, preserving all historical data. The server should start normally.

Actual behavior

The migration fails, and the server exits with an error, preventing startup.

Possible Cause

The migration script tries to ALTER TABLE ADD COLUMN cost on a table that already contains a cost column. This can happen if:

  • The database schema from v1.14.41 already had a cost column, but the migration logic in v1.17.11 does not check for its existence before adding.
  • The migration is re‑executed on an already partially migrated database.

Workaround Attempted

I temporarily resolved this by deleting the database files (~/.local/share/opencode/opencode.db*) and letting the server recreate them, but this loses all historical session data. I would prefer a solution that preserves my data.

Environment

  • Deployment: Docker container
  • OpenCode Version (upgraded): v1.17.11
  • OpenCode Version (previous): v1.14.41
  • Persistent data path: /root/.local/share/opencode/ (or custom mount) – the database is SQLite.
  • Start command: opencode serve --port 4096 --hostname 0.0.0.0

Additional Context

  • The cost column appears to be related to session cost tracking.
  • I can provide more logs or test a patch if needed.

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions
    assigned
    kitlangton
    on Jun 30, 2026
  2. github-actions commented on Aug 30, 2026

    @github-actions
    github-actionsBot
    on Aug 30, 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.

  3. github-actions
    closed this as not plannedon Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kitlangton
    kitlangton

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 01402775 — 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.