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):
Steps to Reproduce:
1. ssh to the box as root
2. su - USER (regular user)
3. dnf search '*dsd*'
Traceback (most recent call last):
File "/bin/dnf", line 35, in <module>
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
File "/usr/lib/python2.7/site-packages/dnf/base.py", line 207, in fill_sack
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
File "/usr/lib/python2.7/site-packages/dnf/util.py", line 49, in ensure_dir
File "/usr/lib/python2.7/os.py", line 150, in makedirs
File "/usr/lib/python2.7/os.py", line 157, in makedirs
OSError: [Errno 13] Permission denied: '/run/user/1001'
No traceback, dnf search results or appropriate error message.
Jaroslav, what is the fedora release the box is running and can you please link the systemd-logind bug?
(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).
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.
* 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:
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.