Skip to content

ephemeral: Explain when podman can't see bcvk's filesystem - #389

Merged
cgwalters merged 1 commit into
bootc-dev:mainfrom
cgwalters-forge:bot/toolbox-error
Oct 1, 2026
Merged

cgwalters merged 1 commit into
bootc-dev:mainfrom
cgwalters-forge:bot/toolbox-error

Conversation

@cgwalters-bot

Copy link
Copy Markdown
Contributor

Running bcvk from a toolbox with podman forwarded to the host (e.g. a flatpak-spawn --host podman wrapper) fails with a rather cryptic

Podman command failed: Error: statfs /usr/bin/bcvk: no such file or directory

because bcvk asks podman to bind-mount its own binary into the VM's container, and the host podman resolves that path on the host, where this bcvk doesn't exist. This was reported in #5, which asked for a clearer error and docs for the current expectation. Actually supporting bcvk from a toolbox is the larger design question in that issue and is not attempted here.

Rather than trying to detect a toolbox or distrobox (which can't tell a forwarded podman from one installed in the container, and would fire in setups that work), this keys on the error itself: when podman reports statfs <path>: no such file or directory for a path that bcvk can see, podman must be looking at a different filesystem. That also covers a remote podman client. In that case the error from run_detached is wrapped with a short explanation ("podman could not find PATH, but bcvk can see it: podman is not seeing bcvk's filesystem"), plus a color_eyre note on when this happens and a suggestion on how to run the host's bcvk from a toolbox (flatpak-spawn --host bcvk) or distrobox (distrobox-host-exec bcvk), linking to a new "Toolbox, distrobox and remote podman" section in docs/src/installation.md, which also covers version skew between a toolbox and a host copy of bcvk, and notes that podman inside the toolbox avoids this error but has limitations of its own. ephemeral run execs podman directly, so its error is unchanged.

Tested on a 16-core RHEL 10.2 devspace:

  • make validate and cargo test pass (84 + 22 unit tests, including table-driven tests for parsing podman's error and for when the hint is added; the note and suggestion sections can't be checked in unit tests, since they're only recorded with color_eyre's handler installed).
  • In a real toolbox (toolbox create, ubi10 toolbox image) with bcvk installed only in the toolbox's /usr/local/bin:
    • podman forwarded to the host (a podman wrapper running the host's podman): bcvk ephemeral run-ssh quay.io/centos-bootc/centos-bootc:stream10 -- true from main fails with just the statfs error; with this change it prints the explanation, and the note and suggestion sections.
    • podman inside the toolbox (sudo podman, vfs storage): no hint. podman finds bcvk's binary, and the run gets as far as networking, which fails in this nested setup (netavark: setns: Operation not permitted). A --bind /nonexistent:mnt there gives the plain statfs error, since that path doesn't exist for bcvk either.
  • Outside a toolbox: run-ssh works as before, and --bind /nonexistent:mnt gives the same plain error as main.

Related: #5

The Signed-off-by: Colin Walters <walters@verbum.org> on these commits was added on cgwalters's approval of the review draft: cgwalters-forge#4 (review)

Generated-by: https://github.com/cgwalters/#llms

Comment thread crates/kit/src/podman_hint.rs Outdated

/// Documentation for running bcvk from a toolbox, distrobox or with a remote podman.
const DOCS_URL: &str =
"https://github.com/bootc-dev/bcvk/blob/main/docs/src/installation.md#toolbox-distrobox-and-remote-podman";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't embed links like this in the code, the docs may change.

Include a brief summary and just mention to look at the man page for more details and btw the man page shuould include this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped the URL; the code now just says "see bcvk-ephemeral-run(8) for details" and I added the full explanation (including the version-skew note) to that man page.

Comment thread crates/kit/src/podman_hint.rs Outdated
Comment on lines +27 to +28
let start = line.find(PODMAN_STATFS_PREFIX)? + PODMAN_STATFS_PREFIX.len();
let path = line[start..].trim_end().strip_suffix(ENOENT_SUFFIX)?;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split_once let's ensure we have that on a review checklsit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to split_once; added "prefer split_once/structured parsing over manual index/split juggling" to our own commit-review checklist too.

Comment thread crates/kit/src/podman_hint.rs Outdated
where podman runs.",
)
.suggestion(
"Install bcvk on the host alongside podman and QEMU (e.g. `sudo dnf install bcvk`, \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not hardcode dnf there's no preferred package managers here in bootc-dev.

Just say "install bcvk on the host" basically really keep it simple and refer to the manpage for more details

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: the hint now just says to install and run bcvk on the host and points at bcvk-ephemeral-run(8); dropped dnf from the man page and installation.md too (sign-off kept on the one commit).

Generated-by: https://github.com/cgwalters/#llms

bcvk bind-mounts its own binary into the container it launches. From a
toolbox or distrobox, podman is often forwarded to the host, so that
path is resolved on the host. With bcvk installed only in the toolbox
this failed with the rather cryptic

  Podman command failed: Error: statfs /usr/bin/bcvk: no such file or directory

Rather than trying to detect a toolbox or distrobox, which can't tell a
forwarded podman from one installed in the container, key on the error
itself: if podman reports a bind mount source missing that bcvk can
see, podman must be looking at a different filesystem. That covers a
remote podman client too. Wrap the error with an explanation and a
pointer to new docs on how to run bcvk in those setups, with the
guidance in color_eyre note and suggestion sections.

This only improves the failure; actually supporting bcvk from a toolbox
is the larger design question in the issue. `ephemeral run` execs
podman directly, so its error stays podman's own.

Related: #5
Generated-by: AI
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters
cgwalters merged commit 96bb5f4 into bootc-dev:main Oct 1, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants