Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devbox does not work properly with locales (ubuntu 24.04) #2427

Open
excavador opened this issue Nov 30, 2024 · 22 comments
Open

devbox does not work properly with locales (ubuntu 24.04) #2427

excavador opened this issue Nov 30, 2024 · 22 comments
Labels
bug Something isn't working triage Issue needs triage

Comments

@excavador
Copy link

What happened?

I have installed devbox to my machine and now I could see the following

➜ kubectl get ns
/nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
NAME                STATUS   AGE
...

The same error message I see when I try to build golang program.

➜ env | grep LC
LC_ADDRESS=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_PAPER=en_US.UTF-8
DIRENV_DIFF=eJzsWelzo7qy_1co3vt2gw1i96n7wbGdxDke2-M4y0xNlUsgATJCCIHZTs3__grsTNZ7z53lw6v3JlUh0FL_utVq9aL8JXN59Jc8nd2drx52k9XyYn65m8438kgeRmmChynF4XBAUx_SYR5BgYcIl15aD0OaepAOEQ7ggRYn6gDJZ49g6_Hkz_Hl7OaH4AYnMiP1kIs0IBQ_jj2XsL3a3WzHkz_l0SNtOX_YzZZ3xzHVR76lAQSNIACerquO6_qWajpIxQbSdc0xfdswfQsYjmdCVcOO4endiKsHmm6MTqDz5XzbIz6TvVldzybb3Wa12n7v6p5Q7qcveOUzuZfyC6019AgbPUdjpFYe5_Rjh1wMTyJefX_7fBroX46f32ghTHD-nO9EyBnkb8T_54spiSgwK4fiwOoORj6TH6aXu-l4O-5c6qazUq9cj8UpzBP4YjUdffQ0ZTQsoRhS4vWKoSHCeVykXP56JrPuDIw7L4VCPpPHHTbM5TN5MpFHcuj73evxbNxczRaLTnRn67xIBR7SQK34XuydpjbCPKlArtc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hOgi_JUOr8A-Vua9FL327b57mN9-UwQ0pdht-UW0usjU-Pc2GEEB8vfPoMAAD__yetqP4=

➜ env | grep LANG
LANGUAGE=en_US
LANG=en_US.UTF-8

Installation of "glibcLocales" inside global devbox does NOT help me.

How to debug and fix this issue?

Steps to reproduce

Command

No response

devbox.json

No response

Devbox version

0.13.6

Nix version

2.24.7

What system does this bug occur on?

Linux (x86-64)

Debug logs

