Bug 2186613

Summary: [abrt] mock: rmtree(): file_util.py:68:rmtree:OSError: [Errno 39] Directory not empty: '/var/lib/mock/fedora-rawhide-x86_64/root/builddir/build/BUILD/mesa-f8a8b7708e33ff22dd71c68830c33abe3fb1030a/redhat-linux-build/src/gallium/winsys/sw'
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: copr-team, jkeating, luca.giuzzi, mikhail.v.gavrilov, msuchy, pemensik, philip.wyett, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/a2506de0b34fe120d8704dc84b560e6868754db
Whiteboard: abrt_hash:b27e28405bf87a8580e9fcaa78488372714397d0;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-10 13:18:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: os_info
none
File: environ
none
File: mountinfo
none
File: open_fds
none
File: namespaces
none
File: backtrace
none
File: cpuinfo none

Description Mikhail 2023-04-13 20:03:04 UTC
Description of problem:
Break mock build

Version-Release number of selected component:
mock-3.5-2.fc38

Additional info:
reporter:       libreport-2.17.9
kernel:         6.3.0-0.rc6.20230412gite62252bc55b6.51.fc39.x86_64+debug
cmdline:        /usr/bin/python3 -tt /usr/libexec/mock/mock -r fedora-rawhide-x86_64 --resultdir /home/mikhail/packaging-work/mutter/results_mutter/44.0/4.fc39 --rebuild /home/mikhail/packaging-work/mutter/mutter-44.0-4.fc39.src.rpm
cgroup:         0::/user.slice/user-1000.slice/user/app.slice/app-org.gnome.Terminal.slice/vte-spawn-5595c7bd-4438-49b6-9bcd-144c74086b63.scope
uid:            0
reason:         file_util.py:68:rmtree:OSError: [Errno 39] Directory not empty: '/var/lib/mock/fedora-rawhide-x86_64/root/builddir/build/BUILD/mesa-f8a8b7708e33ff22dd71c68830c33abe3fb1030a/redhat-linux-build/src/gallium/winsys/sw'
executable:     /usr/libexec/mock/mock
type:           Python3
package:        mock-3.5-2.fc38
runlevel:       N 5
exception_type: KeyboardInterrupt
crash_function: rmtree
interpreter:    python3-3.11.3-1.fc39.x86_64
comment:        Break mock build

Truncated backtrace:
#1 [/usr/lib/python3.11/site-packages/mockbuild/file_util.py:68] rmtree
#2 [/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py:93] trace
#3 [/usr/lib/python3.11/site-packages/mockbuild/file_util.py:59] rmtree
#4 [/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py:93] trace
#5 [/usr/lib/python3.11/site-packages/mockbuild/file_util.py:59] rmtree
#6 [/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py:93] trace
#7 [/usr/lib/python3.11/site-packages/mockbuild/file_util.py:59] rmtree
#8 [/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py:93] trace
#9 [/usr/lib/python3.11/site-packages/mockbuild/file_util.py:59] rmtree
#10 [/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py:93] trace
#11 [/usr/lib/python3.11/site-packages/mockbuild/file_util.py:59] rmtree
#12 [/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py:93] trace
#13 [/usr/lib/python3.11/site-packages/mockbuild/buildroot.py:884] delete
#14 [/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py:93] trace
#15 [/usr/lib/python3.11/site-packages/mockbuild/backend.py:97] clean
#16 [/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py:93] trace
#17 [/usr/lib/python3.11/site-packages/mockbuild/rebuild.py:23] rebuild_generic

Comment 1 Mikhail 2023-04-13 20:03:08 UTC
Created attachment 1957379 [details]
File: os_info

Comment 2 Mikhail 2023-04-13 20:03:10 UTC
Created attachment 1957380 [details]
File: environ

Comment 3 Mikhail 2023-04-13 20:03:11 UTC
Created attachment 1957381 [details]
File: mountinfo

Comment 4 Mikhail 2023-04-13 20:03:13 UTC
Created attachment 1957382 [details]
File: open_fds

Comment 5 Mikhail 2023-04-13 20:03:15 UTC
Created attachment 1957383 [details]
File: namespaces

Comment 6 Mikhail 2023-04-13 20:03:17 UTC
Created attachment 1957384 [details]
File: backtrace

Comment 7 Mikhail 2023-04-13 20:03:19 UTC
Created attachment 1957385 [details]
File: cpuinfo

Comment 8 Miroslav Suchý 2023-04-14 06:25:19 UTC
Proposed fix:
https://github.com/rpm-software-management/mock/pull/1058

Comment 9 Pavel Raiskup 2023-08-10 13:05:17 UTC
*** Bug 2176689 has been marked as a duplicate of this bug. ***

Comment 10 Pavel Raiskup 2023-08-10 13:05:42 UTC
*** Bug 2177680 has been marked as a duplicate of this bug. ***

Comment 11 Pavel Raiskup 2023-08-10 13:06:06 UTC
*** Bug 2218922 has been marked as a duplicate of this bug. ***

Comment 12 Pavel Raiskup 2023-08-10 13:07:42 UTC
*** Bug 2169055 has been marked as a duplicate of this bug. ***

Comment 13 Pavel Raiskup 2023-08-10 13:08:15 UTC
*** Bug 2181641 has been marked as a duplicate of this bug. ***

Comment 14 Pavel Raiskup 2023-08-10 13:08:43 UTC
*** Bug 2213874 has been marked as a duplicate of this bug. ***

Comment 15 Pavel Raiskup 2023-08-10 13:18:47 UTC
(In reply to Miroslav Suchý from comment #8)
> Proposed fix:
> https://github.com/rpm-software-management/mock/pull/1058

The patch is merged now.  And I believe the following patch is actually going
to resolve all such problems in the future itself:
https://github.com/rpm-software-management/mock/pull/1133/files

Simply put, if any exception (including KeyboardInterrupt) was raised at
the same time Mock was installing something using a package manager, we
did not properly kill the orphaned in-chroot process, which blocked the
subsequent cleanup && umount.  This should be fixed in Mock 5.0+.

The exception (signal) handler is not immune against subsequent
KeyboardInterrupts - so users shouldn't press CTRL+C twice in a row.

Comment 16 Pavel Raiskup 2023-08-10 13:19:54 UTC
*** Bug 2176691 has been marked as a duplicate of this bug. ***