Bug 707009 - IPA server with external CA fails with cannot concatenate 'str' and 'NoneType' objects
Summary: IPA server with external CA fails with cannot concatenate 'str' and 'NoneType...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa
Version: 6.1
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: ---
Assignee: Rob Crittenden
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-23 18:10 UTC by Erinn Looney-Triggs
Modified: 2015-01-04 23:48 UTC (History)
6 users (show)

Fixed In Version: ipa-2.1.0-1.el6
Doc Type: Bug Fix
Doc Text:
Cause: Installing an IPA server signed by an external CA fails with the error "cannot concatenate 'str' and 'NoneType' objects" Consequence: IPA installation signed by an external CA is not possible. Fix: Required information was not being passed so it was failing when constructing the Kerberos principal name for the dogtag 389-ds instance. This information is now provided by the installer. Result: Installation with a certificate signed by an external CA is now possible.
Clone Of:
Environment:
Last Closed: 2011-12-06 18:22:33 UTC
Target Upstream Version:


Attachments (Terms of Use)
Ipa server install log (444.68 KB, text/x-log)
2011-05-23 18:10 UTC, Erinn Looney-Triggs
no flags Details
Fix external CA installation (3.33 KB, patch)
2011-06-08 20:03 UTC, Rob Crittenden
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1533 normal SHIPPED_LIVE Moderate: ipa security and bug fix update 2011-12-06 01:23:31 UTC

Description Erinn Looney-Triggs 2011-05-23 18:10:10 UTC
Created attachment 500480 [details]
Ipa server install log

Description of problem:
[root@ipa ~]# ipa-server-install --external_cert_file=/root/ipa.crt --external_ca_file=/etc/pki/tls/certs/Foo-CA.crt 

The log file for this installation can be found in /var/log/ipaserver-install.log
Certain directory server operations require an administrative user.
This user is referred to as the Directory Manager and has full access
to the Directory for system management tasks and will be added to the
instance of directory server created for IPA.
The password must be at least 8 characters long.

Directory Manager password: 
Password (confirm): 

==============================================================================
This program will set up the FreeIPA Server.

This includes:
  * 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)

To accept the default shown in brackets, press the Enter key.

The IPA Master Server will be configured with
Hostname:    ipa.foo.com
IP address:  192.168.0.1
Domain name: abaqis.com

Configuring certificate server: Estimated time 6 minutes
  [1/16]: creating certificate server user
  [2/16]: restarting certificate server
  [3/16]: configuring certificate server instance
  [4/16]: restarting certificate server
  [5/16]: creating CA agent PKCS#12 file in /root
  [6/16]: creating RA agent certificate database
  [7/16]: importing CA chain to RA certificate database
  [8/16]: restarting certificate server
  [9/16]: requesting RA certificate from CA
  [10/16]: issuing RA agent certificate
  [11/16]: adding RA agent as a trusted user
  [12/16]: fixing RA database permissions
  [13/16]: setting up signing cert profile
  [14/16]: set up CRL publishing
  [15/16]: configuring certificate server to start on boot
  [16/16]: restarting certificate server
done configuring pki-cad.
Configuring directory server: Estimated time 1 minute
  [1/32]: creating directory server user
  [2/32]: creating directory server instance
  [3/32]: adding default schema
  [4/32]: enabling memberof plugin
  [5/32]: enabling referential integrity plugin
  [6/32]: enabling winsync plugin
  [7/32]: configuring replication version plugin
  [8/32]: enabling IPA enrollment plugin
  [9/32]: enabling ldapi
  [10/32]: configuring uniqueness plugin
  [11/32]: configuring uuid plugin
  [12/32]: configuring modrdn plugin
  [13/32]: enabling entryUSN plugin
  [14/32]: configuring lockout plugin
  [15/32]: creating indices
  [16/32]: configuring ssl for ds instance
  [17/32]: configuring certmap.conf
  [18/32]: configure autobind for root
  [19/32]: restarting directory server
  [20/32]: adding default layout
  [21/32]: adding delegation layout
  [22/32]: adding replication acis
  [23/32]: configuring user private groups
  [24/32]: configuring netgroups from hostgroups
  [25/32]: creating default Sudo bind user
  [26/32]: creating default HBAC rule allow_all
  [27/32]: initializing group membership
  [28/32]: adding master entry
  [29/32]: configuring Posix uid/gid generation
  [30/32]: enabling compatibility plugin
  [31/32]: tuning directory server
  [32/32]: configuring directory to start on boot
done configuring dirsrv.
Unexpected error - see ipaserver-install.log for details:
 cannot concatenate 'str' and 'NoneType' objects

Version-Release number of selected component (if applicable):
ipa-server-2.0.0-23.el6.x86_64


