Bug 32255 - UMC-server start fails if socket dir doesnt exists or no more inodes are available
UMC-server start fails if socket dir doesnt exists or no more inodes are avai...
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 3.1
Other Linux
: P5 minor (vote)
: UCS 3.2-x
Assigned To: UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-19 11:08 CEST by Alexander Kläser
Modified: 2017-08-08 07:09 CEST (History)
3 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): Usability
Max CVSS v3 score:
klaeser: Patch_Available+


Attachments
Patch for correct handling of socket bind failure. (716 bytes, patch)
2013-08-19 11:14 CEST, Alexander Kläser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kläser univentionstaff 2013-08-19 11:08:43 CEST
At ticket #2013081921003867, the following traceback has been observed:

> 16.08.13 12:20:43.029  MAIN        ( INFO    ) : Initialising server process
> 16.08.13 12:20:43.029  MAIN        ( INFO    ) : Using a UNIX socket
> 16.08.13 12:20:43.029  MODULE      ( ERROR   ) : Traceback (most recent call last):
>   File "/usr/sbin/univention-management-console-module", line 110, in <module>
>     module = umcp.ModuleServer( options.socket, options.module, check_acls = False, timeout = session_timeout )
>   File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/modserver.py", line 80, in __init__
>     Server.__init__( self, ssl = False, unix = socket, magic = False, load_ressources = False )
>   File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/server.py", line 442, in __init__
>     os.unlink( self.__unix )
> OSError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/var/run/univention-management-console/11727-1376648442426.socket'

The OSError is a follow up of a socket error, however, the cause of the socket error is not print to the log file.
Comment 1 Alexander Kläser univentionstaff 2013-08-19 11:14:18 CEST
Created attachment 5371 [details]
Patch for correct handling of socket bind failure.

The attached patch prints out the error message for the socket bind failure and tries to remove the socket file, catching an OSError in case the file does not exist.
Comment 2 Kevin Dominik Korte univentionstaff 2013-08-19 11:33:20 CEST
The Error after applying the patch reads the following

19.08.13 11:26:05.095  MODULE      ( ERROR   ) : Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-module", line 110, in <module>
    module = umcp.ModuleServer( options.socket, options.module, check_acls = False, timeout = session_timeout )
  File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/modserver.py", line 80, in __init__
    Server.__init__( self, ssl = False, unix = socket, magic = False, load_ressources = False )
  File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/server.py", line 450, in __init__
    self.__realsocket.listen( SERVER_MAX_CONNECTIONS )
  File "<string>", line 1, in listen
error: [Errno 22] Das Argument ist ung?ltig
Comment 3 Alexander Kläser univentionstaff 2013-08-19 12:23:32 CEST
(In reply to Kevin Dominik Korte from comment #2)
> The Error after applying the patch reads the following
> 
> 19.08.13 11:26:05.095  MODULE      ( ERROR   ) : Traceback (most recent call
> last):
>   File "/usr/sbin/univention-management-console-module", line 110, in
> <module>
>     module = umcp.ModuleServer( options.socket, options.module, check_acls =
> False, timeout = session_timeout )
>   File
> "/usr/lib/pymodules/python2.6/univention/management/console/protocol/
> modserver.py", line 80, in __init__
>     Server.__init__( self, ssl = False, unix = socket, magic = False,
> load_ressources = False )
>   File
> "/usr/lib/pymodules/python2.6/univention/management/console/protocol/server.
> py", line 450, in __init__
>     self.__realsocket.listen( SERVER_MAX_CONNECTIONS )
>   File "<string>", line 1, in listen
> error: [Errno 22] Das Argument ist ung?ltig

More important is the line before the traceback:

> Setting up connection to socket /var/run/univention-management-console/30904-1376904569464.socket failed: [Errno 2] Datei oder Verzeichnis nicht gefunden

The directory /var/run/univention-management-console did not exist.

In a different case (ticket #2013081521009136), no inodes were left on the device.

In any case, theses errors need to be logged properly. The patch should be modified such that the module process exits correctly upon such a socket error.
Comment 4 Florian Best univentionstaff 2014-02-16 22:43:07 CET
All server crashs are logged since Bug #31130.

Maybe this can also be WORKSFORME? We cannot change that no inodes are available and the socket directory is shipped by our packages (it can only not exist when manual interaction was present).
Comment 5 Kevin Dominik Korte univentionstaff 2014-02-17 00:22:06 CET
I would suggest creating the respective directory during the start up of the process, if it isn't present.

For the inodes I agree, there isn't much one can do beyond proper logging.
Comment 6 Stefan Gohmann univentionstaff 2014-02-17 06:24:18 CET
(In reply to Florian Best from comment #4)
> All server crashs are logged since Bug #31130.
> 
> Maybe this can also be WORKSFORME? We cannot change that no inodes are
> available and the socket directory is shipped by our packages (it can only
> not exist when manual interaction was present).

It would be nice if UMC could give a suggestion what to do. The problem is that the admin normally does not read the logfiles.
Comment 7 Stefan Gohmann univentionstaff 2017-06-16 20:39:46 CEST
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4.

If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
Comment 8 Stefan Gohmann univentionstaff 2017-08-08 07:09:55 CEST
This issue has been filed against UCS 3.1.

UCS 3.1 is out of maintenance and many UCS components have vastly changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen this issue. In this case please provide detailed information on how this issue is affecting you.