-
Notifications
You must be signed in to change notification settings - Fork 38
common: abort load on ENOSPC and output clear error #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
common/libimage/load.go
Outdated
| logrus.Debugf("Error loading %s (%s): %v", path, transportName, err) | ||
|
|
||
| if errors.Is(err, syscall.ENOSPC){ | ||
| return nil, fmt.Errorf("no space left on device") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do do that, that throws away the full error context, i.e. you don't even know which file was attempted to write.
This must still return err.
(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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s just guessing, and discarding the original cause.
a5d33fc to
c8685cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Signed-off-by: Mark Zvenigorodsky <[email protected]>
Could you guide me in how can I test this for other platforms? |
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