[Bug]: Entrypoint crashes on Void Linux if host uses Fish shell (package name mismatch)
- Lenguaje dominante
- Go
- Estrellas
- 13k
- Forks
- 541
- Merge medio
- 20 h 47 min
- PR fusionados (30 d)
- 4
Descripción
**Describe the bug**
When creating a Void Linux container on a host machine that uses the Fish shell, `distrobox-init` crashes due to a package name mismatch.
This happens because Distrobox attempts to install the host's shell using the package name `fish`. In the Void Linux `xbps` repository, the package is actually named `fish-shell`. The installation fails, but at the end of the init script, Distrobox still asserts `command -v fish`. This returns `127`, causing a fatal error and preventing the `/.containersetupdone` file from being written.
Because the setup is never marked as "done", the container gets stuck in a crash loop on subsequent attempts to start and enter it.
**To Reproduce**
1. Host OS uses the `fish` shell as the default user shell.
2. Container OS: Void Linux (`ghcr.io/void-linux/void-glibc-full:latest` or musl).
3. Distrobox version: 1.8.2.5
4. Podman version: 5.8.2
5. Create the container: `distrobox create -n void_test -i ghcr.io/void-linux/void-glibc-full:latest`
6. Enter the container: `distrobox enter void_test`
7. The first entry attempt runs the init script, which fails to install `fish`.
8. Stop the container.
9. Try to start and enter the container again. It will permanently throw an "Error: An error occurred" and lock the user out because the setup script continually fails at the `command -v fish` check.
**Expected behavior**
Distrobox should ideally have an `xbps` package exception that maps the host shell `fish` to the package `fish-shell` for Void Linux. Alternatively, if a custom host shell fails to install, the entrypoint should gracefully fallback to `/bin/bash` instead of crashing entirely on the `command -v` check.
**Logs**
Here is the scrubbed trace showing the failure. First, `xbps` fails to find `fish`:
```bash
+ xbps-install -Syu xbps
[*] Updating repository `[https://repo-default.voidlinux.org/current/x86_64-repodata](https://repo-default.voidlinux.org/current/x86_64-repodata)' ...
Package 'xbps' is up to date.
+ xbps-install -Sy fish
ERROR: Package 'fish' not found in repository pool.
The script successfully falls back to installing bash and other base packages. However, at the very end of the entrypoint, it crashes here:
+ [ ! -e /.containersetupdone ]
+ command -v fish
+ SHELL=
+ [ 127 -ne 0 ]
+ printf 'Error: An error occurred\n'
Error: An error occurred
Desktop
Host OS Opensuse Tumbleweed
podman 5.8.2
Distrobox 1.8.2.5
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.