Additional info:
Will attach logs.

Comment 2 Dmitri Pal 2011-05-24 00:26:32 UTC
https://fedorahosted.org/freeipa/ticket/1245

Comment 4 Charles Leclerc 2011-06-06 14:45:51 UTC
I have the exact same problem.

Comment 5 Rob Crittenden 2011-06-08 20:03:05 UTC
Created attachment 503774 [details]
Fix external CA installation

Comment 6 Martin Kosek 2011-06-09 15:44:00 UTC
Upstream commits:
master: a26fb5aacafa91bd67061cb85bc9f0c88b735604
ipa-2-0: bbbaf01f2c0dd681919373eb6c45df88993fc8b2

Comment 9 Charles Leclerc 2011-06-21 13:00:33 UTC
After patching the package, the install fails at the very end when trying to change the admin password. The corresponding extract from install log is :

2011-06-21 14:15:04,735 DEBUG Changing admin password
2011-06-21 14:15:04,793 DEBUG args=/usr/bin/ldappasswd -h ns1.*** -ZZ -x -D cn=Directory Manager -y /var/lib/ipa/tmpjGFGbi -T /var/lib/ipa/tmpQ6yK5A uid=admin,cn=users,cn=accounts,dc=***,dc=***
2011-06-21 14:15:04,794 DEBUG stdout=
2011-06-21 14:15:04,794 DEBUG stderr=ldap_start_tls: Connect error (-11)
        additional info: TLS error -8172:Unknown code ___f 20

2011-06-21 14:15:04,795 DEBUG Unable to set admin password Command '/usr/bin/ldappasswd -h ns1.*** -ZZ -x -D cn=Directory Manager -y /var/lib/ipa/tmpjGFGbi -T /var/lib/ipa/tmpQ6yK5A uid=admin,cn=users,cn=accounts,dc=***,dc=***' returned non-zero exit status 1

In addition this is the log from dirsrv :

[21/Jun/2011:14:15:03 +0200] conn=42 fd=79 slot=79 connection from 129.0.51.2 to 129.0.51.2
[21/Jun/2011:14:15:03 +0200] conn=42 op=0 EXT oid="1.3.6.1.4.1.1466.20037" name="startTLS"
[21/Jun/2011:14:15:03 +0200] conn=42 op=0 RESULT err=0 tag=120 nentries=0 etime=0
[21/Jun/2011:14:15:03 +0200] conn=42 op=-1 fd=79 closed - Peer does not recognize and trust the CA that issued your certificate.

Comment 10 Charles Leclerc 2011-06-21 14:24:08 UTC
Note : the above error only occurs when I try to use personal server certificates for httpd and dirsrv through the _pkcs12 and _pin options of ipa-server-install. When I removed these options, the install went fine, but I was unable to import the server certificates with ipa-server-certinstall afterwards :

# ipa-server-certinstall -d -w --{http,dirsrv}_pin=*** /root/certs/ns1.***.p12
Directory Manager password:
Traceback (most recent call last):
  File "/usr/sbin/ipa-server-certinstall", line 140, in main
    set_ds_cert_name(server_cert[0], dm_password)
  File "/usr/sbin/ipa-server-certinstall", line 70, in set_ds_cert_name
    conn.update_entry('cn=RSA,cn=encryption,cn=config', mod)
  File "/usr/lib/python2.6/site-packages/ipalib/encoder.py", line 188, in new_f
    return f(*new_args, **kwargs)
  File "/usr/lib/python2.6/site-packages/ipaserver/plugins/ldap2.py", line 840, in update_entry
    raise errors.EmptyModlist()
EmptyModlist: no modifications to be performed
an unexpected error occurred: no modifications to be performed

Maybe I should open another ticket, because the error seems different.

Comment 11 Rob Crittenden 2011-06-21 17:40:52 UTC
Looks like a different issue.

We may end up deprecating those options to ipa-server-install. At this point the server really needs to use the internal CA.

Comment 12 Charles Leclerc 2011-06-22 11:36:04 UTC
OK, then I will continue my tests without those options.

Comment 13 Rob Crittenden 2011-07-19 17:22:07 UTC
master: a26fb5aacafa91bd67061cb85bc9f0c88b735604
ipa-2-0: bbbaf01f2c0dd681919373eb6c45df88993fc8b2

Comment 15 Rob Crittenden 2011-10-31 18:50:55 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: Installing an IPA server signed by an external CA fails with the error "cannot concatenate 'str' and 'NoneType' objects"
Consequence: IPA installation signed by an external CA is not possible.
Fix: Required information was not being passed so it was failing when constructing the Kerberos principal name for the dogtag 389-ds instance. This information is now provided by the installer.
Result: Installation with a certificate signed by an external CA is now possible.

