nix build fails because it tries to access models.dev #7841

Closed
opened 2026-02-16 18:08:26 -05:00 by yindo · 2 comments
Owner

Originally created by @Profpatsch on GitHub (Jan 28, 2026).

Originally assigned to: @thdxr on GitHub.

Description

Nix builds are sandboxed from the network, so they are not allowed to access domains.

End of build log:

error: builder for '/nix/store/4214c1mny2r91n92lp0v0x9hmgg56mv4-opencode-1.1.39-8798a77.drv' failed with exit code 2;
       last 25 log lines:
       > shrinking RPATHs of ELF executables and libraries in /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77
       > shrinking /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77/bin/.opencode-wrapped
       > shrinking /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77/bin/opencode
       > checking for references to /build/ in /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77...
       > patching script interpreter paths in /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77
       > Running phase: installCheckPhase
       > Executing versionCheckPhase
       > Did not find version 1.1.39-8798a77 in the output of the command /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77/bin/opencode --version
       > ERROR 2026-01-28T11:19:33 +452ms service=models.dev error=Unable to connect. Is the computer able to access the url? Failed to fetch models.dev
       > 168 |         return wa();
       > 169 |       });
       > 170 |     }
       > 171 |     function za(a) {
       > 172 |       for (;0 < a.length; )
       > 173 |         a.shift()(h);
       >                       ^
       > RuntimeError: access to a null reference (evaluating 'a6.shift()(h2)')
       >       at za (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:173:17)
       >       at a6 (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:1325:11)
       >       at Mb (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:1347:18)
       >       at Lb (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:1319:13)
       >       at a6 (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:1265:90)
       >       at b2 (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:1268:9)
       >
       > Bun v1.3.6 (Linux x64)
       For full logs, run 'nix log /nix/store/4214c1mny2r91n92lp0v0x9hmgg56mv4-opencode-1.1.39-8798a77.drv'.

Plugins

OpenCode version

1.1.39-8798a77

Steps to reproduce

nix run github:anomalyco/opencode

Screenshot and/or share link

No response

Operating System

NixOS

Terminal

No response

Originally created by @Profpatsch on GitHub (Jan 28, 2026). Originally assigned to: @thdxr on GitHub. ### Description Nix builds are sandboxed from the network, so they are not allowed to access domains. End of build log: ``` error: builder for '/nix/store/4214c1mny2r91n92lp0v0x9hmgg56mv4-opencode-1.1.39-8798a77.drv' failed with exit code 2; last 25 log lines: > shrinking RPATHs of ELF executables and libraries in /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77 > shrinking /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77/bin/.opencode-wrapped > shrinking /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77/bin/opencode > checking for references to /build/ in /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77... > patching script interpreter paths in /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77 > Running phase: installCheckPhase > Executing versionCheckPhase > Did not find version 1.1.39-8798a77 in the output of the command /nix/store/4agjsq8ysqp3padifp7xrhryxv46hjrx-opencode-1.1.39-8798a77/bin/opencode --version > ERROR 2026-01-28T11:19:33 +452ms service=models.dev error=Unable to connect. Is the computer able to access the url? Failed to fetch models.dev > 168 | return wa(); > 169 | }); > 170 | } > 171 | function za(a) { > 172 | for (;0 < a.length; ) > 173 | a.shift()(h); > ^ > RuntimeError: access to a null reference (evaluating 'a6.shift()(h2)') > at za (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:173:17) > at a6 (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:1325:11) > at Mb (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:1347:18) > at Lb (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:1319:13) > at a6 (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:1265:90) > at b2 (../../node_modules/.bun/@opentui+core@0.1.75+81ecd8642a1892ca/node_modules/@opentui/core/index-s0q9547t.js:1268:9) > > Bun v1.3.6 (Linux x64) For full logs, run 'nix log /nix/store/4214c1mny2r91n92lp0v0x9hmgg56mv4-opencode-1.1.39-8798a77.drv'. ``` ### Plugins - ### OpenCode version 1.1.39-8798a77 ### Steps to reproduce nix run github:anomalyco/opencode ### Screenshot and/or share link _No response_ ### Operating System NixOS ### Terminal _No response_
yindo added the bugnix labels 2026-02-16 18:08:26 -05:00
yindo closed this issue 2026-02-16 18:08:26 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #10429: Nix build fails: build.ts fetches from network instead of using MODELS_DEV_API_JSON (this was previously closed and addressed the exact same problem)
  • #8860: loading models.dev in built artifacts (related issue about handling models.dev in restricted network environments)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 28, 2026): This issue might be a duplicate of existing issues. Please check: - #10429: Nix build fails: build.ts fetches from network instead of using MODELS_DEV_API_JSON (this was previously closed and addressed the exact same problem) - #8860: loading models.dev in built artifacts (related issue about handling models.dev in restricted network environments) Feel free to ignore if none of these address your specific case.
Author
Owner

@Profpatsch commented on GitHub (Jan 28, 2026):

Huh, I tried again and it worked. Weird. Maybe a caching problem?

@Profpatsch commented on GitHub (Jan 28, 2026): Huh, I tried again and it worked. Weird. Maybe a caching problem?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7841