Bug 1250006 - create archive failed on file XXX: cpio: Bad magic
create archive failed on file XXX: cpio: Bad magic
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rpm (Show other bugs)
6.6
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: packaging-team-maint
Karel Srot
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-04 06:29 EDT by Pavel Raiskup
Modified: 2016-05-10 20:53 EDT (History)
1 user (show)

See Also:
Fixed In Version: rpm-4.8.0-48.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-10 20:53:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Pavel Raiskup 2015-08-04 06:29:07 EDT
Reproducible by this src.rpm:
http://praiskup.fedorapeople.org/copr/rh-postgresql94-postgresql-9.4.4-2.el6.src.rpm

$ rpmbuild -vv --rebuild rh-postgresql94-postgresql-9.4.4-2.el6.src.rpm
...SNIP...
D: fini      100644  1 (   0,   0)       163 /home/praiskup/rpmbuild/BUILDROOT/rh-postgresql94-postgresql-9.4.4-2.el6.x86_64/opt/rh/rh-postgresql94/root/usr/share/doc/rh-postgresql94-postgresql-9.4.4/MISSING_FEATURES 
D: fini      100644  1 (   0,   0)      1209 /home/praiskup/rpmbuild/BUILDROOT/rh-postgresql94-postgresql-9.4.4-2.el6.x86_64/opt/rh/rh-postgresql94/root/usr/share/doc/rh-postgresql94-postgresql-9.4.4/README 
D: undo      100644  0 (   0,   0)         0 /home/praiskup/rpmbuild/BUILDROOT/rh-postgresql94-postgresql-9.4.4-2.el6.x86_64/opt/rh/rh-postgresql94/root/usr/share/doc/rh-postgresql94-postgresql-9.4.4/README.rpm-dist 
XZDIO:      59 writes,  1582164 total bytes in 0.243617 secs
error: create archive failed on file /home/praiskup/rpmbuild/BUILDROOT/rh-postgresql94-postgresql-9.4.4-2.el6.x86_64/opt/rh/rh-postgresql94/root/usr/share/doc/rh-postgresql94-postgresql-9.4.4/README.rpm-dist: cpio: Bad magic


RPM build errors:
    create archive failed on file /home/praiskup/rpmbuild/BUILDROOT/rh-postgresql94-postgresql-9.4.4-2.el6.x86_64/opt/rh/rh-postgresql94/root/usr/share/doc/rh-postgresql94-postgresql-9.4.4/README.rpm-dist: cpio: Bad magic
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
$ ..

This is caused by '%doc %{_pkgdocdir}/README.rpm-dist' line in %files section.
If I do 'cp %{buildroot}%{_pkgdocdir}/README.rpm-dist ./' and then
I do '%doc README.rpm-dist' => this problem disappears and the package builds
fine.
Comment 2 Ľuboš Kardoš 2015-08-31 08:58:45 EDT
This bug was fixed in rpm-4.9.1 [1], but I am against backporting that patch into rpm-4.8.0 that is in rhel-6 because it caused many problems. But we can add at least a better error message that you can't have the %doc tag with relative path and file with absolute path into the document directory at the same time in a rpm file list.

[1] https://github.com/rpm-software-management/rpm/commit/2f6bfc99d01df941f6aaad8497150f82eeb75311
Comment 3 Ľuboš Kardoš 2015-12-01 08:07:21 EST
Devel ack for improving the error message to be more clear what causes the problem.
Comment 10 errata-xmlrpc 2016-05-10 20:53:52 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0936.html

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