You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
I'm aware running podman commit then pulling the power is not supported, but I'm hoping the most obvious errors can be squashed if traced down precisely enough.
If these issues are not enough I can afford some time to make it into PRs, but someone familiar with the code will probably fix it much faster than myself so I'm thinking my time is better spent finding more issues. Please tell me if I'm wrong.
Steps to reproduce the issue:
run some container e.g. podman run -ti --name test --replace localhost/test and change something inside
commit and pull the plug: podman commit test test, echo c > /proc/sysrq-trigger
try to list/run/inspect new image after reboot
Describe the results you received:
armadillo:~# podman image inspect test
Error: readlink /var/lib/containers/storage/overlay: invalid argument
Running with strace, it's because /var/lib/containers/storage/overlay/22796afe2874d426a1c46770f63c639030d993a6df09fb70909e675922f7e8c4/lower has been created with no data (empty file), so /var/lib/containers/storage/overlay/<content of lower file> is not found which normally leads to stat+readlink, except that readlink on a directory does not work when flie is empty.
(By the way, writting something that doesn't exist e.g. "foo" in the file leads podman to as it writes the invalid path to link file then loops reading link file and trying to check overlay/l/<link content> forever -- this probably warrants failing if overlay/l/ does not exist)
Describe the results you expected:
error should state image is invalid and suggest deleting it
(I don't think it should delete anything automatically, but giving the user a clear command on how to move forward from there is probably good)
Output of podman version:
Version: 3.4.2
API Version: 3.4.2
Go Version: go1.17.3
Git Commit: d800e4f57e9388a4cd4e5d9321b4594f552bc5d7
Built: Sun Nov 14 04:26:13 2021
OS/Arch: linux/arm64
(same behaviour on 3.2.3)
By the way, I think it'd make a lot of sense to issue a fssync() at the end of podman commit (or more precisely the part of podman commit that stores to disk and is shared with pull etc -- after messages Storing signatures and printing image id), that'd probably avoid most of the bug reports that came back to me because of similar issues -- what do you think?
After #1351 and #1407 (and some earlier changes), a layer being committed should be, durably (with fdatasync) recorded as incomplete, and thus, a sudden reboot while creating the layer should cause the layer to be automatically removed on next Podman start.
Of course, if the commit succeeds, and durably records to the metadata that it succeeded, but the layer data like the lower file (which do not use fdatasync) is not written to disk by that time, this does not help: the layer will be recorded as fully-formed but the contents are corrupt.
Thank you!
I don't think we can do much about the content itself short of issuing a system-wide sync, and that has its own problems so I wouldn't suggest that. I'm fine as long as podman commands keep working.
I'll try to build a podman version with these and confirm, but we can probably close this and assume it's correct -- likely won't have time to test in the coming weeks.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
I'm aware running
podman commit
then pulling the power is not supported, but I'm hoping the most obvious errors can be squashed if traced down precisely enough.If these issues are not enough I can afford some time to make it into PRs, but someone familiar with the code will probably fix it much faster than myself so I'm thinking my time is better spent finding more issues. Please tell me if I'm wrong.
Steps to reproduce the issue:
run some container e.g.
podman run -ti --name test --replace localhost/test
and change something insidecommit and pull the plug:
podman commit test test
,echo c > /proc/sysrq-trigger
try to list/run/inspect new image after reboot
Describe the results you received:
Running with strace, it's because
/var/lib/containers/storage/overlay/22796afe2874d426a1c46770f63c639030d993a6df09fb70909e675922f7e8c4/lower
has been created with no data (empty file), so/var/lib/containers/storage/overlay/<content of lower file>
is not found which normally leads to stat+readlink, except that readlink on a directory does not work when flie is empty.(By the way, writting something that doesn't exist e.g. "foo" in the file leads podman to as it writes the invalid path to
link
file then loops readinglink
file and trying to checkoverlay/l/<link content>
forever -- this probably warrants failing if overlay/l/ does not exist)Describe the results you expected:
error should state image is invalid and suggest deleting it
(I don't think it should delete anything automatically, but giving the user a clear command on how to move forward from there is probably good)
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
No, yes
Additional environment details (AWS, VirtualBox, physical, etc.):
barebone embedded system
The text was updated successfully, but these errors were encountered: