89luca89 / 89luca89/distrobox

[Bug]: Entrypoint crashes on Void Linux if host uses Fish shell (package name mismatch)

Abierto
#2,100 3 comentarios 0 reacciones 1 asignado Reclamado por @balanza Ver en GitHub
bug v1
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

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.