Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

TCP replication fails with mysterious exceptions if worker_replication_port is unset #8484

Closed
richvdh opened this issue Oct 7, 2020 · 2 comments
Labels
A-Workers Problems related to running Synapse in Worker Mode (or replication) S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@richvdh
Copy link
Member

richvdh commented Oct 7, 2020

If you fail to configure worker_replication_port in a worker which is configured to use old-style TCP replication, you get an unhelpful stack trace:

2020-10-07 09:23:51,954 - synapse.replication.tcp.client - 71 - INFO - - Connecting to replication: IPv4Address(type='TCP', host='127.0.0.1', port=None)

... 

2020-10-07 09:23:51,959 - twisted - 231 - CRITICAL - - Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/synapse/app/_base.py", line 116, in run
    run_command()
  File "/usr/lib/python3.8/site-packages/twisted/internet/base.py", line 1283, in run
    self.mainLoop()
  File "/usr/lib/python3.8/site-packages/twisted/internet/base.py", line 1292, in mainLoop
    self.runUntilCurrent()
  File "/usr/lib/python3.8/site-packages/synapse/metrics/__init__.py", line 517, in f
    ret = func(*args, **kwargs)
--- <exception caught here> ---
  File "/usr/lib/python3.8/site-packages/twisted/internet/base.py", line 913, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "/usr/lib/python3.8/site-packages/twisted/internet/tcp.py", line 453, in resolveAddress
    self._setRealAddress(self.addr)
  File "/usr/lib/python3.8/site-packages/twisted/internet/tcp.py", line 474, in _setRealAddress
    self.doConnect()
  File "/usr/lib/python3.8/site-packages/twisted/internet/tcp.py", line 603, in doConnect
    connectResult = self.socket.connect_ex(self.realAddress)
builtins.TypeError: an integer is required (got type NoneType)

(it seems there's also a bug in twisted in that the error is not passed into factory.clientConnectionFailed, which is why the stacktrace is unclear.)

@clokep clokep added z-bug (Deprecated Label) z-p2 (Deprecated Label) A-Workers Problems related to running Synapse in Worker Mode (or replication) labels Oct 7, 2020
@richvdh
Copy link
Member Author

richvdh commented Feb 16, 2022

we should just get rid of this code: #11728

@erikjohnston erikjohnston added S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. and removed z-bug (Deprecated Label) z-p2 (Deprecated Label) labels Feb 23, 2022
@dklimpel
Copy link
Contributor

This is not supported anymore and can be closed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Workers Problems related to running Synapse in Worker Mode (or replication) S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

5 participants