This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1933349 - ipa-cert-fix command failed exception IOError No such file or directory /etc/pki/pki-tomcat/certs/ca_ocsp_signing.crt [RHEL 7.9.z]
Summary: ipa-cert-fix command failed exception IOError No such file or directory /etc/...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pki-core
Version: 7.9
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: beta
: ---
Assignee: RHCS Maintainers
QA Contact: idm-cs-qe-bugs
URL:
Whiteboard:
Depends On:
Blocks: 2168482
TreeView+ depends on / blocked
 
Reported: 2021-02-26 19:03 UTC by Marc Sauton
Modified: 2024-06-14 00:32 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2168482 (view as bug list)
Environment:
Last Closed: 2023-09-19 12:57:06 UTC
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHCS-3579 0 None None None 2023-02-09 06:51:02 UTC
Red Hat Issue Tracker   RHEL-5058 0 None Migrated None 2023-09-19 12:51:48 UTC

Description Marc Sauton 2021-02-26 19:03:43 UTC
Description of problem:

may be similar or related to:
bz 1779984 - The ipa-cert-fix command failed. [Errno 2] No such file or directory: '/etc/pki/pki-tomcat/certs/27-renewed.crt'
  https://bugzilla.redhat.com/1779984 [RHEL-8.?][ASSIGNED]
  https://pagure.io/freeipa/issue/8721
  https://github.com/freeipa/freeipa/pull/5579/commits/82bb4280ac5b576c54d4211b399eb7e6a9bbc331
( this seem different:
bz 1930586 - 'pki-server cert-fix' fails when CS.cfg parameter selftests.container.order.startup not present
  https://bugzilla.redhat.com/1930586 [RHEL-8.?][NEW]
  https://github.com/dogtagpki/pki/pull/3466
)

in this case:

RHEL-7.9 FIPS enabled

valid: caSigningCert cert-pki-ca
expired: ocspSigningCert cert-pki-ca
expired: subsystemCert cert-pki-ca
expired: auditSigningCert cert-pki-ca
valid renewed 20210205161709 : Server-Cert cert-pki-ca ( unclear if this was an action from certmonger or ipa-cert-fix or manual getcert resubmit, no traces in the collected CA debug or transations log files)
expired: /var/lib/ipa/ra-agent.pem
expired: LDAP SSL server cert
expired: HTTPD SSL server cert
expired: /var/kerberos/krb5kdc/kdc.crt

this article may have been followed at some point:
How do I manually renew Identity Management (IPA) certificates on RHEL7 after they have expired? (Master IPA Server)
https://access.redhat.com/solutions/3357261

certmonger is broken:
Feb 25 14:22:15 redacted certmonger: 2021-02-25 14:22:15 [116070] Server at https://redacted/ipa/xml failed request, will retry: -504 (libcurl failed to execute the HTTP POST transaction, explaining:  Peer's Certificate has expired.).

ipa-cert-fix if failing to renew the IPA expired internal certificates ( see the "Additional info" section for the whole verbose detail information):
ipa-cert-fix -v
...
ipapython.admintool: DEBUG: The ipa-cert-fix command failed, exception: IOError: [Errno 2] No such file or directory: '/etc/pki/pki-tomcat/certs/ca_ocsp_signing.crt'
ipapython.admintool: ERROR: [Errno 2] No such file or directory: '/etc/pki/pki-tomcat/certs/ca_ocsp_signing.crt'


checked /etc/pki/pki-tomcat/ca/CS.cfg has:
selftests.container.order.startup=SystemCertsVerification:critical, CAPresence:critical

checked the IPA LDAP server config till has
nsslapd-port: 389
nsslapd-security: on
but that does not really matter since the LDAP server SSL cert is expired, and ipa-cert-fix uses LDAPI, which is available.


I may have missed something, could not locate what is populating the /etc/pki/pki-tomcat/certs/{}.crt the logic behind, nor find out why the .crt are missing
I seem to only see in ./freeipa-4.6.8/ipaserver/install/ipa_cert_fix.py , use like:
cert = x509.load_certificate_from_file(cert_path)
cert_path = "/etc/pki/pki-tomcat/certs/{}-renewed.crt" \

and copy and install of the cert file, not many traces of the .crt files.

but seem well related to
  https://pagure.io/freeipa/issue/8721
  https://github.com/freeipa/freeipa/pull/5579/commits/82bb4280ac5b576c54d4211b399eb7e6a9bbc331


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

389-ds-base-1.3.10.2-9.el7_9.x86_64
certmonger-0.78.4-14.el7.x86_64
ipa-server-4.6.8-5.el7.x86_64
pki-ca-10.5.18-7.el7.noarch
redhat-release-server-7.9-5.el7_9.x86_64
FIPS ENABLED


How reproducible:
N/A

Steps to Reproduce:
1. N/A
2.
3.


Actual results:
ipapython.admintool: DEBUG: The ipa-cert-fix command failed, exception: IOError: [Errno 2] No such file or directory: '/etc/pki/pki-tomcat/certs/ca_ocsp_signing.crt'
ipapython.admintool: ERROR: [Errno 2] No such file or directory: '/etc/pki/pki-tomcat/certs/ca_ocsp_signing.crt'


Expected results:
yes


Additional info:

The following certificates will be renewed:

Dogtag subsystem certificate:
  Subject: CN=CA Subsystem,O=REDACTED
  Serial:  4
  Expires: 2020-09-30 20:37:35

