Bug 1761201

Summary: ERROR: [Errno 1] Operation not permitted: '/var/lib/mock/fedora-29-x86_64/root/proc/fb'
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: jdisnard, jkeating, mebrown, msuchy, philip.wyett, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-13 17:46:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miro Hrončok 2019-10-13 11:30:47 UTC
===================================================================

$ mock -r fedora-29-x86_64 clean
INFO: mock.py version 1.4.20 starting (python version = 3.7.4)...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
INFO: Signal handler active
Start: run
Start: clean chroot

ERROR: [Errno 1] Operation not permitted: '/var/lib/mock/fedora-29-x86_64/root/proc/fb'

ERROR: The most common cause for this error is trying to run /usr/libexec/mock/mock as an unprivileged user.
ERROR: You should not run /usr/libexec/mock/mock directly.

===================================================================

I'm, not running /usr/libexec/mock/mock directly.

Something is probably broken with that mock (other mocks are OK).

1. Is it safe to `sudo rm -rf /var/lib/mock/fedora-29-x86_64`?
2. Why is mock thinking I'm running /usr/libexec/mock/mock as an unprivileged user?

I have mock-1.4.20-1.fc30, mock-core-configs-31.6-1.fc30.

Comment 1 Pavel Raiskup 2019-10-13 15:41:01 UTC
Seems like duplicate to 1756972.  Can you please try mock from
dnf copr enable praiskup/mock-fixes? (mock-1.4.20-1.git.5.fe9bfeb)

Comment 2 Pavel Raiskup 2019-10-13 15:48:23 UTC
Hmm, but wait - I see 'selinux disabled'.  Is that expected?

Not sure now.  If you can reproduce
the problem with version 1.git.5.fe9bfeb (even after reboot, because your
box can be in invalid state), I'll probably need more info (full configuration,
etc., plus --verbose --trace output).

> 1. Is it safe to `sudo rm -rf /var/lib/mock/fedora-29-x86_64`?

This most likely will fail, there likely are some mount points.

> 2. Why is mock thinking I'm running /usr/libexec/mock/mock as an unprivileged user?

Because some OSError permission exception was raised, and bubbled up
to main() function for some reason.  This is hint for users who don't
know they should be in 'mock' group, IIUC.

Comment 3 Miro Hrončok 2019-10-13 16:07:50 UTC
Hmm, this is weird:

$ sudo setenforce 1
setenforce: SELinux is disabled

Comment 4 Pavel Raiskup 2019-10-13 17:00:31 UTC
Yes, looks like bug 1756972;  and the fix is IMO
https://github.com/rpm-software-management/mock/pull/371

The thing is that installing `selinux-policy-*` packages into
nspawn chroot broke host's selinux before.  And any other attempt
to work with chroot can fail with EPERM, because of selinux.

I think you need to restore your selinux (reboot does the job).

Comment 5 Miro Hrončok 2019-10-13 17:46:24 UTC
Rebooted, selinux is up, and I can clean.

*** This bug has been marked as a duplicate of bug 1756972 ***