Bug 1597005 - int(misc.getloginuid()), but getloginuid() can return None (dnf/db/history.py)
Summary: int(misc.getloginuid()), but getloginuid() can return None (dnf/db/history.py)
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 29
Hardware: riscv64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords: Triaged
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-01 12:09 UTC by David Abdurachmanov
Modified: 2018-09-30 21:45 UTC (History)
6 users (show)

(edit)
Clone Of:
(edit)
Last Closed:


Attachments (Terms of Use)

Description David Abdurachmanov 2018-07-01 12:09:42 UTC
Description of problem:

Fedora/RISC-V (riscv64) kernel does not have /proc/self/loginuid thus misc.getloginuid() returns None and then the conversion to int fails. This happens while running appliance-creator to create nightly disk images.

https://github.com/rpm-software-management/dnf/blob/58197bd1207525fd28cc135f88c2b988357daf5d/dnf/db/history.py#L448

[..]
RPMDB altered outside of DNF.
['/']
Traceback (most recent call last):
  File "/usr/bin/appliance-creator", line 173, in <module>
    sys.exit(main())
  File "/usr/bin/appliance-creator", line 151, in main
    creator.install()
  File "/usr/lib/python2.7/site-packages/imgcreate/creator.py", line 726, in install
    dbo.runInstall()
  File "/usr/lib/python2.7/site-packages/imgcreate/dnfinst.py", line 211, in runInstall
    ret = self.do_transaction(TransactionProgress())
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 904, in do_transaction
    self._run_transaction(cb=cb)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 974, in _run_transaction
    tid = self.history.beg(rpmdbv, using_pkgs, [], cmdline)
  File "/usr/lib/python2.7/site-packages/dnf/db/history.py", line 448, in beg
    int(misc.getloginuid())
TypeError: int() argument must be a string or a number, not 'NoneType'
Unmounting directory /var/tmp/imgcreate-eGs3tj/install_root/
Removing compat symlinks
Unmapping /dev/loop0
Losetup remove /dev/loop0
[..]

Version-Release number of selected component (if applicable):

We moved to DNF 3.0.2 and this started to happen. This particular code was added ~5 months ago and landed in DNF 3.

How reproducible:

Boot in Fedora/RISC-V QEMU, e.g.: https://fedorapeople.org/groups/risc-v/disk-images/

[root@hifive ~]# cat /proc/self/loginuid
cat: /proc/self/loginuid: No such file or directory

[root@hifive ~]# python
Python 2.7.15 (default, May  7 2018, 14:37:14) 
[GCC 8.1.1 20180502 (Red Hat 8.1.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from dnf.yum import misc
>>> a = misc.getloginuid()
>>> type(a)
<type 'NoneType'>
>>> print(a)
None

Comment 1 larchunix 2018-07-03 12:51:32 UTC
Dear DNF developers,

I am the maintainer of DNF package on the ArchLinux User Repository (https://aur.archlinux.org/packages/dnf/).

Since ArchLinux kernel is compiled without audit support, DNF 3 does not work on Arch because of this issue.

This prevents me to push DNF 3 to the AUR until this bug gets fixed. 

Best regards,

Comment 2 Jan Kurik 2018-08-14 09:56:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.


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