Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1162720 - --copyout prints confusing errors when the copied file doesn't exist
Summary: --copyout prints confusing errors when the copied file doesn't exist
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michael Simacek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-11 14:39 UTC by Vít Ondruch
Modified: 2015-01-06 02:06 UTC (History)
7 users (show)

Fixed In Version: mock-1.2.3-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-12 04:07:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Vít Ondruch 2014-11-11 14:39:54 UTC
Description of problem:
$ -r ruby --copyout '~/ruby/tmp/ruby*.tar.bz2' .
INFO: mock.py version 1.2.0 starting (python version = 2.7.5)...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
Start: chroot init
INFO: calling preinit hooks
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Mock Version: 1.2.0
INFO: Mock Version: 1.2.0
Finish: chroot init
INFO: copying /var/lib/mock/ruby/root/~/ruby/tmp/ruby*.tar.bz2 to .
Traceback (most recent call last):
  File "/usr/sbin/mock", line 809, 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 649, in main
    buildroot.finalize()
  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 472, in finalize
    shutil.rmtree(d)
  File "/usr/lib64/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib64/python2.7/shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "/usr/lib64/python2.7/shutil.py", line 250, in rmtree
    os.remove(fullname)
OSError: [Errno 13] Permission denied: '/tmp/tmpLFJgb5/lib64/nosync.so'
WARNING: unable to delete selinux filesystems (/tmp/mock-selinux-plugin.fHlGPR): [Errno 1] Operation not permitted: '/tmp/mock-selinux-plugin.fHlGPR'


Version-Release number of selected component (if applicable):
$ rpm -q nosync
nosync-1.0-1.fc20.x86_64
nosync-1.0-1.fc20.i686


How reproducible:


Steps to Reproduce:
1. mock -r ruby --copyout '~/ruby/tmp/ruby*.tar.bz2' .
2.
3.

Actual results:
OSError: [Errno 13] Permission denied: '/tmp/tmpLFJgb5/lib64/nosync.so'
WARNING: unable to delete selinux filesystems (/tmp/mock-selinux-plugin.fHlGPR): [Errno 1] Operation not permitted: '/tmp/mock-selinux-plugin.fHlGPR'


Expected results:
It should copy file.

Additional info:

Comment 1 Vít Ondruch 2014-11-11 14:46:18 UTC
Actually, this might not be nosync issues, but LVM issues. I disabled the nosync in configuration and now I observe similar, but different error:

$ mock -r ruby --copyout ~/ruby/tmp/ruby*.tar.bz2 .
INFO: mock.py version 1.2.0 starting (python version = 2.7.5)...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
Start: chroot init
INFO: calling preinit hooks
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Mock Version: 1.2.0
INFO: Mock Version: 1.2.0
Finish: chroot init
INFO: copying /var/lib/mock/ruby/root/home/vondruch/ruby/tmp/ruby*.tar.bz2 to .

ERROR: [Errno 1] Operation not permitted: '/tmp/tmpRseVxV'

ERROR: The most common cause for this error is trying to run /usr/sbin/mock as an unprivileged user.
ERROR: Check your path to make sure that /usr/bin/ is listed before /usr/sbin, or manually run /usr/bin/mock to see if that fixes this problem.

WARNING: unable to delete selinux filesystems (/tmp/mock-selinux-plugin.LRz3SW): [Errno 1] Operation not permitted: '/tmp/mock-selinux-plugin.LRz3SW'


Reassigning this bug to mock.

Comment 2 Michael Simacek 2014-11-11 16:11:14 UTC
Mock doesn't do any shell globbing, so the file with astreisk in the name doesn't exist and that's the reason why it didn't work. The errors are just triggered by finally/atexit handlers not being run as root, hiding the real cause. The exception handling needs to deal with priviledge problems.

Comment 3 Michael Simacek 2014-11-13 15:12:24 UTC
The errors should be improved in b872b81. Globbing and tilde expansion implemented in 2f45366.

Comment 4 Fedora Update System 2014-11-16 17:37:09 UTC
mock-1.2.1-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc21

Comment 5 Fedora Update System 2014-11-16 17:38:34 UTC
mock-1.2.1-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc20

Comment 6 Fedora Update System 2014-11-16 17:39:25 UTC
mock-1.2.1-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.el7

Comment 7 Fedora Update System 2014-11-16 17:40:23 UTC
mock-1.2.1-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.el6

Comment 8 Fedora Update System 2014-11-17 06:29:27 UTC
Package mock-1.2.1-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mock-1.2.1-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-15217/mock-1.2.1-1.fc20
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2014-12-04 12:06:47 UTC
mock-1.2.3-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc21

Comment 10 Fedora Update System 2014-12-04 12:10:17 UTC
mock-1.2.3-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc20

Comment 11 Fedora Update System 2014-12-04 12:11:14 UTC
mock-1.2.3-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.el7

Comment 12 Fedora Update System 2014-12-12 04:07:42 UTC
mock-1.2.3-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 13 Fedora Update System 2014-12-17 04:42:46 UTC
mock-1.2.3-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 14 Fedora Update System 2015-01-06 02:06:30 UTC
mock-1.2.3-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.


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