Bug 1332538 - pyanaconda.packaging.PayloadError: DNF error: error reading package headerTraceback (most recent call last):
Summary: pyanaconda.packaging.PayloadError: DNF error: error reading package headerTra...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libdnf
Version: 24
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:f81ab29f15841ffd914786d8638...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-03 12:36 UTC by Dale Turner
Modified: 2017-02-08 15:16 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-08 15:16:51 UTC
Type: ---


Attachments (Terms of Use)
File: anaconda-tb (2.10 MB, text/plain)
2016-05-03 12:36 UTC, Dale Turner
no flags Details
File: anaconda.log (411.66 KB, text/plain)
2016-05-03 12:36 UTC, Dale Turner
no flags Details
File: dnf.log (264.53 KB, text/plain)
2016-05-03 12:36 UTC, Dale Turner
no flags Details
File: dnf.rpm.log (147 bytes, text/plain)
2016-05-03 12:36 UTC, Dale Turner
no flags Details
File: environ (459 bytes, text/plain)
2016-05-03 12:36 UTC, Dale Turner
no flags Details
File: lsblk_output (2.89 KB, text/plain)
2016-05-03 12:37 UTC, Dale Turner
no flags Details
File: lvm.log (206.01 KB, text/plain)
2016-05-03 12:37 UTC, Dale Turner
no flags Details
File: nmcli_dev_list (1.58 KB, text/plain)
2016-05-03 12:37 UTC, Dale Turner
no flags Details
File: os_info (449 bytes, text/plain)
2016-05-03 12:37 UTC, Dale Turner
no flags Details
File: program.log (196.65 KB, text/plain)
2016-05-03 12:37 UTC, Dale Turner
no flags Details
File: storage.log (281.58 KB, text/plain)
2016-05-03 12:37 UTC, Dale Turner
no flags Details
File: syslog (332.30 KB, text/plain)
2016-05-03 12:37 UTC, Dale Turner
no flags Details
File: ifcfg.log (2.58 KB, text/plain)
2016-05-03 12:37 UTC, Dale Turner
no flags Details
File: packaging.log (110.45 KB, text/plain)
2016-05-03 12:37 UTC, Dale Turner
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1383565 0 high CLOSED segmentation fault when Sack.add_cmdline_package is passed an invalid RPM 2021-02-22 00:41:40 UTC

Internal Links: 1383565

Description Dale Turner 2016-05-03 12:36:44 UTC
Description of problem:
Trying to install F24

Version-Release number of selected component:
anaconda-24.13.4-1

The following was filed automatically by anaconda:
anaconda 24.13.4-1 exception report
Traceback (most recent call first):
  File "/usr/lib64/python3.5/site-packages/pyanaconda/packaging/dnfpayload.py", line 803, in install
    raise packaging.PayloadError("DNF error: %s" % msg)
  File "/usr/lib64/python3.5/site-packages/pyanaconda/install.py", line 236, in doInstall
    payload.install()
  File "/usr/lib64/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib64/python3.5/site-packages/pyanaconda/threads.py", line 253, in run
    threading.Thread.run(self, *args, **kwargs)
pyanaconda.packaging.PayloadError: DNF error: error reading package headerTraceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/pyanaconda/packaging/dnfpayload.py", line 210, in do_transaction
    base.do_transaction(display=display)
  File "/usr/lib/python3.5/site-packages/dnf/base.py", line 564, in do_transaction
    self.transaction.populate_rpm_ts(self.ts)
  File "/usr/lib/python3.5/site-packages/dnf/transaction.py", line 183, in populate_rpm_ts
    hdr = tsi.installed.header
  File "/usr/lib/python3.5/site-packages/dnf/package.py", line 78, in header
    return dnf.rpm.header(self.localPkg())
  File "/usr/lib/python3.5/site-packages/dnf/rpm/__init__.py", line 58, in header
    return ts.hdrFromFdno(fdno)
  File "/usr/lib64/python3.5/site-packages/rpm/transaction.py", line 175, in hdrFromFdno
    raise rpm.error("error reading package header")
_rpm.error: error reading package header


