Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 seems unsupported for metrics-listener #6644

Open
matrixbot opened this issue Dec 17, 2023 · 0 comments
Open

IPv6 seems unsupported for metrics-listener #6644

matrixbot opened this issue Dec 17, 2023 · 0 comments

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 17, 2023

This issue has been migrated from #6644.


Description

metrics-listener makes synapse crash when assigned an IPv6-bind_address

Steps to reproduce

Add

listeners:
  - type: metrics
    port: 19000
    bind_addresses:
      - '127.0.0.1'

to the /etc/matrix-synapse/homeserver.yaml and everything works, change it to either

listeners:
  - type: metrics
    port: 19000
    bind_addresses:
      - '::1'

or

listeners:
  - type: metrics
    port: 19000
    bind_addresses:
      - '127.0.0.1'
      - '::1'

and synapse will not start anymore, instead yielding the following traceback:

twisted: [] Traceback (most recent call last):
twisted: []   File "/usr/lib/python3/dist-packages/synapse/app/_base.py", line 271, in start
twisted: []     hs.start_listening(listeners)
twisted: []   File "/usr/lib/python3/dist-packages/synapse/app/homeserver.py", line 293, in start_listening
twisted: []     _base.listen_metrics(listener["bind_addresses"], listener["port"])
twisted: []   File "/usr/lib/python3/dist-packages/synapse/app/_base.py", line 160, in listen_metrics
twisted: []     start_http_server(port, addr=host, registry=RegistryProxy)
twisted: []   File "/usr/lib/python3/dist-packages/synapse/metrics/_exposition.py", line 242, in start_http_server
twisted: []     httpd = _ThreadingSimpleServer((addr, port), CustomMetricsHandler)
twisted: []   File "/usr/lib/python3.7/socketserver.py", line 452, in __init__
twisted: []     self.server_bind()
twisted: []   File "/usr/lib/python3.7/http/server.py", line 137, in server_bind
twisted: []     socketserver.TCPServer.server_bind(self)
twisted: []   File "/usr/lib/python3.7/socketserver.py", line 466, in server_bind
twisted: []     self.socket.bind(self.server_address)
twisted: [] socket.gaierror: [Errno -9] Address family for hostname not supported
twisted: [] Unhandled error in Deferred:
twisted: [] 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/synapse/app/_base.py", line 271, in start
    hs.start_listening(listeners)
  File "/usr/lib/python3/dist-packages/synapse/app/homeserver.py", line 293, in start_listening
    _base.listen_metrics(listener["bind_addresses"], listener["port"])
  File "/usr/lib/python3/dist-packages/synapse/app/_base.py", line 160, in listen_metrics
    start_http_server(port, addr=host, registry=RegistryProxy)
  File "/usr/lib/python3/dist-packages/synapse/metrics/_exposition.py", line 242, in start_http_server
    httpd = _ThreadingSimpleServer((addr, port), CustomMetricsHandler)
  File "/usr/lib/python3.7/socketserver.py", line 452, in __init__
    self.server_bind()
  File "/usr/lib/python3.7/http/server.py", line 137, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.7/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
socket.gaierror: [Errno -9] Address family for hostname not supported

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python3/dist-packages/synapse/app/homeserver.py", line 413, in start
    _base.start(hs, config.listeners)
  File "/usr/lib/python3/dist-packages/synapse/app/_base.py", line 281, in start
    sys.exit(1)
SystemExit: 1

Version information

@matrixbot matrixbot changed the title Dummy issue IPv6 seems unsupported for metrics-listener Dec 21, 2023
@matrixbot matrixbot reopened this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant