Description of problem: Dnf search can cause traceback while running under su - USER. This is probably related to the systemd-logind bug, but dnf shouldn't behave this way. In case it is not possible to workaround this problem, dnf should exit with proper error message. Version-Release number of selected component (if applicable): dnf-0.4.8-1.fc20.noarch How reproducible: Always Steps to Reproduce: 1. ssh to the box as root 2. su - USER (regular user) 3. dnf search '*dsd*' Actual results: Traceback (most recent call last): File "/bin/dnf", line 35, in <module> main.user_main(sys.argv[1:], exit_code=True) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 279, in user_main errcode = main(args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 64, in main return _main(base, args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 135, in _main result, resultmsgs = cli.run() File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1404, in run load_available_repos=lar) File "/usr/lib/python2.7/site-packages/dnf/base.py", line 207, in fill_sack with dnf.lock.metadata_cache_lock: File "/usr/lib/python2.7/site-packages/dnf/lock.py", line 71, in __enter__ pid = self._read_lock() File "/usr/lib/python2.7/site-packages/dnf/lock.py", line 40, in _read_lock with open(self._target, 'r') as f: File "/usr/lib/python2.7/site-packages/dnf/util.py", line 110, in cached_getter val = fn(obj) File "/usr/lib/python2.7/site-packages/dnf/lock.py", line 50, in _target dnf.util.ensure_dir(user_run_dir) File "/usr/lib/python2.7/site-packages/dnf/util.py", line 49, in ensure_dir os.makedirs(dname, mode=0o755) File "/usr/lib/python2.7/os.py", line 150, in makedirs makedirs(head, mode) File "/usr/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 13] Permission denied: '/run/user/1001' Expected results: No traceback, dnf search results or appropriate error message. Additional info:
Jaroslav, what is the fedora release the box is running and can you please link the systemd-logind bug? Thank you!
(In reply to Ales Kozumplik from comment #1) > Jaroslav, what is the fedora release the box is running and can you please > link the systemd-logind bug? > It is F20 i686, the systemd-logind bug 753882.
weird, I explicitly rejected a patch using XDG_RUNTIME_DIR. will take a look (low prio now).
reproduced.
Jaroslav, a workaround is to log in with the regular user at least once, systemd then creates the directory through some mechanism. It's probably a flaw in the filesystem hierarchy design that /run/user is not writable by the regular user.
dnf handles the traceback gracefully starting with 73d2d46. I got no reply when asking the Plumbers Team how to create the directory manually under scenarios like this.
dnf-0.4.10-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/dnf-0.4.10-1.fc20
Package dnf-0.4.10-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 dnf-0.4.10-1.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-0089/dnf-0.4.10-1.fc20 then log in and leave karma (feedback).
dnf-0.4.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.