Skip to content

[Bug]: Updating opencode@2 to 2.2.5 fails due to hash mismatch #3040

Closed

Description

@redtux

What happened?

Hi, updating opencode@2 to 2.2.5 fails due to hash mismatch (both globally and locally).

  • Devbox: Version 0.19.0
  • Distro: Debian GNU/Linux 13 (trixie)
  • Kernel: Linux 7.1.8+deb13-amd64

Steps to reproduce

  1. devbox global add opencode@2.2.1
  2. devbox global update opencode@2.2.5

Command

update

devbox.json

Devbox version

0.19.0

Nix version

2.26.3

What system does this bug occur on?

Linux (x86-64)

Debug logs

$ devbox global update opencode@latest
Info: Updating opencode@latest 2.2.1 -> 2.2.5
Info: Installing the following packages to the nix store: opencode@latest
error: hash mismatch in fixed-output derivation '/nix/store/kfdz406fa44wmh8bgiq2d7nnbxa19f0f-opencode-node_modules-2.2.5.drv':
         specified: sha256-xfOVcw1+waLVNhFDwzOtzxrUSQEogvn88YomydOlhwc=
            got:    sha256-prx9dX7kUvs/E3zopkaPk5LXh3xJAy5sZeum/W8L7cA=
error: 1 dependencies of derivation '/nix/store/3yj9jzx7j7rgphgw3vfgb4llhiv8i5yc-opencode-2.2.5.drv' failed to build
Error: nix: command error: nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' build --impure --no-link --refresh 'github:NixOS/nixpkgs/9a6cbf4722bdbbef65f9e0400452ca088e31dc4b#opencode': exit code 1

Error: There was an internal error. Run with DEVBOX_DEBUG=1 for a detailed error message, and consider reporting it at https://github.com/jetify-com/devbox/issues

(Normal logs, as the debug is quite long and does not show anything special.)

Activity

  1. added
    bugSomething isn't working
    triageIssue needs triage
    on Nov 3, 2026
  2. redtux commented on Nov 4, 2026

    @redtux
    Author

    Hmm, was https://www.nixhub.io/packages/opencode recently changed? 🤔

    Version 2 is not available anymore. Or was it never available? This would explain why the package was built manually.

    I just tried updating on another system, and there I am getting Error: opencode@2: package not found now.

  3. redtux commented on Nov 4, 2026

    @redtux
    Author

    Found the root cause — this is not a devbox code bug, but devbox's package catalog currently points opencode 2.2.5 at a nixpkgs rev that contains a packaging regression.

    • The nixpkgs rev that devbox update resolves for opencode@2 (via https://www.nixsearch.com/v2/resolve?name=opencode&version=2, per-system rev: 9d3b8db48266c17be0b5f9c6360c3ecfbac3d1f5, last_updated 2026-11-03T19:55:20Z) packages the opencode-node_modules-2.2.5 fixed-output derivation with a single outputHash = sha256-xfOVcw1+waLVNhFDwzOtzxrUSQEogvn88YomydOlhwc=.
    • That hash was evidently computed on macOS: on any Linux host the (fully deterministic, --frozen-lockfile) bun install produces sha256-prx9dX7kUvs/E3zopkaPk5LXh3xJAy5sZeum/W8L7cA=, hence the mismatch on every Linux machine. Hydra never built Linux binaries for it, so there's no substitution fallback.
    • This is already fixed on nixpkgs master in NixOS/nixpkgs@c399e1b ("opencode: fix hash", Nov 4 — see Build failure: opencode NixOS/nixpkgs#582673), which makes outputHash per-platform — and the Linux value there is exactly the prx9dX7… hash we observe.
    • Suggested devbox-side fix: refresh the nixsearch record for opencode 2.2.5 so its nixpkgs rev includes the above commit; then devbox update opencode@2 works again on Linux.
  4. added a commit that references this issue on Nov 4, 2026
  5. redtux commented on Nov 9, 2026

    @redtux
    Author

    Hi @mikeland73, sorry for tagging but you seem to be the most active dev here. 😺

    Any chance to get this merged? Upstream fixed this five days ago, so I guess that you just need to poll it.

    I couldn't find any public nixsearch/nixhub catalog repo, otherwise I would have created a PR to get this fixed. Thanks for your help!

  6. mikeland73 commented on Nov 9, 2026

    @mikeland73
    Collaborator

    This should be fixed now. devbox resolved opencode 2.2.5 to nixpkgs 9a6cbf47, which still had the broken node_modules hash. The upstream fix (NixOS/nixpkgs@c399e1b7) kept the version at 2.2.5, and the search index picked it up on Nov 6: opencode@2.2.5 now resolves to 4fe25e12, which has the corrected hash. Please re-run devbox global update opencode and let us know if it still fails.

    The index is open source at https://github.com/mikeland73/devbox-search if you want to file issues or PRs there.


    Written by Claude on behalf of / prompted by @mikeland73.

  7. redtux commented on Nov 10, 2026

    @redtux
    Author

    Thanks @mikeland73, this worked! And great that there is a public devbox-search repo, I had missed it. Thank you for the hint!

    What needs to be done to get V2 published/listed on https://www.nixhub.io/packages/opencode?

  8. mikeland73 commented on Nov 10, 2026

    @mikeland73
    Collaborator

    devbox is no longer using the nixhub back end (which is closed source). You can use https://www.nixsearch.com/search?q=opencode which shares the same search as devbox (that site uses the source code from the devbox-search repo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions