Bug 842874

Summary: backtrace if creating replica while LDAP is down
Product: Red Hat Enterprise Linux 7 Reporter: Jenny Severance <jgalipea>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Gregg <mgregg>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.0CC: mgregg, mkosek, mvarun, tbabej
Target Milestone: rc   
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-3.2.1-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:42:19 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 Jenny Severance 2012-07-24 19:25:16 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/freeipa/ticket/2939

A backtrace is displayed when trying to prepare a replica file with the local LDAP server down.

{{{
# ipactl stop
# ipa-replica-prepare tove.example.com
Directory Manager (existing master) password: 

ipa: INFO: Unhandled LDAPError: {'desc': "Can't contact LDAP server"}
preparation of replica failed: Can't contact LDAP server: 
Can't contact LDAP server: 
  File "/usr/sbin/ipa-replica-prepare", line 461, in <module>
    main()

  File "/usr/sbin/ipa-replica-prepare", line 263, in main
    conn.connect(bind_dn='cn=directory manager', bind_pw=dirman_password)

  File "/usr/lib/python2.7/site-packages/ipalib/backend.py", line 63, in connect
    conn = self.create_connection(*args, **kw)

  File "/usr/lib/python2.7/site-packages/ipalib/encoder.py", line 198, in new_f
    return f(*new_args, **kwargs)

  File "/usr/lib/python2.7/site-packages/ipaserver/plugins/ldap2.py", line 476, in create_connection
    _handle_errors(e)

  File "/usr/lib/python2.7/site-packages/ipaserver/plugins/ldap2.py", line 241, in _handle_errors
    raise errors.DatabaseError(desc=desc, info=info)

}}}

Comment 1 Martin Kosek 2012-08-14 13:51:03 UTC
Fixed upstream:
master: https://fedorahosted.org/freeipa/changeset/2e00a9f45cd7c3191902f9b20ec4879096589219

Comment 4 Varun Mylaraiah 2013-01-29 15:28:01 UTC
[root@mvarun yum.repos.d]# ipactl stop
Stopping EXTID Service

Shutting down Winbind services:                            [  OK  ]
Stopping ADTRUST Service
Shutting down SMB services:                                [  OK  ]
Stopping CA Service
Stopping pki-ca:                                           [  OK  ]
Stopping HTTP Service
Stopping httpd:                                            [  OK  ]
Stopping MEMCACHE Service
Stopping ipa_memcached:                                    [  OK  ]
Stopping DNS Service
Stopping named: .                                          [  OK  ]
Stopping KPASSWD Service
Stopping Kerberos 5 Admin Server:                          [  OK  ]
Stopping KDC Service
Stopping Kerberos 5 KDC:                                   [  OK  ]
Stopping Directory Service
Shutting down dirsrv: 
    NOVTESTRELM-COM...                                     [  OK  ]
    PKI-IPA...                                             [  OK  ]
[root@mvarun yum.repos.d]# ipa-replica-prepare cloud-qe-12.testrelm.com
Directory Manager (existing master) password: 

preparation of replica failed: cannot connect to u'ldapi://%2fvar%2frun%2fslapd-NOVTESTRELM-COM.socket': LDAP Server Down
cannot connect to u'ldapi://%2fvar%2frun%2fslapd-NOVTESTRELM-COM.socket': LDAP Server Down
  File "/usr/sbin/ipa-replica-prepare", line 490, in <module>
    main()

  File "/usr/sbin/ipa-replica-prepare", line 274, in main
    conn.connect(bind_dn=DN(('cn', 'directory manager')), bind_pw=dirman_password)

  File "/usr/lib/python2.6/site-packages/ipalib/backend.py", line 63, in connect
    conn = self.create_connection(*args, **kw)

  File "/usr/lib/python2.6/site-packages/ipaserver/plugins/ldap2.py", line 839, in create_connection
    self.handle_errors(e)

  File "/usr/lib/python2.6/site-packages/ipaserver/plugins/ldap2.py", line 729, in handle_errors
    error=u'LDAP Server Down')

[root@mvarun yum.repos.d]# rpm -q ipa-server
ipa-server-3.0.0-24.el6.x86_64
 
[root@mvarun yum.repos.d]# 
[root@mvarun yum.repos.d]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.4 Beta (Santiago)

[root@mvarun yum.repos.d]# uname -a
Linux mvarun.novtestrelm.com 2.6.32-345.el6.x86_64 #1 SMP Wed Nov 28 21:10:19 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@mvarun yum.repos.d]# 

[root@mvarun yum.repos.d]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.70.1.181	mvarun.novtestrelm.com mvarun
10.16.96.103 cloud-qe-12.testrelm.com

Comment 6 Tomas Babej 2013-02-03 21:05:26 UTC
Fixed upstream:

master: 26c498736ec8eabb8dafbc090811c92c79a8c318

Comment 10 Rob Crittenden 2013-02-04 15:46:39 UTC
Also pushed to ipa-3-1:

f6a564720068a1e63fa1966f4e5f7b7bb7c969f4
e43749176a3c19038f4a2bb043859a3a9d4d1ce9

Comment 12 Michael Gregg 2014-01-03 19:41:32 UTC
Verified against ipa-server-3.3.3-6.el7.x86_64

[root@ipaqavmb ~]# ipactl stop
Stopping Directory Service
Stopping ipa-otpd Service
Stopping pki-tomcatd Service
Stopping httpd Service
Stopping ipa_memcached Service
Stopping named Service
Stopping kadmin Service
Stopping krb5kdc Service
ipa: INFO: The ipactl command was successful

[root@ipaqavmb ~]# ipa-replica-prepare --ip-address=10.16.98.181 verifyhost.testrelm.com
Directory Manager (existing master) password: 

cannot connect to 'ldapi://%2fvar%2frun%2fslapd-TESTRELM-COM.socket':

Comment 13 Ludek Smid 2014-06-13 12:42:19 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.