AVENTER-UG / docker-matrix

docker image for matrix.org

Home Page:https://riot.im/app/#/room/#dockermatrix:matrix.aventer.biz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to listen on port 8008

skerit opened this issue · comments

I've finally got Synapse to connect to my postgresql server running on the host, but now it throws an error when it tries to listen to port 8008:

2021-01-04 18:44:10,089 - twisted - 254 - ERROR -  - Traceback (most recent call last):
2021-01-04 18:44:10,089 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 1361, in startListening
2021-01-04 18:44:10,089 - twisted - 254 - ERROR -  -     skt.bind(addr)
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  - OSError: [Errno 99] Cannot assign requested address
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  - 
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  - During handling of the above exception, another exception occurred:
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  - 
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  - Traceback (most recent call last):
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 278, in start
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -     hs.start_listening(listeners)
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 298, in start_listening
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -     self._listening_services.extend(self._listener_http(config, listener))
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 160, in _listener_http
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -     reactor=self.get_reactor(),
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 169, in listen_tcp
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -     check_bind_error(e, address, bind_addresses)
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/__init__.py", line 51, in check_bind_error
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -     raise e
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 167, in listen_tcp
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -     r.append(reactor.listenTCP(port, factory, backlog, address))
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/twisted/internet/posixbase.py", line 495, in listenTCP
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -     p.startListening()
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 1363, in startListening
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -     raise CannotListenError(self.interface, self.port, le)
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  - twisted.internet.error.CannotListenError: Couldn't listen on ::1:8008: [Errno 99] Cannot assign requested address.
2021-01-04 18:44:10,115 - twisted - 254 - CRITICAL -  - Unhandled error in Deferred:
2021-01-04 18:44:10,116 - twisted - 254 - CRITICAL -  - 
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 1361, in startListening
    skt.bind(addr)
OSError: [Errno 99] Cannot assign requested address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 278, in start
    hs.start_listening(listeners)
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 298, in start_listening
    self._listening_services.extend(self._listener_http(config, listener))
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 160, in _listener_http
    reactor=self.get_reactor(),
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 169, in listen_tcp
    check_bind_error(e, address, bind_addresses)
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/__init__.py", line 51, in check_bind_error
    raise e
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 167, in listen_tcp
    r.append(reactor.listenTCP(port, factory, backlog, address))
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/posixbase.py", line 495, in listenTCP
    p.startListening()
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 1363, in startListening
    raise CannotListenError(self.interface, self.port, le)
twisted.internet.error.CannotListenError: Couldn't listen on ::1:8008: [Errno 99] Cannot assign requested address.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 429, in start
    _base.start(hs, config.listeners)
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 308, in start
    sys.exit(1)
SystemExit: 1
2021-01-04 18:44:10,139 - twisted - 254 - INFO -  - Main loop terminated.

I've read this is probably due to some ipv6 issue, but is this something I can fix or something that needs to be fixed in the config of the docker image itself?

I started the image with this command:

docker run -v /home/matrix/data:/data --restart unless-stopped --user 4018:4018 -p 8448:8448 -p 8008:8008 -p 3478:3478 -e SERVER_NAME=elevenways.be -e REPORT_STATS=no --add-host=host.docker.internal:host-gateway avhost/docker-matrix start

Hi @skerit!

Did u use ipv6 with docker? And does it start if u don't publish the port 8008?

Cheers,
Andreas

Ah, it's something that has to be enabled within docker? I did not know. I disabled the ::1 bind in the homeserver.yaml file for now, that does the trick!

I never use ipv6 with docker but I know there are a lot of issues with ipv6 in synapse. 🤷‍♂️ Well, depends your homeserver.yaml, synapse should listen at 8448 or 8008. It should looks like that (with ipv4):

listeners:
  - port: 8008
    tls: false
    bind_addresses: ['0.0.0.0']
    type: http
.
.
.