devbox icon indicating copy to clipboard operation
devbox copied to clipboard

[Bug]: Unable to run devbox shell

Open PerttyZhan opened this issue 2 years ago • 7 comments

Current Behavior (bug) Run devbox shell is failing, wating for long time, finally report an error

Expected Behavior (fix) Run devbox shell success

Additional context devbox version -v

Version:     0.8.2
Platform:    darwin_arm64
Commit:      33ea788cb4dbf6958208669c9e4df9c1e858ad2c
Commit Time: 2023-11-15T00:23:52Z
Go Version:  go1.21.3
Launcher:    0.2.0

devbox.json`

{
  "packages": [
    "nodejs@latest",
    "yarn@latest"
  ],
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}

PerttyZhan avatar Dec 04 '23 01:12 PerttyZhan

Run devbox shell error:

Error: Command: /nix/var/nix/profiles/default/bin/nix print-dev-env /Users/zhanheng/workspace/my/wzjxbz-master/.devbox/gen/flake --extra-experimental-features ca-derivations --option experimental-features nix-command flakes fetch-closure --json: exit status 1

PerttyZhan avatar Dec 04 '23 01:12 PerttyZhan

@PerttyZhan could you do export DEVBOX_DEBUG=1, re-run devbox shell, and then share the output please?

savil avatar Dec 04 '23 13:12 savil

@PerttyZhan could you do export DEVBOX_DEBUG=1, re-run devbox shell, and then share the output please?

thank. when i run again, It actually worked but when i download new package, it worked Fail frequently

PerttyZhan avatar Dec 05 '23 01:12 PerttyZhan

run devbox add [email protected] expect success but download fail

2023/12/05 09:12:14 findProjectDir: path is 
2023/12/05 09:12:14 finding devbox.json in dir: /Users/zhanheng/workspace/my/wzjxbz-master
2023/12/05 09:12:14 findProjectDir: path is 
2023/12/05 09:12:14 finding devbox.json in dir: /Users/zhanheng/workspace/my/wzjxbz-master
2023/12/05 09:12:14 findProjectDir: path is 
2023/12/05 09:12:14 finding devbox.json in dir: /Users/zhanheng/workspace/my/wzjxbz-master
Info: Adding package "[email protected]" to devbox.json

Installing package: [email protected].

[1/1] [email protected]
2023/12/05 09:12:22 running command: /nix/var/nix/profiles/default/bin/nix profile install --profile /Users/zhanheng/workspace/my/wzjxbz-master/.devbox/nix/profile/default --impure --priority 9 /nix/store/kck9cmbg0z35vv7vz1vdz02003cs6092-vim-8.2.3451 --extra-experimental-features ca-derivations --option experimental-features nix-command flakes fetch-closure
warning: error: unable to download 'https://cache.nixos.org/kck9cmbg0z35vv7vz1vdz02003cs6092.narinfo': Timeout was reached (28); retrying in 255 ms
querying vim-8.2.3451 on https://cache.nixos.org

PerttyZhan avatar Dec 05 '23 01:12 PerttyZhan

This looks like maybe a network issue trying to download from the cache, but I'll try to reproduce and see if it's something else.

Lagoja avatar Dec 05 '23 20:12 Lagoja

That vim package installed ok for me, so I think it's probably a network issue. We should tweak the error message to explain when this is the case, so that it's clearer what's happening.

Lagoja avatar Dec 05 '23 20:12 Lagoja

@PerttyZhan thanks for sharing that. For clarity:

  1. Are all the errors you are seeing having to do with downloading the .narinfo from the nix cache? Or are there other kinds of errors as well?
  2. Does this error block you? My understanding is that the devbox shell should still start up (but may be slower since it cannot use the cache), but I could be wrong.
  3. If you are comfortable, could you describe your network connection situation? (example: its known to be weak, or writing code on a train or bus, etc.) ?

savil avatar Dec 05 '23 20:12 savil