Bug 1224732 - [abrt] mock: buildroot.py:442:_setup_devices:OSError: [Errno 17] File exists
Summary: [abrt] mock: buildroot.py:442:_setup_devices:OSError: [Errno 17] File exists
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 21
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:5054a752909adbdee44c44ee533...
: 1228064 1236040 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-25 13:11 UTC by Jaroslav Škarvada
Modified: 2015-06-26 14:28 UTC (History)
12 users (show)

Fixed In Version: mock-1.2.10-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-09 15:15:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (1.98 KB, text/plain)
2015-05-25 13:11 UTC, Jaroslav Škarvada
no flags Details
File: environ (168 bytes, text/plain)
2015-05-25 13:11 UTC, Jaroslav Škarvada
no flags Details

Description Jaroslav Škarvada 2015-05-25 13:11:15 UTC
Description of problem:
mock -r fedora-rawhide-x86_64 --clean
mock -r fedora-rawhide-x86_64 --init
mock -r fedora-rawhide-x86_64 --install rrdtool
mock -r fedora-rawhide-x86_64 --shell

Version-Release number of selected component:
mock-1.2.8-1.fc21

Additional info:
reporter:       libreport-2.3.0
cmdline:        /usr/bin/python -tt /usr/sbin/mock -r fedora-rawhide-x86_64 --clean --init --install rrdtool
executable:     /usr/sbin/mock
kernel:         3.19.7-200.fc21.x86_64
runlevel:       N 5
type:           Python
uid:            0

Truncated backtrace:
buildroot.py:442:_setup_devices:OSError: [Errno 17] File exists

Traceback (most recent call last):
  File "/usr/sbin/mock", line 831, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 84, in trace
    result = func(*args, **kw)
  File "/usr/sbin/mock", line 653, in main
    run_command(options, args, config_opts, commands, buildroot, state)
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 84, in trace
    result = func(*args, **kw)
  File "/usr/sbin/mock", line 708, in run_command
    commands.init()
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 84, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.7/site-packages/mockbuild/backend.py", line 123, in init
    self.buildroot.initialize(**kwargs)
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 84, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.7/site-packages/mockbuild/buildroot.py", line 84, in initialize
    self._init(prebuild=prebuild, do_log=do_log)
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 84, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.7/site-packages/mockbuild/buildroot.py", line 128, in _init
    self._setup_devices()
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 84, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.7/site-packages/mockbuild/buildroot.py", line 442, in _setup_devices
    os.symlink("/proc/self/mounts", self.make_chroot_path('etc', 'mtab'))
OSError: [Errno 17] File exists

Local variables in innermost frame:
i: (8630, 1282, 'dev/ptmx')
devFiles: [(8630, 259, 'dev/null'), (8630, 263, 'dev/full'), (8630, 261, 'dev/zero'), (8630, 264, 'dev/random'), (8484, 265, 'dev/urandom'), (8630, 1280, 'dev/tty'), (8576, 1281, 'dev/console'), (8630, 1282, 'dev/ptmx')]
prevMask: 2
self: <mockbuild.buildroot.Buildroot object at 0x7f8ee75611d0>
kver: '3.19.7-200.fc21.x86_64'

Comment 1 Jaroslav Škarvada 2015-05-25 13:11:18 UTC
Created attachment 1029458 [details]
File: backtrace

Comment 2 Jaroslav Škarvada 2015-05-25 13:11:19 UTC
Created attachment 1029459 [details]
File: environ

Comment 3 Jaroslav Škarvada 2015-05-25 13:12:37 UTC
It's very annoying that I have to each time run:
# sudo rm -f /var/lib/mock/fedora-rawhide-x86_64/root/etc/mtab

to fix the problem.

Comment 4 Jerry James 2015-05-28 20:37:28 UTC
In mockbuild/buildroot.py, lines 440-442 are (minus some whitespace):

    if os.path.isfile(self.make_chroot_path('etc', 'mtab')):
        os.remove(self.make_chroot_path('etc', 'mtab'))
    os.symlink("/proc/self/mounts", self.make_chroot_path('etc', 'mtab'))

The problem is that os.path.isfile returns false for a symbolic link.  Possible solutions:
- Do the remove if either os.path.isfile or os.path.islink returns true
- Change os.path.isfile to os.path.lexists
- Nuke the check altogether and call os.remove every time

Comment 5 Miroslav Suchý 2015-06-01 08:14:45 UTC
This was fixed in upstream in commit
  cd3406f2eb4449a442e15bb8b1653436585c7c1c

Comment 6 Radek Holy 2015-06-02 12:35:57 UTC
Any estimated date of a new release for F21? This really blocks our CI [1] since I don't see any obvious workaround. (AFAIK I cannot do the trick in comment 3 when using tito)

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1225015#c4

Comment 7 Miroslav Suchý 2015-06-02 14:01:46 UTC
I will do the release of new version today.

Comment 8 Miroslav Suchý 2015-06-04 11:33:11 UTC
*** Bug 1228064 has been marked as a duplicate of this bug. ***

Comment 9 Fedora Update System 2015-06-04 11:34:58 UTC
mock-1.2.10-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/mock-1.2.10-1.fc22

Comment 10 Fedora Update System 2015-06-04 11:38:05 UTC
mock-1.2.10-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.10-1.fc21

Comment 11 Fedora Update System 2015-06-04 11:39:09 UTC
mock-1.2.10-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.10-1.fc20

Comment 12 Fedora Update System 2015-06-04 11:41:32 UTC
mock-1.2.10-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.10-1.el7

Comment 13 Fedora Update System 2015-06-04 11:42:15 UTC
mock-1.2.10-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.10-1.el6

Comment 14 Radek Holy 2015-06-04 11:49:09 UTC
Many thanks!

Comment 15 Fedora Update System 2015-06-04 15:55:08 UTC
Package mock-1.2.10-1.el7:
* should fix your issue,
* was pushed to the Fedora EPEL 7 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.2.10-1.el7'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2015-6557/mock-1.2.10-1.el7
then log in and leave karma (feedback).

Comment 16 Fedora Update System 2015-06-09 15:15:20 UTC
mock-1.2.10-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Sergio Basto 2015-06-09 20:09:50 UTC
Another user experienced a similar problem:

fedora-review -b 1229518

reporter:       libreport-2.3.0
cmdline:        /usr/bin/python -tt /usr/sbin/mock --no-cleanup-after --no-clean --resultdir=/home/sergio/fedora-scm/gdesklets/1229518-gdesklets/results -q --chroot -- 'rpm --eval %_topdir'
executable:     /usr/sbin/mock
kernel:         4.0.4-202.fc21.x86_64
package:        mock-1.2.9-1.fc21
reason:         buildroot.py:442:_setup_devices:OSError: [Errno 17] File exists
runlevel:       N 5
type:           Python
uid:            0

Comment 18 Fedora Update System 2015-06-18 13:22:34 UTC
mock-1.2.10-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2015-06-18 13:27:27 UTC
mock-1.2.10-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Fedora Update System 2015-06-20 21:09:39 UTC
mock-1.2.10-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 21 Fedora Update System 2015-06-20 21:12:58 UTC
mock-1.2.10-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 22 Miroslav Suchý 2015-06-26 14:28:22 UTC
*** Bug 1236040 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.