➜ DEVBOX_DEBUG=1 devbox global run -- kubectl get ns
time=2024-11-30T15:59:10.817+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.
time=2024-11-30T15:59:10.817+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json
time=2024-11-30T15:59:10.817+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:108 msg="trying config file" path=.
time=2024-11-30T15:59:10.817+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=/home/devbox.json
time=2024-11-30T15:59:10.817+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=/devbox.json
time=2024-11-30T15:59:10.817+01:00 level=ERROR source=go.jetpack.io/devbox/internal/devconfig/config.go:135 msg="config file search error" err="no devbox config file found" dur=197.96µs
time=2024-11-30T15:59:10.817+01:00 level=ERROR source=go.jetpack.io/devbox/internal/boxcli/run.go:79 msg="failed to open devbox" err="no devbox.json found in the current directory (or any parent directories). Did you run `devbox init` yet?\ngo.jetpack.io/devbox/internal/boxcli/usererr.New\n\tgo.jetpack.io/devbox/internal/boxcli/usererr/usererr.go:30\ngo.jetpack.io/devbox/internal/devbox.Open\n\tgo.jetpack.io/devbox/internal/devbox/devbox.go:94\ngo.jetpack.io/devbox/internal/boxcli.listScripts\n\tgo.jetpack.io/devbox/internal/boxcli/run.go:72\ngo.jetpack.io/devbox/internal/boxcli.runCmd\n\tgo.jetpack.io/devbox/internal/boxcli/run.go:66\ngo.jetpack.io/devbox/internal/boxcli.globalCmd\n\tgo.jetpack.io/devbox/internal/boxcli/global.go:37\ngo.jetpack.io/devbox/internal/boxcli.RootCmd\n\tgo.jetpack.io/devbox/internal/boxcli/root.go:66\ngo.jetpack.io/devbox/internal/boxcli.Execute\n\tgo.jetpack.io/devbox/internal/boxcli/root.go:111\ngo.jetpack.io/devbox/internal/boxcli.Main\n\tgo.jetpack.io/devbox/internal/boxcli/root.go:139\nmain.main\n\t./main.go:11\nruntime.main\n\truntime/proc.go:272\nruntime.goexit\n\truntime/asm_amd64.s:1700"
time=2024-11-30T15:59:10.817+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.
time=2024-11-30T15:59:10.817+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json
time=2024-11-30T15:59:10.817+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:108 msg="trying config file" path=.
time=2024-11-30T15:59:10.817+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=/home/devbox.json
time=2024-11-30T15:59:10.817+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=/devbox.json
time=2024-11-30T15:59:10.817+01:00 level=ERROR source=go.jetpack.io/devbox/internal/devconfig/config.go:135 msg="config file search error" err="no devbox config file found" dur=42.376µs
time=2024-11-30T15:59:10.817+01:00 level=ERROR source=go.jetpack.io/devbox/internal/boxcli/run.go:79 msg="failed to open devbox" err="no devbox.json found in the current directory (or any parent directories). Did you run `devbox init` yet?\ngo.jetpack.io/devbox/internal/boxcli/usererr.New\n\tgo.jetpack.io/devbox/internal/boxcli/usererr/usererr.go:30\ngo.jetpack.io/devbox/internal/devbox.Open\n\tgo.jetpack.io/devbox/internal/devbox/devbox.go:94\ngo.jetpack.io/devbox/internal/boxcli.listScripts\n\tgo.jetpack.io/devbox/internal/boxcli/run.go:72\ngo.jetpack.io/devbox/internal/boxcli.runCmd\n\tgo.jetpack.io/devbox/internal/boxcli/run.go:66\ngo.jetpack.io/devbox/internal/boxcli.RootCmd\n\tgo.jetpack.io/devbox/internal/boxcli/root.go:75\ngo.jetpack.io/devbox/internal/boxcli.Execute\n\tgo.jetpack.io/devbox/internal/boxcli/root.go:111\ngo.jetpack.io/devbox/internal/boxcli.Main\n\tgo.jetpack.io/devbox/internal/boxcli/root.go:139\nmain.main\n\t./main.go:11\nruntime.main\n\truntime/proc.go:272\nruntime.goexit\n\truntime/asm_amd64.s:1700"
time=2024-11-30T15:59:10.836+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/nix.go:342 msg="nix --version --debug output" out="nix (Nix) 2.24.7\nSystem type: x86_64-linux\nAdditional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux\nFeatures: gc, signed-caches\nSystem configuration file: /etc/nix/nix.conf\nUser configuration files: /home/oleg/.config/nix/nix.conf:/home/oleg/.config/kdedefaults/nix/nix.conf:/etc/xdg/xdg-plasma/nix/nix.conf:/etc/xdg/nix/nix.conf\nStore directory: /nix/store\nState directory: /nix/var/nix\nData directory: /nix/store/s429drnj3jp5dbxib74r3q0rypknvw48-nix-2.24.7/share\n"
time=2024-11-30T15:59:10.836+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' eval --impure --raw --expr builtins.currentSystem" cmd.path=/home/oleg/.nix-profile/bin/nix
time=2024-11-30T15:59:10.857+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' eval --impure --raw --expr builtins.currentSystem" cmd.path=/home/oleg/.nix-profile/bin/nix cmd.pid=46661 cmd.code=0 cmd.dur=20.585775ms
time=2024-11-30T15:59:10.857+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/boxcli/run.go:104 msg="run script" script=kubectl args="[get ns]"
time=2024-11-30T15:59:10.857+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:90 msg="searching for config file (excluding parent directories)" path=/home/oleg/.local/share/devbox/global/default
time=2024-11-30T15:59:10.857+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=/home/oleg/.local/share/devbox/global/default/devbox.json
time=2024-11-30T15:59:10.857+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:95 msg="config file found" path=/home/oleg/.local/share/devbox/global/default/devbox.json dur=260.251µs
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=amazon-ecr-credential-helper mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=aws-vault mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=awscli2 mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=direnv mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=git-lfs mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=git mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=go mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=gopls mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=helmfile mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=jq mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=kubectl mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=kubernetes-helm mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=kubernetes-helmPlugins.helm-diff mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=nodejs mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=pulumiPackages.pulumi-language-go mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=yarn-berry mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=yq-go mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=golangci-lint mode=auto
time=2024-11-30T15:59:10.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=glibcLocales mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=amazon-ecr-credential-helper mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=aws-vault mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=awscli2 mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=direnv mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=git-lfs mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=git mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=go mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=gopls mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=helmfile mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=jq mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=kubectl mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=kubernetes-helm mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=kubernetes-helmPlugins.helm-diff mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=nodejs mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=pulumiPackages.pulumi-language-go mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=yarn-berry mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=yq-go mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=golangci-lint mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=glibcLocales mode=auto
time=2024-11-30T15:59:10.859+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/run.go:36 msg="executing script" cmd="[/usr/bin/sh -c \"/home/oleg/.local/share/devbox/global/default/.devbox/gen/scripts/.cmd.sh\"]"
/nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
NAME                STATUS   AGE
@excavador excavador added bug Something isn't working triage Issue needs triage labels Nov 30, 2024
@excavador
Copy link
Author

excavador commented Dec 3, 2024

Additional information - If I make "devbox shell" AND install "glibc" and "glibcLocales" inside - then error disappeared.
At the same time, install to global devbox does not help

➜ cd ~/.local/share/devbox/global/default
➜ devbox shell
Starting a devbox shell...
➜ devbox list
* amazon-ecr-credential-helper@0.8.0
* aws-vault@latest - 7.2.0
* awscli2@latest - 2.19.0
* direnv@latest - 2.35.0
* git-lfs@latest - 3.5.1
* git@latest - 2.47.0
* helmfile@latest - 0.169.0
* jq@latest - 1.7.1
* kubectl@1.29
* kubernetes-helm@latest - 3.16.3
* kubernetes-helmPlugins.helm-diff@latest - 3.9.12
* pulumiPackages.pulumi-language-go@latest - 3.122.0
* yq-go@latest - 4.44.5
* glibc@latest - 2.40-36
* glibcLocales@latest - 2.40-36
* glibcLocalesUtf8@latest - 2.40-36
➜ kubectl get ns
NAME                STATUS   AGE
➜ locale -a
C
POSIX

Meanwhile global devbox does not work still

➜ locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.utf8
POSIX
➜ kubectl get ns
/nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
NAME                STATUS   AGE

My ~/.bashrc

eval "$(devbox global shellenv)"
eval "$(direnv hook bash)"

@excavador
Copy link
Author

How to install devbox WITHOUT glibc - by using pre-installed global one?

@excavador
Copy link
Author

excavador commented Dec 5, 2024

Guys, I am terribly sorry for pointing you, but I am stuck with this problem and devbox on my machine impossible to use (in case of golang build the entire console in errors like "setlocale: not found" and it wipe out any useful output)
I tred to reinstall nix, reinstall devbox, try to clean everything - does not help!

Before it was fine in case if I install "build-essential" first, and only after that install devbox - but this workaround does not work anymore.
Somehow devbox is installing glibc inside Nix, instead of use Ubuntu's host one, and this is somehow the reason of the issue.

Could you please, at least, point me out on how to debug problem? Thank you so much for your help

CC @adamdicarlo @mohsenari @Lagoja

@mohsenari
Copy link
Collaborator

mohsenari commented Dec 5, 2024

Hey @excavador Thanks for reporting this issue. We had done some work to patch glibc referencing to make mostly python libraries work.

Before it was fine in case if I install "build-essential" first, and only after that install devbox - but this workaround does not work anymore.

If you had a workaround with a previous version of devbox, there is an env variable you can set that it will force devbox to use an older version, which is DEVBOX_USE_VERSION. So, for example, if you want to test out devbox version 0.13.1 you can do DEVBOX_USE_VERSION=0.13.1 devbox shell or you can export the env variable.

For the time being while I bring up this issue with the team, could you test older version of devbox and see what was the latest version that the build-essential workaround was still working? It will help a lot in figuring out the root cause for us.

@excavador
Copy link
Author

Thank you for answer! I am on it to test with listed version

@excavador
Copy link
Author

excavador commented Dec 5, 2024

@mohsenari the current state

I cleaned everything

rm -rf /nix/
rm -rf /home/oleg/.local/share/devbox/
rm -rf /home/oleg/.config/devbox
rm -rf /home/oleg/.nix-*
rm -f /usr/local/bin/devbox

I have added DEVBOX_USE_VERSION=0.13.1 to ~/.bashrc

I have rebooted machine to be sure that everything is fine.

oleg@t14:~$ env | grep DEVBOX
DEVBOX_USE_VERSION=0.13.1
oleg@t14:~$ which devbox
oleg@t14:~$ which nix-env
oleg@t14:~$ 

Now I install devbox by command curl -fsSL https://get.jetify.com/devbox | bash
Output

oleg@t14:~$ curl -fsSL https://get.jetify.com/devbox | bash
Devbox 📦 by Jetify
  Instant, easy and predictable development environments.

  This script downloads and installs the latest devbox binary.

Confirm Installation Details
  Location:     /usr/local/bin/devbox
  Download URL: https://releases.jetify.com/devbox

? Install devbox to /usr/local/bin (requires sudo)? [Y/n] y

Downloading and Installing
✓ Downloading devbox binary... [DONE]
→ Installing in /usr/local/bin/devbox (requires sudo)...
✓ Installing in /usr/local/bin/devbox... [DONE]
✓ Successfully installed devbox 🚀

Next Steps
  1. Learn how to use devbox
     Run devbox help or read the docs at https://github.com/jetify-com/devbox
  2. Get help and give feedback
     Join our community at https://discord.gg/jetify
oleg@t14:~$ 

Now I install awscli2@latest globally to devbox (just to create ~/.local/share/devbox/global/default/devbox.json and install nix)

oleg@t14:~$ devbox global add awscli2@latest

Nix is not installed. Devbox will attempt to install it.

Press enter to continue or ctrl-c to exit.

Installing nix with: curl -L https://releases.nixos.org/nix/nix-2.18.1/install | sh -s
This may require sudo access.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4052  100  4052    0     0  33894      0 --:--:-- --:--:-- --:--:-- 34050
downloading Nix 2.18.1 binary tarball for x86_64-linux from 'https://releases.nixos.org/nix/nix-2.18.1/nix-2.18.1-x86_64-linux.tar.xz' to '/tmp/nix-binary-tarball-unpack.RoDl8MPyFR'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20.6M  100 20.6M    0     0  4018k      0  0:00:05  0:00:05 --:--:-- 4428k
Note: a multi-user installation is possible. See https://nixos.org/manual/nix/stable/installation/installing-binary.html#multi-user-installation
performing a single-user installation of Nix...
directory /nix does not exist; creating it by running 'mkdir -m 0755 /nix && chown oleg /nix' using sudo
copying Nix to /nix/store...

installing 'nix-2.18.1'
building '/nix/store/hzx954rnda4k348rb4wvqbdzp9z0ynjy-user-environment.drv'...
unpacking channels...

Installation finished!  To ensure that the necessary environment
variables are set, either log in again, or type

  . /home/oleg/.nix-profile/etc/profile.d/nix.sh

in your shell.
Nix installed successfully. Devbox is ready to use!
Info: Adding package "awscli2@latest" to devbox.json
Info: Installing the following packages to the nix store: awscli2@latest

Warning: devbox global is not activated.

Add the following line to your shell's rcfile (e.g., ~/.bashrc or ~/.zshrc)
and restart your shell to fix this:

        eval "$(devbox global shellenv)"

Now I try to launch it

oleg@t14:~$ devbox global run -- aws sts get-caller-identity
Info: Ensuring packages are installed.
✓ Computed the Devbox environment.
/nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
{
    "UserId": "xxx",
    "Account": "yyy",
    "Arn": "zzz"
}

Warning: devbox global is not activated.

Add the following line to your shell's rcfile (e.g., ~/.bashrc or ~/.zshrc)
and restart your shell to fix this:

        eval "$(devbox global shellenv)"

Double-check the version

oleg@t14:~$ devbox version
Info: New devbox available: 0.13.1 -> v0.13.6. Please run `devbox version update`.
0.13.1

As you could see, issue still exists. - devbox global run -- aws sts get-caller-identity returns

/nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory

