common: abort load on ENOSPC and output clear error#419
common: abort load on ENOSPC and output clear error#419zvenigorodsky wants to merge 1 commit intocontainers:mainfrom
Conversation
|
✅ A new PR has been created in buildah to vendor these changes: containers/buildah#6452 |
|
Hey, I saw the issue containers/podman#26197 is stale, and decided to look into it. Looked at zhengkezhou1's PR and researched about It does implement the unwrap method on the error (https://pkg.go.dev/fmt#Errorf) , and |
|
Tested this by creating a mounted filesystem with minimal storage and pointed |
Luap99
left a comment
There was a problem hiding this comment.
Thanks for the PR.
As I noted on containers/common#2446 (review) I don't think this can work because the chroot extraction and thus ENOSPC can happen in a subprocess so the error is just a string not the actual ENOSPC object so this cannot match I believe.
Can you provide the full reproducer you used to test this patch?
(Note that this is platform-specific; testing on macOS or Windows would not show this.) |
|
I forgot about other platforms, I tested this on a fedora 41 by creating a filesystem with minimal storage and pointing Here's a bash script that basically reproduces the setting: |
common/libimage/load.go
Outdated
| if errors.As(err, &pathErr) && | ||
| !errors.Is(err, syscall.ENOTDIR) && | ||
| !errors.Is(err, syscall.ENOENT) { | ||
| return nil, fmt.Errorf("no space left on device: %s", pathErr.Path) |
There was a problem hiding this comment.
That’s just guessing, and discarding the original cause.
a5d33fc to
c8685cd
Compare
mtrmac
left a comment
There was a problem hiding this comment.
This is still discarding the original error value [maybe we would want to modify the text, but it is still valuable to retain the regional error so that errors.As works higher in the stack], and not handling chrootarchive; both from the very first #419 (comment) .
It works fine, after all we already use the monorepo in podman. It is your command which is wrong. The module name is |
Could you guide me in how can I test this for other platforms? |
|
any chance you would want to push this through or would you like someone to take this over? |
I would like to know if there is a way for me to test this on other platforms without replicating the environment from scratch on virtual machines. If that's the only way to test this for other platforms, then yes I would like for someone else to take over |
|
I suppose, for testing purposes, adding an if err != nil {
err = errors.New(err.Error())
}to the stub But, given that I expect that a real fix would involve detecting this error class in the |
|
I am running a Linux machine, I'll be happy to try again if I may |
|
Packit jobs failed. @containers/packit-build please check. |
1 similar comment
|
Packit jobs failed. @containers/packit-build please check. |
Signed-off-by: Mark Zvenigorodsky <mark.zvenigorodsky@gmail.com>
Fix: containers/podman#26197
When loading images, exit archive checks when receiving ENOSPC error, and display a clearer exit message for the user.
tests for podman at: containers/podman#27374