Univention Bugzilla – Bug 55531
udm reports "E: Daemon died." even though successful and udm-cli-server is still running
Last modified: 2024-01-10 17:48:09 CET
The error message seems wrong: "Daemon died" is one example. Correct is that the socket connection was closed and the send data did not contain a null byte. management/univention-directory-manager-modules/univention-cli-client: 126 def receive_answer(sock): 127 » """Receive complete answer from server.""" 128 » data = b'' 129 » while True: 130 » » buf = sock.recv(1024) 131 » » if len(buf) == 0: 132 » » » print('E: Daemon died.', file=sys.stderr) 133 » » » sys.exit(1) 134 » » elif buf[-1:] == b'\0': 135 » » » buf = buf[0:-1] 136 » » » data += buf 137 » » » break 138 » » else: 139 » » » data += buf 140 » return data
In Bug #33224 we changed that the CLI-client shares their stdout+stderr file-descriptors with the CLI-server. The CLI-server then doesn't send the whole UDM object data as JSON object but prints directly to the stdout/stderr. But it also sends some data (most likely/often just a empty list) as JSON object back to the socket. The change had also the side-effect that data is printed when the client process has already ended: timeout -k 0.1 0.1 udm users/user list
Yes, I see, that's the bug I put in the "See also" section here. Do you have an idea how we could make this more robust, so that udm client doesn't interpret an error when there apparently is none?
I have to reproduce it myself to see why it is complaining. I will look at it back in ~ 2 weeks.
Any uncaught exception in univention-cli-server in server_main() or MyRequestHandler.handle() will trigger this. → so we should handle all exception and send a operation failed message Another reason could be a broken pipe during "print(file=stream)" in admincli.py: Bug #32532