Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1362450

Summary: Unable to install ipa-server when used with --external-ca
Product: Red Hat Enterprise Linux 7 Reporter: Abhijeet Kasurde <akasurde>
Component: pki-coreAssignee: RHCS Maintainers <rhcs-maint>
Status: CLOSED NOTABUG QA Contact: Asha Akkiangady <aakkiang>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.3CC: akasurde, blipton, edewata, ftweedal, ksiddiqu, mbasti, mharmsen, pspacek, pvoborni, rcritten
Target Milestone: rcKeywords: TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-04 16:13:08 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
ipa-server-install.log
none
pki-ca-spawn.log none

Description Abhijeet Kasurde 2016-08-02 08:43:11 UTC
Description of problem:
If user specify ipa-server-install using `--external-ca` then installation fails.


# ipa-server-install -n testrelm.test -r TESTRELM.TEST --external-ca --subject="O=TEST,C=TESTRELM" --setup-dns --forwarder 192.168.121.89 -U -p 'Secret123' -a 'Secret123'
Checking DNS domain testrelm.test, please wait ...

The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.

This includes:
  * Configure a stand-alone CA (dogtag) for certificate management
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure DNS (bind)

WARNING: conflicting time&date synchronization service 'chronyd' will be disabled
in favor of ntpd

Warning: skipping DNS resolution of host ipamaster11.testrelm.test
Checking DNS domain testrelm.test., please wait ...
Checking DNS forwarders, please wait ...

The IPA Master Server will be configured with:
Hostname:       ipamaster11.testrelm.test
IP address(es): 192.168.121.147
Domain name:    testrelm.test
Realm name:     TESTRELM.TEST

BIND DNS server will be configured to serve IPA domain with:
Forwarders:       192.168.121.89
Forward policy:   only
Reverse zone(s):  No reverse zone

Configuring NTP daemon (ntpd)
  [1/4]: stopping ntpd
  [2/4]: writing configuration
  [3/4]: configuring ntpd to start on boot
  [4/4]: starting ntpd
Done configuring NTP daemon (ntpd).
Configuring directory server (dirsrv). Estimated time: 1 minute
  [1/47]: creating directory server user
  [2/47]: creating directory server instance
  [3/47]: updating configuration in dse.ldif
  [4/47]: restarting directory server
  [5/47]: adding default schema
  [6/47]: enabling memberof plugin
  [7/47]: enabling winsync plugin
  [8/47]: configuring replication version plugin
  [9/47]: enabling IPA enrollment plugin
  [10/47]: enabling ldapi
  [11/47]: configuring uniqueness plugin
  [12/47]: configuring uuid plugin
  [13/47]: configuring modrdn plugin
  [14/47]: configuring DNS plugin
  [15/47]: enabling entryUSN plugin
  [16/47]: configuring lockout plugin
  [17/47]: configuring topology plugin
  [18/47]: creating indices
  [19/47]: enabling referential integrity plugin
  [20/47]: configuring certmap.conf
  [21/47]: configure autobind for root
  [22/47]: configure new location for managed entries
  [23/47]: configure dirsrv ccache
  [24/47]: enabling SASL mapping fallback
  [25/47]: restarting directory server
  [26/47]: adding sasl mappings to the directory
  [27/47]: adding default layout
  [28/47]: adding delegation layout
  [29/47]: creating container for managed entries
  [30/47]: configuring user private groups
  [31/47]: configuring netgroups from hostgroups
  [32/47]: creating default Sudo bind user
  [33/47]: creating default Auto Member layout
  [34/47]: adding range check plugin
  [35/47]: creating default HBAC rule allow_all
  [36/47]: adding sasl mappings to the directory
  [37/47]: adding entries for topology management
  [38/47]: initializing group membership
  [39/47]: adding master entry
  [40/47]: initializing domain level
  [41/47]: configuring Posix uid/gid generation
  [42/47]: adding replication acis
  [43/47]: enabling compatibility plugin
  [44/47]: activating sidgen plugin
  [45/47]: activating extdom plugin
  [46/47]: tuning directory server
  [47/47]: configuring directory to start on boot
Done configuring directory server (dirsrv).
Configuring certificate server (pki-tomcatd). Estimated time: 3 minutes 30 seconds
  [1/8]: creating certificate server user
  [2/8]: configuring certificate server instance
ipa.ipaserver.install.cainstance.CAInstance: CRITICAL Failed to configure CA instance: Command '/usr/sbin/pkispawn -s CA -f /tmp/tmprW_DSZ' returned non-zero exit status 1
ipa.ipaserver.install.cainstance.CAInstance: CRITICAL See the installation logs and the following files/directories for more information:
ipa.ipaserver.install.cainstance.CAInstance: CRITICAL   /var/log/pki/pki-tomcat
  [error] RuntimeError: CA configuration failed.
ipa.ipapython.install.cli.install_tool(Server): ERROR    CA configuration failed.
ipa.ipapython.install.cli.install_tool(Server): ERROR    The ipa-server-install command failed. See /var/log/ipaserver-install.log for more information


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


How reproducible:
ipa-server-4.4.0-4.el7.x86_64

Steps to Reproduce:
1. ipa-server-install -n testrelm.test -r TESTRELM.TEST --external-ca --subject="O=TEST,C=TESTRELM" --setup-dns --forwarder 192.168.121.89 -U -p 'Secret123' -a 'Secret123'

Actual results:
Fails to install ipa-server using external-ca argument

Expected results:
ipa-server-install should install ipa-server with external-ca argument

Comment 1 Abhijeet Kasurde 2016-08-02 08:45:40 UTC
Created attachment 1186707 [details]
ipa-server-install.log

Comment 2 Abhijeet Kasurde 2016-08-02 08:46:40 UTC
Created attachment 1186708 [details]
pki-ca-spawn.log

Comment 5 Martin Bašti 2016-08-02 08:54:07 UTC
It is reproducible even without --external-ca option

Comment 6 Martin Bašti 2016-08-02 08:55:59 UTC
For me it looks like issue on dogtag side, there was no IPA update in RHEL between time when it worked and it stopped working

Comment 7 Ben Lipton 2016-08-02 12:50:16 UTC
I'm not sure if it's related, because I saw it on F24, but the upgrade of resteasy from 3.0.6-11.fc24 to 3.0.17-1.fc24 broke the install with PKI for me. I needed to downgrade the packages resteasy-core resteasy-client resteasy-atom-provider resteasy-jaxb-provider to get install to succeed without error.

Comment 8 Petr Spacek 2016-08-02 14:47:52 UTC
Interestingly, downgrade back to 3.0.6-11.fc24 did not fix the installation in my case. I have no idea why ...

Comment 12 Martin Bašti 2016-08-03 11:22:32 UTC
Moving summary back to original, It looks like the issue experienced in F24 (comments 7, 8) is reproducible only in F24 (I havent been able to reproduce it in RHEL73), so leaving this BZ only for --external-ca option

Comment 14 Endi Sukma Dewata 2016-08-04 01:06:52 UTC
PKI uses NSS to generate the CSR. It looks like the subject DN is considered invalid by NSS:

$ certutil -R \
 -d nssdb \
 -z noise.bin \
 -f password.txt \
 -s "O=TEST,C=TESTRELM" \
 -a
certutil -s: improperly formatted name: "O=TEST,C=TESTRELM"

Abhijeet, could you try again with "CN=TEST,O=TESTRELM"? Thanks.

Comment 15 Abhijeet Kasurde 2016-08-04 10:06:11 UTC
(In reply to Endi Sukma Dewata from comment #14)
> PKI uses NSS to generate the CSR. It looks like the subject DN is considered
> invalid by NSS:
> 
> $ certutil -R \
>  -d nssdb \
>  -z noise.bin \
>  -f password.txt \
>  -s "O=TEST,C=TESTRELM" \
>  -a
> certutil -s: improperly formatted name: "O=TEST,C=TESTRELM"
> 
> Abhijeet, could you try again with "CN=TEST,O=TESTRELM"? Thanks.

Endi, following command works for me 

[root@ipamaster731 /]# ipa-server-install -n testrelm.test -r TESTRELM.TEST --external-ca --subject="O=TESTRELM.TEST" --setup-dns --forwarder 10.65.201.89  -U -p 'Secret123' -a 'Secret123'

Comment 16 Endi Sukma Dewata 2016-08-04 16:13:08 UTC
Thanks, Abhijeet.

Since subject DN validity is determined by NSS, not PKI, I'm closing this bug. If the "O=TEST,C=TESTRELM" is supposed to be a valid subject DN, please reopen the ticket against NSS.

FYI, RESTEasy 3.0.17 issue is handled in this ticket:
https://fedorahosted.org/pki/ticket/2403

Comment 17 Abhijeet Kasurde 2016-08-05 06:36:24 UTC
Thanks, Endi.

For posterity, 
Subject DN for IPA is set as following in ipa-server-install command ::

--subject="O=TESTRELM.TEST"

Comment 18 Petr Vobornik 2016-08-05 07:35:49 UTC
--subject is actually a subject base.

The fact that invalid value in subject base crashes pki-spawn and therefore ipa-server-install in such unfriendly fashion is quite bad. 

IMHO some validation should be done earlier or better error message provided.

CCing Fraser because he was looking into extending IPA to allow setting whole subject and not just subject base - bug 828866

Comment 19 Abhijeet Kasurde 2016-08-05 08:15:55 UTC
(In reply to Petr Vobornik from comment #18)
> --subject is actually a subject base.
> 
> The fact that invalid value in subject base crashes pki-spawn and therefore
> ipa-server-install in such unfriendly fashion is quite bad. 
> 
> IMHO some validation should be done earlier or better error message provided.
> 
> CCing Fraser because he was looking into extending IPA to allow setting
> whole subject and not just subject base - bug 828866

OK. Thanks for this information.