element-hq / element-hq/synapse

replication reports 'failed to talk to main process' when it's not talking to the main process

Open
#9,338 0 comments 0 reactions 0 assignees View on GitHub
A-Workers S-Tolerable T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#9338](https://github.com/matrix-org/synapse/issues/9338).

---

This exception is misleading:

```
2021-02-06 11:09:54,223 - synapse.metrics.background_process_metrics - 210 - ERROR - replication-USER_IP-77061- Background process 'replication-USER_IP' threw an exception
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/synapse/replication/http/_base.py", line 235, in send_request
result = await request_func(uri, data, headers=headers)
File "/usr/local/lib/python3.8/site-packages/synapse/http/client.py", line 530, in post_json_get_json
response = await self.request(
File "/usr/local/lib/python3.8/site-packages/synapse/http/client.py", line 422, in request
response = await make_deferred_yieldable(request_deferred)
twisted.web._newclient.RequestTransmissionFailed: []

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/synapse/metrics/background_process_metrics.py", line 208, in run
return await maybe_awaitable(func(*args, **kwargs))
File "/usr/local/lib/python3.8/site-packages/synapse/replication/tcp/handler.py", line 411, in _handle_user_ip
await self._server_notices_sender.on_user_ip(cmd.user_id)
File "/usr/local/lib/python3.8/site-packages/synapse/server_notices/server_notices_sender.py", line 58, in on_user_ip
await sn.maybe_send_server_notice_to_user(user_id)
File "/usr/local/lib/python3.8/site-packages/synapse/server_notices/resource_limits_server_notices.py", line 76, in maybe_send_server_notice_to_user
room_id = await self._server_notices_manager.get_or_create_notice_room_for_user(
File "/usr/local/lib/python3.8/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
result = g.send(result)
File "/usr/local/lib/python3.8/site-packages/synapse/server_notices/server_notices_manager.py", line 155, in get_or_create_notice_room_for_user
info, _ = await self._room_creation_handler.create_room(
File "/usr/local/lib/python3.8/site-packages/synapse/handlers/room.py", line 737, in create_room
last_stream_id = await self._send_events_for_new_room(
File "/usr/local/lib/python3.8/site-packages/synapse/handlers/room.py", line 952, in _send_events_for_new_room
last_sent_stream_id = await send(
File "/usr/local/lib/python3.8/site-packages/synapse/handlers/room.py", line 882, in send
) = await self.event_creation_handler.create_and_send_nonmember_event(
File "/usr/local/lib/python3.8/site-packages/synapse/handlers/message.py", line 755, in create_and_send_nonmember_event
ev = await self.handle_new_client_event(
File "/usr/local/lib/python3.8/site-packages/synapse/util/metrics.py", line 92, in measured_func
r = await func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/synapse/handlers/message.py", line 950, in handle_new_client_event
result = await self.send_event(
File "/usr/local/lib/python3.8/site-packages/synapse/replication/http/_base.py", line 254, in send_request
raise SynapseError(502, "Failed to talk to main process") from e
synapse.api.errors.SynapseError: 502: Failed to talk to main process
```

it's not trying to talk to the main process.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.