Bug 999017

Summary: Error in PREIN scriptlet in rpm package ca-certificates
Product: Red Hat Enterprise Linux 7 Reporter: Aleš Mareček <amarecek>
Component: ca-certificatesAssignee: Kai Engert (:kaie) (inactive account) <kengert>
Status: CLOSED CURRENTRELEASE QA Contact: Aleš Mareček <amarecek>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0CC: eparis
Target Milestone: beta   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ca-certificates-2013.1.94-70.1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:22:39 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:
Attachments:
Description Flags
patch none

Description Aleš Mareček 2013-08-20 14:24:50 UTC
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):
ca-certificates-2012.87-10.1.el7.noarch

How reproducible:
Always

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) (inactive account) 2013-10-18 15:24:44 UTC
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

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

Solution:
Only consider creating the backup file if an old configuration file actually exists.

Comment 3 Kai Engert (:kaie) (inactive account) 2013-10-18 15:34:11 UTC
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) (inactive account) 2013-10-18 15:34:39 UTC
Created attachment 813827 [details]
patch

patch used for the test package

Comment 5 Kai Engert (:kaie) (inactive account) 2013-10-18 15:35:28 UTC
I recommend to fix this bug for rhel-7.0

Can you please grant devel_ack and qa_ack?

Comment 6 Kai Engert (:kaie) (inactive account) 2013-10-22 14:17:06 UTC
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 11:22:39 UTC
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.