Bug 1117293 - --installroot proceeds with an undefined conf.releasever
Summary: --installroot proceeds with an undefined conf.releasever
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Ales Kozumplik
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-08 12:57 UTC by Michal Schmidt
Modified: 2014-09-30 23:42 UTC (History)
5 users (show)

Clone Of:
Last Closed: 2014-07-19 06:03:15 UTC

Attachments (Terms of Use)

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
AttributeError: 'NoneType' object has no attribute 'encode'

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

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

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.

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.

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