Comment 16 Gowrishankar Rajaiyan 2011-11-07 07:24:51 UTC
[root@mudflap ~]# ipa-server-install --external-ca

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)

To accept the default shown in brackets, press the Enter key.

Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
<hostname>.<domainname>
Example: master.example.com.


Server host name [mudflap.testrelm]: 

Warning: Hostname (mudflap.testrelm) not found in DNS
The domain name has been calculated based on the host name.

Please confirm the domain name [testrelm]: 

The IPA Master Server will be configured with
Hostname:    mudflap.testrelm
IP address:  10.65.201.XX
Domain name: testrelm

The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.

Please provide a realm name [TESTRELM]: 
Certain directory server operations require an administrative user.
This user is referred to as the Directory Manager and has full access
to the Directory for system management tasks and will be added to the
instance of directory server created for IPA.
The password must be at least 8 characters long.

Directory Manager password: 
Password (confirm): 

The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.

IPA admin password: 
Password (confirm): 


The following operations may take some minutes to complete.
Please wait until the prompt is returned.

Configuring ntpd
  [1/4]: stopping ntpd
  [2/4]: writing configuration
  [3/4]: configuring ntpd to start on boot
  [4/4]: starting ntpd
done configuring ntpd.
Configuring directory server for the CA: Estimated time 30 minutes 30 seconds
  [1/3]: creating directory server user
  [2/3]: creating directory server instance
  [3/3]: restarting directory server
done configuring pkids.
Configuring certificate server: Estimated time 33 minutes 30 seconds
  [1/4]: creating certificate server user
  [2/4]: creating pki-ca instance
  [3/4]: configuring certificate server instance
The next step is to get /root/ipa.csr signed by your CA and re-run ipa-server-install as:
ipa-server-install --external_cert_file=/path/to/signed_certificate --external_ca_file=/path/to/external_ca_certificate
[root@mudflap ~]# 



[root@mudflap ~]# ipa-server-install --external_cert_file=/root/ca/ipa.crt --external_ca_file=/root/ca/ipacacert.asc 

The log file for this installation can be found in /var/log/ipaserver-install.log
Directory Manager password: 

==============================================================================
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)

To accept the default shown in brackets, press the Enter key.

Warning: Hostname (mudflap.testrelm) not found in DNS
The IPA Master Server will be configured with
Hostname:    mudflap.testrelm
IP address:  10.65.201.XX
Domain name: testrelm

Configuring certificate server: Estimated time 33 minutes 30 seconds
  [1/16]: creating certificate server user
  [2/16]: configuring certificate server instance
  [3/16]: disabling nonces
  [4/16]: creating CA agent PKCS#12 file in /root
  [5/16]: creating RA agent certificate database
  [6/16]: importing CA chain to RA certificate database
  [7/16]: fixing RA database permissions
  [8/16]: setting up signing cert profile
  [9/16]: set up CRL publishing
  [10/16]: set certificate subject base
  [11/16]: configuring certificate server to start on boot
  [12/16]: restarting certificate server
  [13/16]: requesting RA certificate from CA
  [14/16]: issuing RA agent certificate
  [15/16]: adding RA agent as a trusted user
  [16/16]: Configure HTTP to proxy connections
done configuring pki-cad.
Configuring directory server: Estimated time 31 minutes
  [1/35]: creating directory server user
  [2/35]: creating directory server instance
  [3/35]: adding default schema
  [4/35]: enabling memberof plugin
  [5/35]: enabling referential integrity plugin
  [6/35]: enabling winsync plugin
  [7/35]: configuring replication version plugin
  [8/35]: enabling IPA enrollment plugin
  [9/35]: enabling ldapi
  [10/35]: configuring uniqueness plugin
  [11/35]: configuring uuid plugin
  [12/35]: configuring modrdn plugin
  [13/35]: enabling entryUSN plugin
  [14/35]: configuring lockout plugin
  [15/35]: creating indices
  [16/35]: configuring ssl for ds instance
  [17/35]: configuring certmap.conf
  [18/35]: configure autobind for root
  [19/35]: configure new location for managed entries
  [20/35]: restarting directory server
  [21/35]: adding default layout
  [22/35]: adding delegation layout
  [23/35]: adding replication acis
  [24/35]: creating container for managed entries
  [25/35]: configuring user private groups
  [26/35]: configuring netgroups from hostgroups
  [27/35]: creating default Sudo bind user
  [28/35]: creating default Auto Member layout
  [29/35]: creating default HBAC rule allow_all
  [30/35]: initializing group membership
  [31/35]: adding master entry
  [32/35]: configuring Posix uid/gid generation
  [33/35]: enabling compatibility plugin
Restarting IPA to initialize updates before performing deletes:
  [1/2]: stopping directory server
  [2/2]: starting directory server
