Bug 999017 - Error in PREIN scriptlet in rpm package ca-certificates
Error in PREIN scriptlet in rpm package ca-certificates
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ca-certificates (Show other bugs)
All Linux
unspecified Severity high
: beta
: ---
Assigned To: Kai Engert (:kaie)
Aleš Mareček
Depends On:
  Show dependency treegraph
Reported: 2013-08-20 10:24 EDT by Aleš Mareček
Modified: 2014-06-18 01:13 EDT (History)
1 user (show)

See Also:
Fixed In Version: ca-certificates-2013.1.94-70.1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-13 07:22:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch (2.46 KB, patch)
2013-10-18 11:34 EDT, Kai Engert (:kaie)
no flags Details | Diff

  None (edit)
Description Aleš Mareček 2013-08-20 10:24:50 EDT
Description of problem:
When some files from package are deleted, it's not possible to reinstall the package after then.

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

How reproducible:

Steps to Reproduce:
0. mkdir ~/backup ; cp -r /etc/pki/java/cacerts /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.trust.crt ~/backup
1. rm -rf /etc/pki/java/cacerts /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.trust.crt
2. yum -y reinstall ca-certificates

Actual results:
It's not possible to reinstall package:
- SNIP -
mv: cannot stat ‘/etc/pki/java/cacerts’: No such file or directory
mv: cannot stat ‘/etc/pki/tls/certs/ca-bundle.crt’: No such file or directory
mv: cannot stat ‘/etc/pki/tls/certs/ca-bundle.trust.crt’: No such file or directory
error: %pre(ca-certificates-2012.87-10.1.el7.noarch) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package ca-certificates-2012.87-10.1.el7.noarch
- SNIP -

Expected results:
Reinstallation possible

Additional info:
Comment 2 Kai Engert (:kaie) 2013-10-18 11:24:44 EDT
I can confirm this bug using RHEL-7.0-20131018.n.0

For my local testing of updated packages (where I cannot use "yum" for reinstall), I require a way to reproduce using "rpm".

The bug can be reproduced by
wget http://download.devel.redhat.com/brewroot/packages/ca-certificates/2013.1.94/70.0.el7/noarch/ca-certificates-2013.1.94-70.0.el7.noarch.rpm
rm -f /etc/pki/java/cacerts /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.trust.crt
rpm -Uvh --force ca-certificates-2013.1.94-70.0.el7.noarch.rpm

The %pre script attempts to create backups of old configuration files.
If there isn't an old configuration files, the "mv" command fails.

Only consider creating the backup file if an old configuration file actually exists.
Comment 3 Kai Engert (:kaie) 2013-10-18 11:34:11 EDT
Ales, if you'd like to test the fixed package, please feel free to use my beaker system hp-dl380pgen8-02-vm-9.lab.bos.redhat.com

I prepared a scratch build package with the suggested fix, it's available from https://brewweb.devel.redhat.com/taskinfo?taskID=6437978
(and already downloaded to the beaker system in "/root". Y copy of the the previous package is in that directory, too.)

Installing the newer package is possible (and repairs the symbolic links).

If the newer package is installed, and you remove the files again, reinstalling the newer package (rpm -Uvh --force) works.
Comment 4 Kai Engert (:kaie) 2013-10-18 11:34:39 EDT
Created attachment 813827 [details]

patch used for the test package
Comment 5 Kai Engert (:kaie) 2013-10-18 11:35:28 EDT
I recommend to fix this bug for rhel-7.0

Can you please grant devel_ack and qa_ack?
Comment 6 Kai Engert (:kaie) 2013-10-22 10:17:06 EDT
This should be fixed in ca-certificates-2013.1.94-70.1.el7

I saw the latest nightly RHEL 7 compose already contains that package.

What's next? MODIFIED or ON_QA?
Comment 11 Ludek Smid 2014-06-13 07:22:39 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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