Bug 34784 - E: Can`t connect daemon after 30 seconds
E: Can`t connect daemon after 30 seconds
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - CLI
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 3.2-2
Assigned To: Stefan Gohmann
Philipp Hahn
:
Depends on: 34440
Blocks: 34836
  Show dependency treegraph
 
Reported: 2014-05-08 21:55 CEST by Stefan Gohmann
Modified: 2014-05-20 07:53 CEST (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2014-05-08 21:55:18 CEST
This happens sometimes during the installation.

+++ This bug was initially created as a clone of Bug #34440 +++

> From the logfile:
> 
> Waiting for file
> /usr/share/pyshared/univention/admin/handlers/container/msgpo.py: OK
> Terminating running univention-cli-server processes.
> E: Can`t connect daemon after 30 seconds.
Comment 1 Stefan Gohmann univentionstaff 2014-05-09 06:37:24 CEST
If the connection to the cli-server failed, the cli-client tries to start the cli-server for a second time: 
 Code: r50045
 Changelog: r50050

I've debugged the original issue and it seems to be a raise condition. The first cli-server has not been killed completely and in this case the start of the second cli-server failed. I think this is caused by the pkill in  python/ldap_extension.py. It does not wait for the terminated cli-server process like the corresponding function in shell/base.sh does. I've created Bug #34786.
Comment 2 Philipp Hahn univentionstaff 2014-05-12 16:23:22 CEST
OK: r50045
OK: r50050
OK: aptitude install '?source-package(^univention-directory-manager-modules$)?installed'

OK: I could not reproduce the bug, but there is a small race condition where two CLI servers are started at the same time and delete one-others UNIX socket.

FYI:
atexit() and try-finally are not executed when a process is terminated through a signal, so the old PID file and socket are not cleaned up in that case. It only happens when the CLI sever times out in the select() call.

"allow_reuse_address = 1" does not work for AF_UNIX and should be removed to not confuse future readers: <http://stackoverflow.com/questions/15716302/so-reuseaddr-and-af-unix>

"ForkingTCPServer" should also be renamed to "ForkingServer", as it no longer uses AF_INET but AF_UNIX and (thus no TCP). It should probably inherit UnixStreamServer and ForkingMixIn; see /usr/lib/python2.6/SocketServer.py

The method server_bind() should also be removed, as it no longer applies to AF_UNIX.

With the switch to UNIX the comment in /usr/sbin/udm:89
>        # this takes a long time if getfqdn(host) is used in cli-server
also no longer applies.
Comment 3 Stefan Gohmann univentionstaff 2014-05-20 07:53:30 CEST
UCS 3.2-2 has been released:
 http://docs.univention.de/release-notes-3.2-2-en.html
 http://docs.univention.de/release-notes-3.2-2-de.html

If this error occurs again, please use "Clone This Bug".