done configuring dirsrv.
  [34/35]: tuning directory server
  [35/35]: configuring directory to start on boot
done configuring dirsrv.
Configuring Kerberos KDC: Estimated time 30 minutes 30 seconds
  [1/14]: setting KDC account password
  [2/14]: adding sasl mappings to the directory
  [3/14]: adding kerberos entries to the DS
  [4/14]: adding default ACIs
  [5/14]: configuring KDC
  [6/14]: adding default keytypes
  [7/14]: adding default password policy
  [8/14]: creating a keytab for the directory
  [9/14]: creating a keytab for the machine
  [10/14]: exporting the kadmin keytab
  [11/14]: adding the password extension to the directory
  [12/14]: adding the kerberos master key to the directory
  [13/14]: starting the KDC
  [14/14]: configuring KDC to start on boot
done configuring krb5kdc.
Configuring ipa_kpasswd
  [1/2]: starting ipa_kpasswd 
  [2/2]: configuring ipa_kpasswd to start on boot
done configuring ipa_kpasswd.
Configuring the web interface: Estimated time 31 minutes
  [1/13]: disabling mod_ssl in httpd
  [2/13]: setting mod_nss port to 443
  [3/13]: setting mod_nss password file
  [4/13]: enabling mod_nss renegotiate
  [5/13]: adding URL rewriting rules
  [6/13]: configuring httpd
  [7/13]: setting up ssl
  [8/13]: setting up browser autoconfig
  [9/13]: publish CA cert
  [10/13]: creating a keytab for httpd
  [11/13]: configuring SELinux for httpd
  [12/13]: restarting httpd
  [13/13]: configuring httpd to start on boot
done configuring httpd.
Applying LDAP updates
Restarting IPA to initialize updates before performing deletes:
  [1/2]: stopping directory server
  [2/2]: starting directory server
done configuring dirsrv.
Restarting the directory server
Restarting the KDC
Restarting the web server
Sample zone file for bind has been created in /tmp/sample.zone.w9GnOh.db
==============================================================================
Setup complete

Next steps:
	1. You must make sure these network ports are open:
		TCP Ports:
		  * 80, 443: HTTP/HTTPS
		  * 389, 636: LDAP/LDAPS
		  * 88, 464: kerberos
		UDP Ports:
		  * 88, 464: kerberos
		  * 123: ntp

	2. You can now obtain a kerberos ticket using the command: 'kinit admin'
	   This ticket will allow you to use the IPA tools (e.g., ipa user-add)
	   and the web user interface.

Be sure to back up the CA certificate stored in /root/cacert.p12
This file is required to create replicas. The password for this
file is the Directory Manager password
[root@mudflap ~]# kinit admin
Password for admin@TESTRELM: 
[root@mudflap ~]# ipa user-add shanks
First name: shanks
Last name: r
-------------------
Added user "shanks"
-------------------
  User login: shanks
  First name: shanks
  Last name: r
  Full name: shanks r
  Display name: shanks r
  Initials: sr
  Home directory: /home/shanks
  GECOS field: shanks r
  Login shell: /bin/sh
  Kerberos principal: shanks@TESTRELM
  UID: 1290200003
  GID: 1290200003
  Keytab: False
  Password: False
[root@mudflap ~]# ipa passwd shanks
New Password: 
Enter New Password again to verify: 
--------------------------------------
Changed password for "shanks@TESTRELM"
--------------------------------------
[root@mudflap ~]# kinit shanks
Password for shanks@TESTRELM: 
Password expired.  You must change it now.
Enter new password: 
Enter it again: 
[root@mudflap ~]# kinit shanks
Password for shanks@TESTRELM: 
[root@mudflap ~]# 


[root@mudflap ~]# ipactl status
Directory Service: RUNNING
KDC Service: RUNNING
KPASSWD Service: RUNNING
HTTP Service: RUNNING
CA Service: RUNNING
[root@mudflap ~]# 



[root@mudflap ~]# rpm -qi ipa-server | head
Name        : ipa-server                   Relocations: (not relocatable)
Version     : 2.1.3                             Vendor: Red Hat, Inc.
Release     : 8.el6                         Build Date: Wed 02 Nov 2011 03:21:27 AM IST
Install Date: Thu 03 Nov 2011 10:02:33 AM IST      Build Host: x86-012.build.bos.redhat.com
Group       : System Environment/Base       Source RPM: ipa-2.1.3-8.el6.src.rpm
Size        : 3381421                          License: GPLv3+
Signature   : (none)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.freeipa.org/
Summary     : The IPA authentication server
[root@mudflap ~]#

Comment 17 errata-xmlrpc 2011-12-06 18:22:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2011-1533.html


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