buildah-build icon indicating copy to clipboard operation
buildah-build copied to clipboard

[BUG] Buildah not running as root on self hosted runners

Open omer2500 opened this issue 2 years ago • 3 comments

Version

redhat-actions/buildah-build@v2

Describe the bug

When using self hosted runner that runs ubuntu 22.04 the default user is "runner" instead of root this causes errors related to permission to some folders and files. although we have option to run as root user but its only when you use sudo command which is not possible with this action

for example:

Error processing tar file(exit status 1): potentially insufficient UIDs or GIDs available in user namespace (requested 0:50 for /var/local): Check /etc/subuid and /etc/subgid: lchown /var/local: invalid argument
time="2023-08-28T19:49:27Z" level=error msg="exit status 125"

and

time="2023-08-28T19:49:26Z" level=warning msg="error running newgidmap: exit status 1: newgidmap: write to gid_map failed: Operation not permitted\n"
time="2023-08-28T19:49:26Z" level=warning msg="falling back to single mapping"
time="2023-08-28T19:49:26Z" level=warning msg="error running newuidmap: exit status 1: newuidmap: write to uid_map failed: Operation not permitted\n"
time="2023-08-28T19:49:26Z" level=warning msg="falling back to single mapping"

When i run the buildah command with sudo (not part of the action) everything is working

sudo /usr/bin/buildah bud .....

Steps to reproduce, workflow links, screenshots

Use ARC (actions controller runner) with the runner image: "summerwind/actions-runner:ubuntu-22.04"

omer2500 avatar Aug 29 '23 04:08 omer2500

#126

omer2500 avatar Aug 29 '23 17:08 omer2500

I have the exact same problem right now and it took ma almost a day to find this issue. Thanks a lot and I hope the PR will be merged soon.

joerg avatar Nov 28 '23 09:11 joerg

I have the exact same problem right now and it took ma almost a day to find this issue. Thanks a lot and I hope the PR will be merged soon.

Hi! @joerg if it relevant to you we ended up doing a workaround, we are using the cli of buildah and podman directly

omer2500 avatar Dec 16 '23 20:12 omer2500