devbox icon indicating copy to clipboard operation
devbox copied to clipboard

execute `devbox shell` with error

Open bxb100 opened this issue 3 years ago • 11 comments

❗ execute devbox shell with error

Installing nix packages. This may take a while...
Starting a devbox shell...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Builder, source: Os { code: 2, kind: NotFound, message: "No such file or directory" } }', /Users/ciaccount/.cargo/registry/src/github.com-1ecc6299db9ec823/sentry-0.27.0/src/transports/reqwest.rs:55:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

✅ execute nix-shell .devbox/gen/shell.nix success


Simple system Info

  • System Version: macOS 13.0 (22A5331f)
  • Kernel Version: Darwin 22.1.0
  • Model Name: MacBook Pro
  • Model Identifier: MacBookPro17,1
  • Chip: Apple M1

bxb100 avatar Sep 04 '22 07:09 bxb100

@bxb100 Could you include your devbox.json in this ticket? I want to see if we can reproduce.

loreto avatar Sep 06 '22 15:09 loreto

@loreto here there are

{
  "packages": [
    "go_1_18"
  ]
}%

bxb100 avatar Sep 07 '22 06:09 bxb100

Maybe the beta version OS problem

bxb100 avatar Sep 07 '22 06:09 bxb100

@loreto

I am also facing the same issue.

Installing nix packages. This may take a while...
Starting a devbox shell...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Builder, source: Os { code: 2, kind: NotFound, message: "No such file or directory" } }', /Users/ciaccount/.cargo/registry/src/github.com-1ecc6299db9ec823/sentry-0.27.0/src/transports/reqwest.rs:55:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

devbox.json

{
  "packages": [
    "ruby_3_1",
    "bundler"
  ]
}

System Info

Hardware Overview:
  Model Name:	MacBook Pro
  Model Identifier:	MacBookPro18,2
  Chip:	Apple M1 Max
  Total Number of Cores:	10 (8 performance and 2 efficiency)
  Memory:	64 GB
  System Firmware Version:	7459.141.1
  OS Loader Version:	7459.141.1

System Software Overview:

  System Version:	macOS 12.5.1 (21G83)
  Kernel Version:	Darwin 21.6.0
  Boot Volume:	Macintosh HD
  Boot Mode:	Normal

I'm not on Mac OS Beta.

thamwangjun avatar Sep 09 '22 18:09 thamwangjun

Got it.

I'm a bit puzzled by this error: devbox doesn't use rust at all – which makes me think there's something else that is causing the error (but likely failing because we're modifying the environment when creating the shell).

Googling for Users/ciaccount brought me to https://github.com/withfig/fig/issues/1133. By chance is either of you using fig? If yes, that might help us reproduce the issue.

loreto avatar Sep 09 '22 19:09 loreto

@gcurtis It's likely that whatever tool is interacting with devbox here, is failing due to an env variable we're failing to set when starting the shell.

@bxb100 is reporting that this works when calling nix-shell directly, but not via devbox. Could we do an inventory of all the env variables that nix-shell sets, and make sure we are carrying over all the important ones?

loreto avatar Sep 09 '22 19:09 loreto

It's definitely possible. Devbox starts a new shell with a (mostly) empty environment for isolation. It should still source your shell's rc file like normal, but any variables set elsewhere won't be brought in.

If you run nix-shell --pure .devbox/gen/shell.nix do you get the same error?

gcurtis avatar Sep 09 '22 19:09 gcurtis

@loreto Yes I'm using fig.

@gcurtis nix-shell --pure .devbox/gen/shell.nix does not give any errors.

adding this to the top of my .zshrc

export FIG_DISABLE_SENTRY=1

works

I am able to devbox shell without errors with that workaround.

thamwangjun avatar Sep 09 '22 19:09 thamwangjun

Same with @tabby-jun, export FIG_DISABLE_SENTRY=1 work for me

Thanks

bxb100 avatar Sep 10 '22 01:09 bxb100

So is this considered a bug that should be fixed? (in devbox, or fig, or both?)

thamwangjun avatar Sep 10 '22 02:09 thamwangjun

@tabby-jun @bxb100 thanks confirming that export FIG_DISABLE_SENTRY=1 works and testing out nix-shell --pure.

We should figure out what's causing the error, so I'm going to reopen this for now. Ideally we can implement a fix or automatic workaround.

gcurtis avatar Sep 10 '22 16:09 gcurtis

This should be fixed as of Devbox 0.4.2. It was most likely due to HTTP_PROXY or HTTPS_PROXY getting set to an invalid value. Let us know if this happens again with the latest version of Devbox.

gcurtis avatar Mar 14 '23 17:03 gcurtis