Skip to content

podstorage: Add early check for missing podman binary - #2386

Open
HarshwardhanPatil07 wants to merge 1 commit into
bootc-dev:mainfrom
HarshwardhanPatil07:fix/better-error-missing-podman
Open

podstorage: Add early check for missing podman binary#2386
HarshwardhanPatil07 wants to merge 1 commit into
bootc-dev:mainfrom
HarshwardhanPatil07:fix/better-error-missing-podman

Conversation

@HarshwardhanPatil07

Copy link
Copy Markdown

When podman is not installed, "No such file or directory (os error 2)" is shown, which users misinterpret as a missing file or directory on disk.

Before fix:
error: Upgrading: No such file or directory (os error 2)

After fix:
error: Upgrading: Creating imgstorage: nonexistent_podman executable not found in PATH; it is required for container image storage operations

Steps to reproduce:

  1. cargo build
  2. BOOTC_variant=ostree just build
  3. bcvk libvirt run --name bootc-repro --replace --ssh-wait localhost/bootc
  4. bcvk libvirt ssh bootc-repro -- 'bash -c "BOOTC_EXP_EXTERNAL_CONTAINER_TOOL=nonexistent_podman bootc upgrade

Closes: #2284

When podman is not installed, CStorage::create() fails with
"No such file or directory (os error 2)" from the underlying
Command::new() call, which users misinterpret as a missing
file or directory on disk. Add an early have_executable()
check that bails with a clear message naming the missing
binary, following the same pattern used by ukify.rs.

Closes: bootc-dev#2284
Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
@bootc-bot
bootc-bot Bot requested a review from ckyrouac August 18, 2026 06:08
Johan-Liebert1
Johan-Liebert1 previously approved these changes Aug 18, 2026
@cgwalters

Copy link
Copy Markdown
Collaborator

Perhaps bootc container lint should also check our runtime dependencies exist?

@HarshwardhanPatil07

Copy link
Copy Markdown
Author

Yes @cgwalters, Thank you! i will add it

Comment thread crates/lib/src/lints.rs Outdated
fn check_runtime_deps(root: &Dir, _config: &LintExecutionConfig) -> LintResult {
let mut bins: Vec<&str> = vec![bootc_utils::podman_bin(), bootc_utils::skopeo_bin()];
bins.dedup();
const BIN_DIRS: &[&str] = &["usr/bin", "usr/sbin", "bin", "sbin"];

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 have other code in this repo to search for executables, I don't think we need to reimplement $PATH lookups.

Hmm, another way to do this would be to have something like storage::check_dependencies() and centralize things there?

That would also ensure we work with that experimental override variable...

Comment thread crates/lib/src/lints.rs Outdated
check_runtime_deps,
);
fn check_runtime_deps(root: &Dir, _config: &LintExecutionConfig) -> LintResult {
let mut bins: Vec<&str> = vec![bootc_utils::podman_bin(), bootc_utils::skopeo_bin()];

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.

A while ago I tried to have this list be included in Cargo.toml

@cgwalters

Copy link
Copy Markdown
Collaborator

But this all said sorry I would have probably said we could just merge the first commit right now, and do the lint changes as a separate followup PR. The first commit is clearly safe and correct.

@HarshwardhanPatil07

Copy link
Copy Markdown
Author

@cgwalters Thanks! I will remove the second commit and continue in followup pr. Thank you!

@HarshwardhanPatil07
HarshwardhanPatil07 force-pushed the fix/better-error-missing-podman branch from 388a24f to 6d27399 Compare August 19, 2026 11:42
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.

bootc 1.16.0+ fails with an unclear error message when missing podman

3 participants