Skip to content

[Error] Invalid locale settings causing container crash #1954

@AppleMangoOrange

Description

@AppleMangoOrange

Describe the bug
distrobox-enter crashes because an invalid locale is passed to update-locale. This issue does not exist in all images.

To Reproduce

  • Create a new container using distrobox create --name custom --image quay.io/toolbx-images/debian-toolbox:13
  • Enter the container (distrobox enter custom)
  • The container crashes with Error: An error occurred

Expected behavior
The container should launch as expected

Logs

mount: /run/systemd/journal: mount point does not exist.
       dmesg(1) may have more information after failed mount system call.
mount: /run/systemd/journal: mount point does not exist.
       dmesg(1) may have more information after failed mount system call.
mount: /run/systemd/resolve: mount point does not exist.
       dmesg(1) may have more information after failed mount system call.
mount: /run/systemd/resolve: mount point does not exist.
       dmesg(1) may have more information after failed mount system call.
+ [ -e /etc/locale.gen ]
+ locale -a
+ grep -qi en_us.utf8
+ sed -i s|#.*en_US.UTF-8|en_US.UTF-8|g /etc/locale.gen
+ sed -i s|#.*en_IN.UTF-8|en_IN.UTF-8|g /etc/locale.gen
+ locale-gen
Generating locales (this might take a while)...
error: Bad entry 'en_IN.UTF-8 '
  en_US.UTF-8... done
Generation complete.
+ update-locale LC_ALL=en_IN.UTF-8 LANG=en_IN.UTF-8
*** update-locale: Error: invalid locale settings:  LANG=en_IN.UTF-8 LC_ALL=en_IN.UTF-8
----------
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_ALL to default locale: No such file or directory
ANSI_X3.4-1968
----------
+ [ 255 -ne 0 ]
+ printf Error: An error occurred\n
Error: An error occurred

Desktop (please complete the following information):

  • Which version or podman, docker or lilipod? podman version 5.7.1
  • Which version of distrobox? distrobox: 1.8.2.2
  • Which host distribution? Fedora Linux 43
  • How did you install distrobox? dnf

Additional context
Crashing on:

  • quay.io/toolbx-images/debian-toolbox:13
  • quay.io/toolbx-images/debian-toolbox:12

Not crashing on:

  • quay.io/toolbx/ubuntu-toolbox:24.04
  • quay.io/toolbx/arch-toolbox:latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions