pkidestroy is failing with error "Uninstallation failed: [Errno 2] No such file or directory: '/var/lib/pki'"
Environment
- Red Hat Enterprise Linux 7.9
ipa-server-4.6.8-5pki-server-10.5.18-19pkidestroy
Issue
- pkidestory is failing as below:
# pkidestroy --force
Subsystem (CA/KRA/OCSP/TKS/TPS) [CA]:
Instance [pki-tomcat]:
Begin uninstallation (Yes/No/Quit)? yes
Log file: /var/log/pki/pki-ca-destroy.20250512111146.log
Uninstalling CA from /var/lib/pki/pki-tomcat.
pkidestroy : INFO BEGIN destroying subsystem 'CA' of instance 'pki-tomcat' . . .
pkidestroy : INFO ... initializing 'pki.server.deployment.scriptlets.initialization'
pkidestroy : ERROR ....... PKI subsystem 'CA' for instance 'pki-tomcat' does NOT exist!
pkidestroy : ERROR OSError: PKI subsystem 'CA' for instance 'pki-tomcat' does NOT exist!!
pkidestroy : INFO ....... executing 'systemctl stop pki-tomcatd@pki-tomcat.service'
pkidestroy : INFO ... removing 'pki.server.deployment.scriptlets.webapp_deployment'
pkidestroy : WARNING ....... File '/etc/pki/pki-tomcat/Catalina/localhost/ca.xml' is either missing or is NOT a regular file!
pkidestroy : INFO ... depopulating 'pki.server.deployment.scriptlets.subsystem_layout'
pkidestroy : WARNING ....... Directory '/var/lib/pki/pki-tomcat/ca/emails' is either missing or is NOT a directory!
pkidestroy : WARNING ....... Directory '/var/lib/pki/pki-tomcat/ca/profiles' is either missing or is NOT a directory!
pkidestroy : WARNING ....... Directory '/var/lib/pki/pki-tomcat/ca' is either missing or is NOT a directory!
pkidestroy : WARNING ....... Directory '/etc/pki/pki-tomcat/ca' is either missing or is NOT a directory!
pkidestroy : INFO ....... rm -rf /etc/sysconfig/pki/tomcat/pki-tomcat/ca
pkidestroy : INFO ... removing 'pki.server.deployment.scriptlets.security_databases'
pkidestroy : INFO ....... rm -rf /root/.dogtag/pki-tomcat
pkidestroy : WARNING ....... Directory '/etc/pki/pki-tomcat/alias' is either missing or is NOT a directory!
pkidestroy : WARNING ....... File '/etc/pki/pki-tomcat/password.conf' is either missing or is NOT a regular file!
pkidestroy : INFO ... depopulating 'pki.server.deployment.scriptlets.instance_layout'
pkidestroy : INFO ....... rm -f /etc/systemd/system/pki-tomcatd.target.wants/pki-tomcatd@pki-tomcat.service
pkidestroy : INFO ....... executing 'systemctl daemon-reload'
pkidestroy : WARNING ....... Directory '/var/lib/pki/pki-tomcat' is either missing or is NOT a directory!
pkidestroy : WARNING ....... Directory '/etc/pki/pki-tomcat/alias' is either missing or is NOT a directory!
pkidestroy : WARNING ....... Directory '/etc/pki/pki-tomcat' is either missing or is NOT a directory!
pkidestroy : WARNING ....... File '/etc/sysconfig/pki-tomcat' is either missing or is NOT a regular file!
pkidestroy : INFO ....... rm -rf /etc/sysconfig/pki/tomcat/pki-tomcat
pkidestroy : INFO ... depopulating 'pki.server.deployment.scriptlets.selinux_setup'
pkidestroy : INFO ... depopulating 'pki.server.deployment.scriptlets.infrastructure_layout'
pkidestroy : ERROR ....... OSError: [Errno 2] No such file or directory: '/var/lib/pki'!
Uninstallation failed: [Errno 2] No such file or directory: '/var/lib/pki'
Resolution
- Create
/var/lib/pkimanually:
# mkdir -p /var/lib/pki
# mkdir -p /var/lib/pki/pki-tomcat/
Root Cause
- Directories and files were missing in
/var/lib/pki
Diagnostic Steps
- Check for the directory
/var/lib/pki:
# ll -d /var/lib/pki
- Make sure it has the correct permissions:
# ll -d /var/lib/pki
drwxr-xr-x. 2 root root 6 May 12 13:37 /var/lib/pki
# ll -d /var/lib/pki/pki-tomcat/
drwxr-xr-x. 2 root root 6 May 12 13:38 /var/lib/pki/pki-tomcat/
- Try to run the command with the
-voption to get more verbose output.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments