-
Notifications
You must be signed in to change notification settings - Fork 783
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
Commit "Permission denied" #3254
Comments
Is it an SELinux issue? Could you setenforce 0 and then commit? |
I thought you'd nailed it, but unfortunately no. Set to permissive through the entire image build process (described above), and still "permission denied". |
Ok try it as root, if it works there Then this is something about user namespace. Can you run the buildah commit while in the buildah unshare? |
The unprived user I'm building the postgres image as (davical) seems to be unable to write to "/home/bill/davical/.local/share/containers/storage/overlay/ee1ef7bd57bf05e031180dd056bd7a4f4513053427e659289c4d50a24d4d74f3/merged/etc/gshadow: permission denied" which is owned by primary user 'bill'. But I don't know what to do about this because each container will have its own user and all are built under /home/bill. I've set /home/bill/.local/share/containers and below all to 777 but it does not help. Always the same error. SELinux=Permissive. |
Can not run the commit while in unshare. Same error. Must go to work so will try as root tomorrow. |
Yes I can commit as root. But not knowing the complex mechanisms of a commit I have no idea where to look nor what to do to fix my permissions problem. All directories down through ~/.local/share/containers/storage/ are 755. I can't give all the unprived users of all the containers, write permission to this area. |
I just dealt with an issue that feels similar to this. Are you sudo davical before running Podman? If so then we had a similar issue to this and it was fixed via sudo -i davical Basically the $HOME was still pointing to the /home/bill even though you were switching to a different user. |
Actually I ssh to the router (the target machine in question - 10.2.1.1) as user davical, and do all operations that way. davical's home directory is /home/bill/davical . As I don't know how buildah goes about its work (and it's not documented anywhere that I can find) I don't know where the permissions problem may be. |
Anyone advise how buildah works? |
Does buildah work with a simple Containerfile?
If yes then there is something in the Image you are building that it can not write. Usually "permission denied" is caused by SELinux, User Namespaces (UIDs/GIDs that you are not able to read/write) or potentially issues in the kernel you are using not being new enough for the versions of tools Buildah, Crun, and Fuse-overlayfs. |
Well even with just: same error. SELinux is permissive. I'll try a new KVM VM image. |
buildah cat /proc/self/uid_map Is there something strange about the homedir contents? |
-bash-5.1$ buildah cat /proc/self/uid_map Did you mean this? -bash-5.1$ |
Sorry |
A friendly reminder that this issue had no activity for 30 days. |
@quantum77 Is this still an issue. You never gave any more feedback. |
BUG REPORT INFORMATION
Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST
-->
Description
Trying to commit a container to image, get "permission denied".
Steps to reproduce the issue:
Add some more config info:
$ buildah config --env DO_IPV6="no" --label "io.containers.autoupdate=image" $container
Set cmd and external config
$ buildah config --cmd=/usr/lib/systemd/systemd $container
Mount the container’s root filesystem to copy config
$ buildah unshare
# buildah containers
# buildah mount {CID}
# mkdir -p /home/bill/davical/postgresql/etc/postgresql-setup/upgrade
# cp -r /var/home/bill/davical/.local/share/containers/.../etc/postgresql-setup/upgrade/postgresql.conf etc/postgresql-setup/upgrade/
# mkdir -p /home/bill/davical/postgresql/var/lib/pgsql
# cp -r /var/home/bill/davical/.local/share/containers/.../var/lib/pgsql var/lib/
# buildah containers
# buildah umount {CID}
# exit
error committing container "fedora-working-container" to "postgresql_image": error copying layers and metadata for container "8f316d471d9a65ad1c793376a23a6e1689a627fbe6751c0a084604d4db0e45bf": Error initializing source containers-storage:fedora-working-container: error extracting layer "cb50b4a715ae75d61f0528bf549d970c811a345950febd6ef8025f112dc32835": lgetxattr /home/bill/davical/.local/share/containers/storage/overlay/ee1ef7bd57bf05e031180dd056bd7a4f4513053427e659289c4d50a24d4d74f3/merged/etc/gshadow: permission denied
ERRO exit status 125
Describe the results you received:
"permission denied", even when trying to commit in buildah unshare shell.
Describe the results you expected:
A commit.
Output of
rpm -q buildah
orapt list buildah
:Output of
buildah version
:Output of
podman version
if reporting apodman build
issue:Output of
cat /etc/*release
:Linux aquarius.darkmtter.org 5.11.15-300.fc34.x86_64 #1 SMP Fri Apr 16 13:41:48 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
(paste your output here)
The text was updated successfully, but these errors were encountered: