Bug 1117293

Summary: --installroot proceeds with an undefined conf.releasever
Product: [Fedora] Fedora Reporter: Michal Schmidt <mschmidt>
Component: dnfAssignee: Ales Kozumplik <akozumpl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: akozumpl, jzeleny, pnemade, rholy, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hawkey-0.4.18-2.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-19 06:03:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Schmidt 2014-07-08 12:57:46 UTC
Description of problem:
I got a traceback from dnf:

$ sudo dnf --installroot=/home/michich/fedora-tree  install systemd passwd dnf fedora-release vim-minimal
...
Transaction Summary
========================================================================
Install  131 Packages

Total download size: 64 M
Installed size: 296 M
Is this ok [y/N]: y
...
  Installing  : libreport-filesystem-2.2.2-5.fc21.x86_64      128/131
  Installing  : dnf-0.5.3-1.fc21.noarch                       129/131
  Installing  : passwd-0.79-3.fc21.x86_64                     130/131
  Installing  : vim-minimal-2:7.4.307-2.fc21.x86_64           131/131 
  Verifying   : systemd-215-2.fc21.x86_64                       1/131 
Traceback (most recent call last):
  File "/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 200, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 83, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 140, in _main
    ret = resolving(cli, base)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 165, in resolving
    return_code, resultmsgs = base.do_transaction()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 233, in do_transaction
    return_code, resultmsgs = super(BaseCli, self).do_transaction(display)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 634, in do_transaction
    return_code = self.runTransaction(cb=cb)
  File "/usr/lib/python2.7/site-packages/dnf/lock.py", line 93, in wrapped
    return fn(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 744, in runTransaction
    self.verify_transaction(return_code, cb.verify_tsi_package)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 808, in verify_transaction
    yumdb_info.releasever = self.conf.releasever
  File "/usr/lib/python2.7/site-packages/dnf/yum/rpmsack.py", line 295, in __setattr__
    self._write(attr, value)
  File "/usr/lib/python2.7/site-packages/dnf/yum/rpmsack.py", line 232, in _write
    dnf.pycomp.write_to_file(fo, value)
  File "/usr/lib/python2.7/site-packages/dnf/pycomp.py", line 75, in write_to_file
    f.write(content.encode('utf-8'))
AttributeError: 'NoneType' object has no attribute 'encode'


Version-Release number of selected component (if applicable):
dnf-0.5.3-1.fc21.noarch
hawkey-0.4.17-1.fc21.x86_64
librepo-1.7.4-3.fc21.x86_64
rpm-4.11.90-0.git12844.5.fc21.x86_64


How reproducible:
2 of 2 tries, so maybe always

Steps to Reproduce:
1. sudo dnf --installroot=/home/michich/fedora-tree  install systemd passwd dnf fedora-release vim-minimal
2.
3.

Actual results:
The above traceback at the "Verifying" stage.

Expected results:
successful finish

Comment 1 Ales Kozumplik 2014-07-08 16:06:52 UTC
Interesting, looks like we end up with undefined releasever on a --installroot described in comment 0.

Comment 2 Radek Holy 2014-07-09 07:04:40 UTC
Well, it's not that interesting as it behaves the same as Yum (except the unhandled exception). With Yum, you always have to specify --releasever, if the chroot is empty.

Comment 3 Ales Kozumplik 2014-07-09 07:24:37 UTC
I see, thanks Radek!

Comment 4 Ales Kozumplik 2014-07-09 11:23:22 UTC
Fixed by 7f0496c.

Comment 5 Fedora Update System 2014-07-17 06:42:44 UTC
hawkey-0.4.18-2.fc20, dnf-0.5.4-1.fc20, libsolv-0.6.4-0.git2a5c1c4.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/hawkey-0.4.18-2.fc20,dnf-0.5.4-1.fc20,libsolv-0.6.4-0.git2a5c1c4.fc20

Comment 6 Fedora Update System 2014-07-19 06:03:15 UTC
hawkey-0.4.18-2.fc20, dnf-0.5.4-1.fc20, libsolv-0.6.4-0.git2a5c1c4.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.