Open mcalinghee opened 2 years ago
Un probleme qui semble similaire avait ete detecte au mois de mai par une personne sur le channel Bots et Integrations Tchap
/_matrix/client/v3/rooms/{roomId}/joined_members
mautrix.errors.request.MatrixUnknownRequestError: 502: <!DOCTYPE HTML PUBLIC "-[//IETF//DTD](https://ietf//DTD) HTML 2.0[//EN](https://en/)">
<html><head>
<title>502 Bad Gateway</title>
</head><body>
<h1>Bad Gateway</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request <em><a href="/_matrix/client/r0/rooms/%21msCKkfJzzzigPMceOn%3Aagent.interieur.tchap.gouv.fr/joined_members">GET /_matrix/client/r0/rooms/%21msCKkfJzzzigPMceOn%3Aagent.interieur.tchap.gouv.fr/joined_members</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>
Related synapse logs :
==> /mnt/logs/synapse/matrix-synapse_client_reader1.log <==
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: 2022-07-20 14:14:19,261 - synapse.http.server - 98 - ERROR - GET-8460- Failed handle request via 'JoinedRoomMemberListRestServlet': <XForwardedForRequest at 0x7ff432c6ebe0 method='GET' uri='/_matrix/client/unstable/rooms/%21cAlWiaTyDkuvawxlJh%3Ai.tchap.gouv.fr/joined_members' clientproto='HTTP/1.1' site=15000>
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: Traceback (most recent call last):
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: File "/opt/synapse/env/lib/python3.7/site-packages/synapse/http/server.py", line 259, in _async_render_wrapper
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: callback_return = await self._async_render(request)
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: File "/opt/synapse/env/lib/python3.7/site-packages/synapse/http/server.py", line 447, in _async_render
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: callback_return = await raw_callback_return
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: File "/opt/synapse/env/lib/python3.7/site-packages/synapse/rest/client/v1/room.py", line 517, in on_GET
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: requester, room_id
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: File "/opt/synapse/env/lib/python3.7/site-packages/synapse/handlers/message.py", line 249, in get_joined_members
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: "Getting joined members after leaving is not implemented"
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: NotImplementedError: Getting joined members after leaving is not implemented
Jul 20 14:14:19 tchap-i-new-2 matrix-synapse_client_reader1[38760]: 2022-07-20 14:14:19,261 - synapse.access.http.15000 - 329 - INFO - GET-8460- 171.33.105.206 - 15000 - {@tchap-identite-tchap.beta.gouv.fr:i.tchap.gouv.fr} Processed request: 0.003sec/-0.000sec (0.003sec, 0.000sec) (0.000sec/0.000sec/0) 55B 500 "GET /_matrix/client/unstable/rooms/%21cAlWiaTyDkuvawxlJh%3Ai.tchap.gouv.fr/joined_members HTTP/1.1" "okhttp/3.14.9" [0 dbevts]
Issue is already known : https://github.com/matrix-org/synapse/issues/2851 From my understanding, the error is not handled correctly (hence the stacktrace), but the behavior is expected if the bot is not in the room. The root cause might be elsewhere, though I'm gonna ask more details about the synapse issue anyway.
We have cleaned (leave and forget) all the rooms and direct messages on the Bot account in preprod env. The Bot will create new room as no room exist automatically. This is now working better
Issue
In our preprod environnement, when we reserve an conf call on AudioConf, no OTP code is sent on Tchap.
Investigation
When we send the OTP code on Tchap through our Bot, we ensure that the recipient is in the room that has been created previously by calling the endpoint /joined_members. There is an internal error at this particular step.
Log client (log tchap-authentification)