Closed carlotm closed 4 months ago
I tried removing the devbox.lock
and the .devbox
folder. Now the verbose output when trying to activate the shell tells this:
> DEVBOX_DEBUG=1 devbox shell
2024/04/10 09:54:46 findProjectDir: path is
2024/04/10 09:54:46 finding devbox config in dir: /home/carloratm/w/oha
2024/04/10 09:54:46 findProjectDir: path is
2024/04/10 09:54:46 finding devbox config in dir: /home/carloratm/w/oha
2024/04/10 09:54:46 findProjectDir: path is
2024/04/10 09:54:46 finding devbox config in dir: /home/carloratm/w/oha
Info: Ensuring packages are installed.
2024/04/10 09:54:46 Creating files for package "postgresql@latest" create files
2024/04/10 09:54:46 Creating file "/home/carloratm/w/oha/.devbox/virtenv/postgresql/process-compose.yaml" from contentPath: "postgresql/process-compose.yaml"
Error: GET https://search.devbox.sh/v2/resolve?name=postgresql&version=latest: Get "https://search.devbox.sh/v2/resolve?name=postgresql&version=latest": dial tcp: lookup search.devbox.sh on [::1]:53: read udp [::1]:58524->[::1]:53: read: connection refused
2024/04/10 09:54:46
ExecutionID:9d6be99f070a446b8a9cd44b3ca908e9
GET https://search.devbox.sh/v2/resolve?name=postgresql&version=latest: Get "https://search.devbox.sh/v2/resolve?name=postgresql&version=latest": dial tcp: lookup search.devbox.sh on [::1]:53: read udp [::1]:58524->[::1]:53: read: connection refused
go.jetpack.io/devbox/internal/searcher.execGet[...]
go.jetpack.io/devbox/internal/searcher/client.go:93
go.jetpack.io/devbox/internal/searcher.(*client).ResolveV2
go.jetpack.io/devbox/internal/searcher/client.go:83
go.jetpack.io/devbox/internal/lock.resolveV2
go.jetpack.io/devbox/internal/lock/resolve.go:90
go.jetpack.io/devbox/internal/lock.(*File).FetchResolvedPackage
go.jetpack.io/devbox/internal/lock/resolve.go:51
go.jetpack.io/devbox/internal/lock.(*File).Resolve
go.jetpack.io/devbox/internal/lock/lockfile.go:81
go.jetpack.io/devbox/internal/devpkg.resolve
go.jetpack.io/devbox/internal/devpkg/package.go:162
go.jetpack.io/devbox/internal/devpkg.newPackage.func1
go.jetpack.io/devbox/internal/devpkg/package.go:147
go.jetpack.io/devbox/internal/devpkg.newPackage.OnceValue[...].func5
sync/oncefunc.go:57
sync.(*Once).doSlow
sync/once.go:74
sync.(*Once).Do
sync/once.go:65
go.jetpack.io/devbox/internal/devpkg.newPackage.OnceValue[...].func6
sync/oncefunc.go:62
go.jetpack.io/devbox/internal/devpkg.(*Package).PackageAttributePath
go.jetpack.io/devbox/internal/devpkg/package.go:321
go.jetpack.io/devbox/internal/plugin.(*Manager).createFile
go.jetpack.io/devbox/internal/plugin/plugin.go:134
go.jetpack.io/devbox/internal/plugin.(*Manager).CreateFilesForConfig
go.jetpack.io/devbox/internal/plugin/plugin.go:103
go.jetpack.io/devbox/internal/devbox.(*Devbox).installPackages
go.jetpack.io/devbox/internal/devbox/packages.go:390
go.jetpack.io/devbox/internal/devbox.(*Devbox).ensureStateIsUpToDate
go.jetpack.io/devbox/internal/devbox/packages.go:263
go.jetpack.io/devbox/internal/devbox.(*Devbox).ensureStateIsUpToDateAndComputeEnv
go.jetpack.io/devbox/internal/devbox/devbox.go:1010
go.jetpack.io/devbox/internal/devbox.(*Devbox).Shell
go.jetpack.io/devbox/internal/devbox/devbox.go:209
go.jetpack.io/devbox/internal/boxcli.runShellCmd
go.jetpack.io/devbox/internal/boxcli/shell.go:83
go.jetpack.io/devbox/internal/boxcli.shellCmd.func1
go.jetpack.io/devbox/internal/boxcli/shell.go:36
github.com/spf13/cobra.(*Command).execute
github.com/spf13/cobra@v1.8.0/command.go:983
github.com/spf13/cobra.(*Command).ExecuteC
github.com/spf13/cobra@v1.8.0/command.go:1115
github.com/spf13/cobra.(*Command).Execute
github.com/spf13/cobra@v1.8.0/command.go:1039
go.jetpack.io/devbox/internal/boxcli/midcobra.(*midcobraExecutable).Execute
go.jetpack.io/devbox/internal/boxcli/midcobra/midcobra.go:61
go.jetpack.io/devbox/internal/boxcli.Execute
go.jetpack.io/devbox/internal/boxcli/root.go:114
go.jetpack.io/devbox/internal/boxcli.Main
go.jetpack.io/devbox/internal/boxcli/root.go:137
main.main
./main.go:11
runtime.main
runtime/proc.go:271
runtime.goexit
runtime/asm_amd64.s:1695
2024/04/10 09:54:46 findProjectDir: path is
2024/04/10 09:54:46 finding devbox config in dir: /home/carloratm/w/oha
Hope this helps
Hey @carlotm, you're right that we shouldn't be preventing a shell if packages are already downloaded. I think there are two things I'll look into here:
For the second one, are you connected to a VPN? Do you know how you have DNS configured? It looks like Go is trying port 53 on localhost, which doesn't have anything listening. I think Go now defaults to not using glibc for lookups, which could explain why curl works but Devbox doesn't.
@gcurtis
Thank you, I double checked and indeed my dns wasn't resolving correctly, (curl
tricked me).
I am still not sure why devbox needs to fetch anything remotely if I have the packages already installed, but that's too advanced for me to understand.
Cheers!
@carlotm the issue is my original fix in https://github.com/jetify-com/devbox/issues/1657 was just a hack. unfortunately my follow up fix is a hack as well (check description for a bit of what is going on). Theses fixes are mostly bandaids that catch some network failures, but not all.
In terms of why it works this way, the (kinda) short answer is:
We don't need to actually check the remote cache because the lockfile has enough information to check the local cache on your machine. But doing this is a much bigger change that would require some rearchitecting. In the meantime, https://github.com/jetify-com/devbox/pull/1985 is an easy solution that would allow you to continue working in offline mode if DNS resolution fails.
What happened?
This morning I tried to activate a shell (
devbox shell
), the same shell I activate every day at work.I got this error:
I have to mention I can wget that url correctly.
I believe one should be able to use devbox offline without issues if packages are already downloaded.
I opened an issue some time ago, which was promptly resolved (#1657) I don't know if this is the same issue, but it's preventing me from being able to work, which is quite annoying, honestly.
Cheers! Carlo
Command
shell
devbox.json
Devbox version
0.10.4
Nix version
nix (Nix) 2.17.1
What system does this bug occur on?
Linux (x86-64)
Debug logs