Additional info:
addons:         com_redhat_kdump
cmdline:        /usr/bin/python3  /sbin/anaconda
cmdline_file:   BOOT_IMAGE=/images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-E-dvd-x86_64-24 quiet
executable:     /sbin/anaconda
hashmarkername: anaconda
kernel:         4.5.2-301.fc24.x86_64
product:        Fedora
release:        Cannot get release name.
reproducible:   Not sure how to reproduce the problem
type:           anaconda
version:        24

Comment 1 Dale Turner 2016-05-03 12:36:53 UTC
Created attachment 1153387 [details]
File: anaconda-tb

Comment 2 Dale Turner 2016-05-03 12:36:55 UTC
Created attachment 1153388 [details]
File: anaconda.log

Comment 3 Dale Turner 2016-05-03 12:36:57 UTC
Created attachment 1153389 [details]
File: dnf.log

Comment 4 Dale Turner 2016-05-03 12:36:58 UTC
Created attachment 1153390 [details]
File: dnf.rpm.log

Comment 5 Dale Turner 2016-05-03 12:36:59 UTC
Created attachment 1153391 [details]
File: environ

Comment 6 Dale Turner 2016-05-03 12:37:00 UTC
Created attachment 1153392 [details]
File: lsblk_output

Comment 7 Dale Turner 2016-05-03 12:37:02 UTC
Created attachment 1153393 [details]
File: lvm.log

Comment 8 Dale Turner 2016-05-03 12:37:03 UTC
Created attachment 1153394 [details]
File: nmcli_dev_list

Comment 9 Dale Turner 2016-05-03 12:37:04 UTC
Created attachment 1153395 [details]
File: os_info

Comment 10 Dale Turner 2016-05-03 12:37:06 UTC
Created attachment 1153396 [details]
File: program.log

Comment 11 Dale Turner 2016-05-03 12:37:08 UTC
Created attachment 1153397 [details]
File: storage.log

Comment 12 Dale Turner 2016-05-03 12:37:10 UTC
Created attachment 1153398 [details]
File: syslog

Comment 13 Dale Turner 2016-05-03 12:37:11 UTC
Created attachment 1153399 [details]
File: ifcfg.log

Comment 14 Dale Turner 2016-05-03 12:37:13 UTC
Created attachment 1153400 [details]
File: packaging.log

Comment 15 Dale Turner 2016-05-03 13:08:59 UTC
Similar problem has been detected:

Trying to install F24

addons:         com_redhat_kdump
cmdline:        /usr/bin/python3  /sbin/anaconda
cmdline_file:   BOOT_IMAGE=/images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-E-dvd-x86_64-24 quiet
hashmarkername: anaconda
kernel:         4.5.2-301.fc24.x86_64
package:        anaconda-24.13.4-1
product:        Fedora
reason:         pyanaconda.packaging.PayloadError: DNF error: error reading package headerTraceback (most recent call last):
release:        Cannot get release name.
reproducible:   Not sure how to reproduce the problem
version:        24

Comment 16 Honza Silhan 2016-05-09 11:43:25 UTC
Reassigning to RPM. Probably some package had malformed header.

Comment 17 Panu Matilainen 2016-10-12 12:43:23 UTC
Rpm refusing to read a malformed package is a feature, not bug. Damaged packages do happen, and the software on top of rpm should anticipate them and handle the error cleanly instead of throwing up a traceback.

I'm not sufficiently familiar with dnf or anaconda these days to tell which one should be catching this one, but this:

  File "/usr/lib/python3.5/site-packages/dnf/package.py", line 78, in header
    return dnf.rpm.header(self.localPkg())

...seems to suggest that its dnf who's not expecting a failure. Anaconda will just give up here in any case I think, but dnf could catch the rpm-level exception and riase an exception of its own, at least reporting which package it was that failed. Rpm cannot do that because it just gets a file descriptor.

Comment 18 Michael Mráka 2016-11-02 14:07:44 UTC
Fixed by 
https://github.com/rpm-software-management/libhif/pull/208

Testing reproducer was:
# touch /tmp/empty.rpm
# dnf install /tmp/empty.rpm

Fixed version output:
Last metadata expiration check: 0:00:00 ago on Wed Nov 02 14:53:41 2016 CET.
Can not load RPM file: /tmp/empty.rpm.
Could not open: /tmp/empty.rpm


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