I do not understand why :( Before it was Ubuntu 24.04, I install just build-essential, and devbox after that - and everything was fine.
The single difference (possible one) the following - I install Kubuntu 24.04 instead (KDE-based), and it configure nl_NL.UTF-8 locale by default.

I installed build-essential and devbox after that, found the issue (default locale is nl_NL.UTF-8), generated all locales dpkg-reconfigure locales - select all - and choose en_US.UTF-8 by default - and reinstall nix/devbox - but issue still there!

@excavador
Copy link
Author

What could I do, different from "reinstall Ubuntu from scratch"? :(

@excavador
Copy link
Author

@mohsenari why this is the huge problem to me.

We integrated devbox everywhere in organization. Right now to make any work I need workable devbox.
This particular issue is show-stopper for any work

@excavador
Copy link
Author

excavador commented Dec 5, 2024

@mohsenari I have found, that "normal devbox" (not global) works fine with glibcLocalesUtf8.

Nobody in organization need it and we never install glibc or glibcLocalesUtf8 globally or inside any repository

Install glibc or glibcLocalesUtf8 "globally" does NOT help. Somehow "global" devbox is different from "regular one"

In my home directory

$ devbox init
$ cp backup.json devbox.json
$ devbox add glibcLocalesUtf8
$ devbox generate direnv
$ aws sts get-caller-identity

Now I do not have issue in home directory!

The problem is the following - when I use some devbox in some git repository - this "home" devbox is ignored entirely.
I am not able to set up "globally" all necessary tools for work - like AWS CLI, etc

My "global" devbox.json is the following

{
  "": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
  "packages": [
    "amazon-ecr-credential-helper@0.8.0",
    "aws-vault@latest",
    "awscli2@latest",
    "helmfile@latest",
    "jq@latest",
    "kubectl@1.29",
    "kubernetes-helm@latest",
    "kubernetes-helmPlugins.helm-diff@latest",
    "pulumiPackages.pulumi-language-go@latest",
    "yq-go@latest"
  ],
  "shell": {
    "init_hook": [],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  },
  "env": {
    "DEVBOX_COREPACK_ENABLED": "1",
    "GOPRIVATE":               "github.com/truvity",
    "GOPROXY":                 "https://proxy.golang.org,direct",
    "GOTEST_LOCALHOST":        "10.254.254.254",
    "HELM_PLUGINS":            "$PWD/.devbox/nix/profile/default"
  }
}

@mohsenari
Copy link
Collaborator

@excavador sorry that this is blocking your work. Seems like installing glibcLocalesUtf8@latest fixed the issue?

To clarify, are you trying to setup a "global" devbox in your home directory? and then in git subdirectories under home, the same environment is not present?

@excavador
Copy link
Author

excavador commented Dec 5, 2024

@excavador sorry that this is blocking your work. Seems like installing glibcLocalesUtf8@latest fixed the issue?

It does not fix the issue. I just show the example, that "setup devbox inside home directory" works differently from "install global devbox"

Somehow global devbox and regular "directory devbox" are different.

If I install glibcLocalesUtf8 to "directory devbox" - I do not see issue
If I install glibcLocalesUtf8 to "global devbox" - I see the issue.

Why it is the problem

  • inside our organization github repositories we have "devbox.json" + ".envrc" and it does NOT have any "glibcLocalesUtf8", and I do not want to add it everywhere - I suspect that it will break of entire organization (because we do not even understand the root cause and difference of my machine compare with other developers)
  • I need "globally install for organization" tools - like awscli2, etc - you could see them from devbox.json above in the comments. Without it the every single repository build scripts does not work at all - because all scripts rely to availability of these global tools.

The long story short - issue still exists and blocking me - I just showed the difference between global devbox and devbox in the directory - and this is not a solution

To clarify, are you trying to setup a "global" devbox in your home directory? and then in git subdirectories under home, the same environment is not present?

Normally (the first commend from today) I installed devbox GLOBALLY.

I make set up "devbox to home directory" just to ilusstrate the difference! I understand, why "devbox in subdirectory" does NOT see "devbox from outer directory" - it's reasonable

@mohsenari hope for your help

@mohsenari
Copy link
Collaborator

@excavador Ok, thanks for clarifying. I'm gonna try recreating this issue on my end and report back once I find a workaround.

@excavador
Copy link
Author

excavador commented Dec 5, 2024

@mohsenari thank you!

I know how to reproduce issue 100%

  1. Install clean ubuntu WITHOUT any build-essential - i.e. without gcc, g++, make, etc
  2. Install devbox and some tools
  3. See the issue!

If you install build-essential BEFORE install devbox - then USUALLY we do not see any issue - because in this case devbox avoid to install glibc inside nix - and use host ubuntu glibc! - and everything fine.

This is what we found the several months ago. It worked to everybody inside organization.

Recently I reinstalled ubuntu on my laptop - install build-essential first - and devbox after that - but this solution is stop working
I could see how devbox and nix always install glibc inside nix! and this is led us to described issue

I hope it is helping @mohsenari

@excavador
Copy link
Author

excavador commented Dec 7, 2024

@mohsenari I think I finally figure out the issue!

Seems like, Nix or devbox recently updated to the fresh version of glibc - 2.40.x, while ubuntu 24.04 is using 2.39.x

As the result, before the version of glibc on my ubuntu 24.04 and nix were the same, and they shared the locales from host glibc.

I have managed to fix the global devbox in the following way

  • added environment variable "LOCALE_ARCHIVE": "${pkgs.glibcLocales}/lib/locale/locale-archive"
  • added package glibc, glibcLocales and glibcLocalesUtf8
{
  "": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
  "packages": [
    "amazon-ecr-credential-helper@0.8.0",
    "aws-vault@latest",
    "awscli2@latest",
    "helmfile@latest",
    "jq@latest",
    "kubectl@1.29",
    "kubernetes-helm@latest",
    "kubernetes-helmPlugins.helm-diff@latest",
    "pulumiPackages.pulumi-language-go@latest",
    "yq-go@latest"
  ],
  "shell": {
    "init_hook": [
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  },
  "env": {
    "LOCALE_ARCHIVE": "${pkgs.glibcLocales}/lib/locale/locale-archive",
    "DEVBOX_COREPACK_ENABLED": "1",
    "GOPRIVATE":               "github.com/truvity",
    "GOPROXY":                 "https://proxy.golang.org,direct",
    "GOTEST_LOCALHOST":        "10.254.254.254",
    "HELM_PLUGINS":            "$PWD/.devbox/nix/profile/default"
  }
}

@excavador
Copy link
Author

@mohsenari I think devbox need somehow reflect this part inside documentation...

@mohsenari
Copy link
Collaborator

@mohsenari I think devbox need somehow reflect this part inside documentation...

@excavador that's very helpful, thank you for looking into this. I haven't been able to reproduce this issue yet, I think it's because my Kubuntu image didn't have nl_NL locale.
Once I successfully reproduce this issue, I'll update the documentation as well.
We can also print a warning if there is a version mismatch with glibc on nix and on the host system.

@excavador
Copy link
Author

excavador commented Dec 7, 2024

@mohsenari I think devbox need somehow reflect this part inside documentation...

@excavador that's very helpful, thank you for looking into this. I haven't been able to reproduce this issue yet, I think it's because my Kubuntu image didn't have nl_NL locale.
Once I successfully reproduce this issue, I'll update the documentation as well.
We can also print a warning if there is a version mismatch with glibc on nix and on the host system.

You could do the different!

If you have en_US.UTF-8 during install, just switch global locale AFTER install to something like en_GB.UTF-8 and try to install devbox/nix

I am pretty sure, the issue appears if you change locales after install Ubuntu and locales are different from the default ones

@excavador
Copy link
Author

@mohsenari hello!

We just confirmed workability of my workaround (LOCAL_ARCHIVE env) on other linux ubuntu machine.

Do you have any updates? Do you need any help?

@mohsenari
Copy link
Collaborator

mohsenari commented Dec 13, 2024

@excavador sorry for delay, I still am unable to reproduce this issue. It would be very helpful if you provide a step by step instruction after a fresh ubuntu install, more specifically expand your "step 3: see the issue", that makes the error show up, I would appreciate it.
FYI, I tried to repro this issue in a vm as well as in an ubuntu container both was unable to see the error you were seeing.

@excavador
Copy link
Author

excavador commented Dec 13, 2024

Got it. I will try to prepare Dockerfike with reproduction tomorrow

Thank you so much for your participation!

@excavador
Copy link
Author

excavador commented Dec 16, 2024

@mohsenari I have reproduction case for you!

Dockerfile

FROM ubuntu:24.04
RUN apt update
RUN apt install -y wget xz-utils sudo adduser curl
RUN adduser oleg
RUN echo "oleg    ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
WORKDIR /home/oleg
ENTRYPOINT ["bash"]

Command to run

docker build -t devbox-issue-2427:latest
docker run --rm -i -t -v /home/oleg/.aws:/home/oleg/.aws --user oleg:oleg devbox-issue-2427:latest

Inside docker container (run it in terminal command-by-command, you need tty)

curl -fsSL https://get.jetify.com/devbox | bash
devbox version update
devbox global add awscli2@latest
echo 'eval "$(devbox global shellenv)"' >> ~/.bashrc

sudo su oleg
refresh-global

# locales are fine
aws sts get-caller-identity


sudo apt install -y language-pack-en locales
(
cat <<EOF
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
EOF
) | sudo tee /etc/default/locale

sudo su oleg

devbox global add awscli2@latest
refresh-global

# locales are broken
aws sts get-caller-identity

devbox global add glibcLocalesUtf8
refresh-global

# locales are broken
aws sts get-caller-identity

result

oleg@1417526c63e4:~$ aws sts get-caller-identity
/nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory

'2148a413667f65d5ff5b19f7e7ac8b61a8b35caa'

P.S. awscli inside docker is broken (I do not know why), but this problem exists

@excavador
Copy link
Author

excavador commented Dec 16, 2024

@mohsenari actually, you could observe the several problems from the previous snippet.

  • somehow "awscli2" is NOT installed after the first installation + install locales/change locales. I need to install them again.
  • "awscli2" is broken and does not work
  • after change locales you see the original problem from this issue.

There are multiple problems, and maybe they have the same root cause.

I hope I am helping. Could you please confirm, that you able to reproduce original problem and additional ones?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs triage
Development

No branches or pull requests

2 participants