Dogtag ca_ocsp_signing certificate:
  Subject: CN=OCSP Subsystem,O=REDACTED
  Serial:  2
  Expires: 2020-09-30 20:37:35

Dogtag ca_audit_signing certificate:
  Subject: CN=CA Audit,O=REDACTED
  Serial:  5
  Expires: 2020-09-30 20:37:35

IPA IPA RA certificate:
  Subject: CN=IPA RA,O=REDACTED
  Serial:  7
  Expires: 2020-09-30 20:38:06

IPA Apache HTTPS certificate:
  Subject: CN=redacted,O=REDACTED
  Serial:  9
  Expires: 2020-10-11 20:39:45

IPA LDAP certificate:
  Subject: CN=redacted,O=REDACTED
  Serial:  8
  Expires: 2020-10-11 20:39:03

IPA KDC certificate:
  Subject: CN=redacted,O=REDACTED
  Serial:  10
  Expires: 2020-10-11 20:40:01

Enter "yes" to proceed: yes
Proceeding.
ipapython.ipautil: DEBUG: Starting external process
ipapython.ipautil: DEBUG: args=pki-server cert-fix --ldapi-socket /var/run/slapd-REDACTED.socket --agent-uid ipara --cert subsystem --cert ca_ocsp_signing --cert ca_audit_signing --extra-cert 7 --extra-cert 9 --extra-cert 8 --extra-cert 10
ipapython.ipautil: DEBUG: Process finished, return code=1
ipapython.ipautil: DEBUG: stdout=ERROR: 404 Client Error: Not Found

ipapython.ipautil: DEBUG: stderr=INFO: Loading password config: /etc/pki/pki-tomcat/password.conf
INFO: Fixing the following system certs: ['subsystem', 'ca_ocsp_signing', 'ca_audit_signing']
INFO: Renewing the following additional certs: ['7', '9', '8', '10']
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
INFO: Stopping the instance to proceed with system cert renewal
INFO: Configuring LDAP password authentication
INFO: Setting pkidbuser password via ldappasswd
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
INFO: Selftests disabled for subsystems: ca
INFO: Resetting password for uid=ipara,ou=people,o=ipaca
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
INFO: Starting the instance
INFO: Sleeping for 10 seconds to allow server time to start...
INFO: Requesting new cert for subsystem
INFO: Getting subsystem cert info for ca
INFO: Trying to setup a secure connection to CA subsystem.
INFO: Starting new HTTPS connection (1): redacted.redacted
INFO: Stopping the instance
INFO: Selftests enabled for subsystems: ca
INFO: Restoring previous LDAP configuration

Renewed Dogtag subsystem certificate:
  Subject: CN=redacted,O=REDACTED
  Serial:  3
  Expires: 2021-01-20 14:36:10

ipapython.admintool: DEBUG:   File "/usr/lib/python2.7/site-packages/ipapython/admintool.py", line 178, in execute
    return_value = self.run()
  File "/usr/lib/python2.7/site-packages/ipaserver/install/ipa_cert_fix.py", line 128, in run
    replicate_dogtag_certs(subject_base, ca_subject_dn, certs)
  File "/usr/lib/python2.7/site-packages/ipaserver/install/ipa_cert_fix.py", line 251, in replicate_dogtag_certs
    cert = x509.load_certificate_from_file(cert_path)
  File "/usr/lib/python2.7/site-packages/ipalib/x509.py", line 425, in load_certificate_from_file
    with open(filename, mode='rb') as f:

ipapython.admintool: DEBUG: The ipa-cert-fix command failed, exception: IOError: [Errno 2] No such file or directory: '/etc/pki/pki-tomcat/certs/ca_ocsp_signing.crt'
ipapython.admintool: ERROR: [Errno 2] No such file or directory: '/etc/pki/pki-tomcat/certs/ca_ocsp_signing.crt'
ipapython.admintool: ERROR: The ipa-cert-fix command failed.

Comment 2 Florence Blanc-Renaud 2021-03-01 08:50:12 UTC
(In reply to Marc Sauton from comment #0)

> I may have missed something, could not locate what is populating the
> /etc/pki/pki-tomcat/certs/{}.crt the logic behind, nor find out why the .crt
> are missing
> I seem to only see in ./freeipa-4.6.8/ipaserver/install/ipa_cert_fix.py ,
> use like:
> cert = x509.load_certificate_from_file(cert_path)
> cert_path = "/etc/pki/pki-tomcat/certs/{}-renewed.crt" \
> 
> and copy and install of the cert file, not many traces of the .crt files.
> 

Hi Marc,

ipa-cert-fix is working as follows:
1. it gathers a list of expired certs that need to be renewed. The list can contain pki system certificates as well as the RA cert, HTTP, LDAP or KDC cert.
2. it calls "pki-server cert-fix" with the list of certs (--cert for the pki system certificates, --extra-cert for the other ones)
3. pki-server cert-fix renews the certs, and writes the new certs in /etc/pki/pki-tomcat/certs/xxx
4. ipa-cert-fix takes the new certs from their file location and puts them in the appropriate database.

Here pki-server cert-fix exits on error (this needs to be investigated) but ipa-cert-fix does not properly process the return code =1 (this is a known issue, https://bugzilla.redhat.com/show_bug.cgi?id=1779984).

I'm moving this issue to pki as the initial issue is pki-server cert-fix failing to renew the subsystem cert.

Comment 12 RHEL Program Management 2023-09-19 12:50:13 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 13 RHEL Program Management 2023-09-19 12:57:06 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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