On Thu, May 21, 2015 at 01:38:43PM +0200, Martin Basti wrote:
> This patch should fix following traceback.
> 
> 2015-05-20T03:50:41Z ERROR Upgrade failed with cannot connect to 
> 'ldapi://%2fvar%2frun%2fslapd-IPA-LOCAL.socket':
> 2015-05-20T03:50:41Z DEBUG Traceback (most recent call last):
>   File 
> "/usr/lib/python2.7/site-packages/ipaserver/install/upgradeinstance.py", line 
> 304, in __upgrade
>     ld = ldapupdate.LDAPUpdate(dm_password='', ldapi=True)
>   File "/usr/lib/python2.7/site-packages/ipaserver/install/ldapupdate.py", 
> line 314, in __init__
>     self.create_connection()
>   File "/usr/lib/python2.7/site-packages/ipaserver/install/ldapupdate.py", 
> line 862, in create_connection
>     autobind=self.ldapi)
>   File "/usr/lib/python2.7/site-packages/ipalib/backend.py", line 66, in 
> connect
>     conn = self.create_connection(*args, **kw)
>   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/ldap2.py", line 
> 188, in create_connection
>     client_controls=clientctrls)
>   File "/usr/lib/python2.7/site-packages/ipapython/ipaldap.py", line 1074, in 
> external_bind
>     '', auth_tokens, server_controls, client_controls)
>   File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
>     self.gen.throw(type, value, traceback)
>   File "/usr/lib/python2.7/site-packages/ipapython/ipaldap.py", line 976, in 
> error_handler
>     error=info)
> NetworkError: cannot connect to 
> 'ldapi://%2fvar%2frun%2fslapd-IPA-LOCAL.socket':
> 
> 2015-05-20T03:50:41Z DEBUG Traceback (most recent call last):
>   File "/usr/lib/python2.7/site-packages/ipaserver/install/service.py", line 
> 388, in start_creation
>     run_step(full_msg, method)
>   File "/usr/lib/python2.7/site-packages/ipaserver/install/service.py", line 
> 378, in run_step
>     method()
>   File 
> "/usr/lib/python2.7/site-packages/ipaserver/install/upgradeinstance.py", line 
> 315, in __upgrade
>     raise RuntimeError(e)
> RuntimeError: cannot connect to 
> 'ldapi://%2fvar%2frun%2fslapd-IPA-LOCAL.socket':
> 
> Reason was the ipa-server-install tried to connect before DS was ready.
> 
> The patch adds waiting until DS is ready.
> 
> Patch attached.
> 
> Fraser can you please check if this fix works? I can't reproduce it.
> Thank you, Martin^2.
> 
ACK; fixes the issue for me.

One minor comment:

> +    def __start(self):
> +        super(IPAUpgrade, self).start()
>  
>      def __stop_instance(self):
>          """Stop only the main DS instance"""
> @@ -187,7 +185,7 @@ class IPAUpgrade(service.Service):
>          self.step("saving configuration", self.__save_config)
>          self.step("disabling listeners", self.__disable_listeners)
>          self.step("enabling DS global lock", 
> self.__enable_ds_global_write_lock)
> -        self.step("starting directory server", self.__start_nowait)
> +        self.step("starting directory server", self.__start)

I think you can just say `self.start' and remove `__start' function.

Cheers,
Fraser

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to