fix(image): surface ENOSPC immediately on podman image load#28404
fix(image): surface ENOSPC immediately on podman image load#28404DeveshB-1 wants to merge 2 commits intocontainers:mainfrom
Conversation
When disk space runs out during "podman image load", the error was buried in the image format detection loop and the user saw a misleading "payload does not match any of the supported image formats" error instead of the real cause. Detect "no space left on device" in each transport error and return syscall.ENOSPC immediately so callers and users see the real cause. Fixes: containers#26197 Signed-off-by: Devesh B <98201065+DeveshB-1@users.noreply.github.com>
The previous commit modified vendor/go.podman.io/common/libimage/load.go directly, which causes `make vendor` to report a dirty tree and fail the postbuild CI check. Move the "no space left on device" → syscall.ENOSPC wrapping into the non-vendored (*ImageEngine).Load wrapper in pkg/domain/infra/abi/images.go, and restore the vendor file to its canonical upstream state. Add a unit test (TestLoadImageENOSPCWrapping) that confirms the inline check maps the ENOSPC string to syscall.ENOSPC and leaves other errors unchanged. Signed-off-by: Devesh B <98201065+DeveshB-1@users.noreply.github.com>
ed1c79c to
98bcc07
Compare
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
|
@mheon all 81 CI checks are passing on this one. Would you mind taking a look and merging if it looks good? Thanks! |
danishprakash
left a comment
There was a problem hiding this comment.
There's already some work done on this - containers/container-libs#419. I believe c/c-libs is better suited for this fix.
|
got it no worries |
|
can work on containers/container-libs#419 if its alright @danishprakash |
|
@danishprakash - looked into containers/container-libs#419. The reviewers (Luap99, mtrmac) flagged that the approach there discards the original error context and guesses the affected path. That PR has been stalled since February with the feedback unaddressed. Our fix here is in Happy to move the fix to container-libs instead if you prefer - but given the state of #419, would it be okay to move forward with this approach here? |
Luap99
left a comment
There was a problem hiding this comment.
please read https://github.com/containers/podman/blob/main/LLM_POLICY.md and our contributing guidelines
Just looking at this change I do not think string matches in podman here are good at all. At the very least we should optimize the loading code in libimage to abort the loading early and return useful errors there like discussed in containers/container-libs#419
Description
Fixes #26197
When disk space runs out during
podman image load, the error chain was swallowed by the image format detection loop and the user saw a misleading message:Instead of the real cause:
no space left on device.Fix
In the transport load loop inside
vendor/go.podman.io/common/libimage/load.go, check each transport error for"no space left on device"before appending to the generic error list. Returnsyscall.ENOSPCimmediately so callers and users see the real cause.The error arrives as a string from a subprocess so
errors.Is(err, syscall.ENOSPC)does not work directly — string matching is the approach suggested by @Luap99 in the issue.Before / After