Bug 55531 - udm reports "E: Daemon died." even though successful and udm-cli-server is still running
udm reports "E: Daemon died." even though successful and udm-cli-server is st...
Status: NEW
Product: UCS
Classification: Unclassified
Component: UDM - CLI
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-01-05 13:15 CET by Arvid Requate
Modified: 2024-01-10 17:48 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.171
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support: Yes
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022121421000353
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.
Comment 1 Florian Best univentionstaff 2023-01-05 13:52: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
Comment 2 Florian Best univentionstaff 2023-01-05 16:50:38 CET
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
Comment 3 Arvid Requate univentionstaff 2023-01-05 17:21:45 CET
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?
Comment 4 Florian Best univentionstaff 2023-01-05 17:23:25 CET
I have to reproduce it myself to see why it is complaining. I will look at it back in ~ 2 weeks.
Comment 6 Florian Best univentionstaff 2024-01-10 17:03:44 CET
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