Bug 817865

Summary: we should not influence ip address family selection (traceback when IPv6 disabled)
Product: Red Hat Enterprise Linux 6 Reporter: Dmitri Pal <dpal>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: Namita Soman <nsoman>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.3CC: jdennis, jgalipea, mkosek, sgoveas
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-3.0.0-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: `ipa' command or Identity Management installers forced an order of address families (IPv4, IPv6) when establishing a network connection instead of letting system choose the right address family for the new connection. Consequence: Connection establishment and thus the command or installer may fail, or establishing connection takes more time than required by testing an inappropriate address family first. Fix: Allow system to offer the right and available address families when establishing a connection. Result: Network connections established by `ipa' command or installers are established faster and less vulnerable to errors caused by non-common network setting.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 09:12:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dmitri Pal 2012-05-01 16:09:54 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/freeipa/ticket/2695

In nsslib (and possibly other places) we try to influence ip family selection. This is wrong. We should always use getaddrinfo (or one of it's wrappers) and iterate over the address list returned trying to connect the socket. The returned address list is sorted according to what the system networking configuration believes are the preferred selections. We should respect the system network configuration.

Comment 1 Jenny Severance 2012-06-20 18:36:44 UTC
Please add steps to reproduce what is causing back trace and how to verify the fix.

Comment 2 RHEL Program Management 2012-07-10 06:22:04 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 RHEL Program Management 2012-07-10 23:27:44 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 4 Martin Kosek 2012-07-13 12:33:28 UTC
Fixed upstream:
master: https://fedorahosted.org/freeipa/changeset/4879c68d68634715b9d08a08a4c7be882634409f

Requested changes to IPA nss interface has been made along with other relevant fixed accross all IPA codebase. I was not able to reproduce this particular back trace in the nss interface. John, can you please add a reproduction scenario for this issue?

Comment 5 John Dennis 2012-07-16 16:46:53 UTC
re comment #4

I'm not sure what specific backtrace you're referring to, although I do remember seeing such a backtrace somewhere. My recollection was the error was a direct consequence of trying to force a family (IPv6) which raised an exception because the family was unavailable.

I'm not sure but I think I saw this on one of the mailing lists, and I don't know what caused it specifically, I believe it was due to to turning off IPv6 on the machine. We then tried to force IPv6 which threw the exception.

I also recognize the error from my work on some of the internals.

So you could trying disabling IPv6, not sure if that was the real culprit, but in any case your fixes should address the problem because clearly the IPA code was not following the recommended procedures.

Comment 7 Steeve Goveas 2013-01-24 12:14:00 UTC
[root@sideswipe ~]# cat /etc/hosts
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
2620:52:0:41ce:5054:ff:fe3b:c68b sideswipe.testrelm.com sideswipe

[root@sideswipe ~]# ip addr del 10.65.206.83 dev eth0
Warning: Executing wildcard deletion to stay compatible with old scripts.
Explicitly specify the prefix length (10.65.206.83/32) to avoid this warning.
This special behaviour is likely to disappear in further releases,
fix your scripts!

[root@sideswipe ~]# ip addr del 127.0.0.1 dev lo
Warning: Executing wildcard deletion to stay compatible with old scripts.
Explicitly specify the prefix length (127.0.0.1/32) to avoid this warning.
This special behaviour is likely to disappear in further releases,
fix your scripts!

[root@sideswipe ~]# ifconfig | grep inet
inet6 addr: 2620:52:0:41ce:5054:ff:fe3b:c68b/64 Scope:Global
inet6 addr: fe80::5054:ff:fe3b:c68b/64 Scope:Link
inet6 addr: ::1/128 Scope:Host

[root@sideswipe ~]# ipa-server-install --setup-dns

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)

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

Existing BIND configuration detected, overwrite? [no]: yes
Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
.
Example: master.example.com.


Server host name [sideswipe.testrelm.com]:

Warning: skipping DNS resolution of host sideswipe.testrelm.com
The domain name has been determined based on the host name.

Please confirm the domain name [testrelm.com]:

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.COM]:
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):

Do you want to configure DNS forwarders? [yes]: no
No DNS forwarders configured
Do you want to configure the reverse zone? [yes]:
Please specify the reverse zone name [e.c.1.4.0.0.0.0.2.5.0.0.0.2.6.2.ip6.arpa.]:
Using reverse zone e.c.1.4.0.0.0.0.2.5.0.0.0.2.6.2.ip6.arpa.

The IPA Master Server will be configured with:
Hostname: sideswipe.testrelm.com
IP address: 2620:52:0:41ce:5054:ff:fe3b:c68b
Domain name: testrelm.com
Realm name: TESTRELM.COM

BIND DNS server will be configured to serve IPA domain with:
Forwarders: No forwarders
Reverse zone: e.c.1.4.0.0.0.0.2.5.0.0.0.2.6.2.ip6.arpa.

Continue to configure the system with these values? [no]: yes

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

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 for the CA (pkids): 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 directory server for the CA (pkids).
Configuring certificate server (pki-cad): Estimated time 33 minutes 30 seconds
[1/21]: creating certificate server user
[2/21]: creating pki-ca instance
[3/21]: configuring certificate server instance
[4/21]: disabling nonces
[5/21]: creating CA agent PKCS#12 file in /root
[6/21]: creating RA agent certificate database
[7/21]: importing CA chain to RA certificate database
[8/21]: fixing RA database permissions
[9/21]: setting up signing cert profile
[10/21]: set up CRL publishing
[11/21]: set certificate subject base
[12/21]: enabling Subject Key Identifier
[13/21]: setting audit signing renewal to 2 years
[14/21]: configuring certificate server to start on boot
[15/21]: restarting certificate server
[16/21]: requesting RA certificate from CA
[17/21]: issuing RA agent certificate
[18/21]: adding RA agent as a trusted user
[19/21]: configure certificate renewals
[20/21]: configure Server-Cert certificate renewal
[21/21]: Configure HTTP to proxy connections
Done configuring certificate server (pki-cad).
Configuring directory server (dirsrv): Estimated time 31 minutes
[1/38]: creating directory server user
[2/38]: creating directory server instance
[3/38]: adding default schema
[4/38]: enabling memberof plugin
[5/38]: enabling winsync plugin
[6/38]: configuring replication version plugin
[7/38]: enabling IPA enrollment plugin
[8/38]: enabling ldapi
[9/38]: disabling betxn plugins
[10/38]: configuring uniqueness plugin
[11/38]: configuring uuid plugin
[12/38]: configuring modrdn plugin
[13/38]: enabling entryUSN plugin
[14/38]: configuring lockout plugin
[15/38]: creating indices
[16/38]: enabling referential integrity plugin
[17/38]: configuring ssl for ds instance
[18/38]: configuring certmap.conf
[19/38]: configure autobind for root
[20/38]: configure new location for managed entries
[21/38]: restarting directory server
[22/38]: adding default layout
[23/38]: adding delegation layout
[24/38]: adding replication acis
[25/38]: creating container for managed entries
[26/38]: configuring user private groups
[27/38]: configuring netgroups from hostgroups
[28/38]: creating default Sudo bind user
[29/38]: creating default Auto Member layout
[30/38]: adding range check plugin
[31/38]: creating default HBAC rule allow_all
[32/38]: Upload CA cert to the directory
[33/38]: initializing group membership
[34/38]: adding master entry
[35/38]: configuring Posix uid/gid generation
[36/38]: enabling compatibility plugin
[37/38]: tuning directory server
[38/38]: configuring directory to start on boot
Done configuring directory server (dirsrv).
Configuring Kerberos KDC (krb5kdc): Estimated time 30 minutes 30 seconds
[1/10]: adding sasl mappings to the directory
[2/10]: adding kerberos container to the directory
[3/10]: configuring KDC
[4/10]: initialize kerberos container
[5/10]: adding default ACIs
[6/10]: creating a keytab for the directory
[7/10]: creating a keytab for the machine
[8/10]: adding the password extension to the directory
[9/10]: starting the KDC
[10/10]: configuring KDC to start on boot
Done configuring Kerberos KDC (krb5kdc).
Configuring kadmin
[1/2]: starting kadmin
[2/2]: configuring kadmin to start on boot
Done configuring kadmin.
Configuring ipa_memcached
[1/2]: starting ipa_memcached
[2/2]: configuring ipa_memcached to start on boot
Done configuring ipa_memcached.
Configuring the web interface (httpd): Estimated time 31 minutes
[1/13]: setting mod_nss port to 443
[2/13]: setting mod_nss password file
[3/13]: enabling mod_nss renegotiate
[4/13]: adding URL rewriting rules
[5/13]: configuring httpd
[6/13]: setting up ssl
[7/13]: setting up browser autoconfig
[8/13]: publish CA cert
[9/13]: creating a keytab for httpd
[10/13]: clean up any existing httpd ccache
[11/13]: configuring SELinux for httpd
[12/13]: restarting httpd
[13/13]: configuring httpd to start on boot
Done configuring the web interface (httpd).
Applying LDAP updates
Restarting the directory server
Restarting the KDC
Configuring DNS (named)
[1/9]: adding DNS container
[2/9]: setting up our zone
[3/9]: setting up reverse zone
[4/9]: setting up our own record
[5/9]: setting up kerberos principal
[6/9]: setting up named.conf
[7/9]: restarting named
[8/9]: configuring named to start on boot
[9/9]: changing resolv.conf to point to ourselves
Done configuring DNS (named).

Global DNS configuration in LDAP server is empty
You can use 'dnsconfig-mod' command to set global DNS options that
would override settings in local named.conf files

Restarting the web server
==============================================================================
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
* 53: bind
UDP Ports:
* 88, 464: kerberos
* 53: bind
* 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


Installation is successful in pure IPv6 env

Verified in version ipa-server-3.0.0-23.el6.x86_64

Comment 9 errata-xmlrpc 2013-02-21 09:12:25 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-2013-0528.html