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

Synapse not listening on Federation port #4775

Closed
carroarmato0 opened this issue Mar 1, 2019 · 7 comments
Closed

Synapse not listening on Federation port #4775

carroarmato0 opened this issue Mar 1, 2019 · 7 comments

Comments

@carroarmato0
Copy link

carroarmato0 commented Mar 1, 2019

Description

I was running version v0.99.1 of the Docker Synapse container and trying out the Federation.
It all seems to work until at some point I noticed that the port wasn't reachable anymore.

I tried restarting the container... nothing.
Tried running v0.99.2 but still, connections to port 8448 are refused.

The logs don't seem to indicate anything wrong:

2019-03-01 13:28:48,762 - root - 209 - WARNING - None- ***** STARTING SERVER *****
2019-03-01 13:28:48,769 - root - 212 - WARNING - None- Server /usr/local/lib/python3.6/site-packages/synapse/app/homeserver.py version 0.99.2
2019-03-01 13:30:48,840 - synapse.storage._base - 401 - WARNING - - Starting db txn 'update_presence' from sentinel context
2019-03-01 13:30:48,844 - synapse.storage._base - 437 - WARNING - - Starting db connection from sentinel context: metrics will be lost
2019-03-01 13:31:48,841 - synapse.storage._base - 401 - WARNING - - Starting db txn 'update_presence' from sentinel context
2019-03-01 13:31:48,841 - synapse.storage._base - 437 - WARNING - - Starting db connection from sentinel context: metrics will be lost
...

This is how I launch the image:

podman run -d \
  --name synapse \
  --ip 10.88.0.3 \
  -e SYNAPSE_SERVER_NAME=<my domain> \
  -e SYNAPSE_REPORT_STATS=yes \
  -e SYNAPSE_NO_TLS=1 \
  --mount=type=bind,source=synapse,destination=/data \
  matrixdotorg/synapse:v0.99.2
curl --head http://10.88.0.3:8008/_matrix/static/
HTTP/1.1 200 OK
Server: Synapse/0.99.2
Date: Fri, 01 Mar 2019 13:58:14 GMT
Accept-Ranges: bytes
Content-Length: 10116
Content-Type: text/html
Last-Modified: Fri, 01 Mar 2019 11:10:36 GMT

curl --head http://10.88.0.3:8448
curl: (7) Failed connect to 10.88.0.3:8448; Connection refused
@richvdh
Copy link
Member

richvdh commented Mar 1, 2019

-e SYNAPSE_NO_TLS=1 disables the TLS port.

@richvdh richvdh closed this as completed Mar 1, 2019
@carroarmato0
Copy link
Author

@richvdh you closed this ticket way too fast....

With SYNAPSE_NO_TLS=1

[root@cassandra ~]# podman exec  synapse netstat -naplt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 :::8008                 :::*                    LISTEN      -

With SYNAPSE_NO_TLS=0

[root@cassandra ~]# podman exec  synapse netstat -naplt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 :::8008                 :::*                    LISTEN      -

So no change

@carroarmato0
Copy link
Author

carroarmato0 commented Mar 1, 2019

I dug deeper inside the image and I found the problem, the default homeserver.yaml file isn't configured to listen on the federation port, only on the normal client port.

## Ports ##
listeners:
  - port: 8008
    tls: false
    bind_addresses: ['::']
    type: http
    x_forwarded: false

@carroarmato0
Copy link
Author

@richvdh ah, I've taken a look at the actual code in synapse/docker/conf/homeserver.yamland saw the line:

## Ports ##

listeners:
  {% if not SYNAPSE_NO_TLS %}
  -
    port: 8448
    bind_addresses: ['::']
    type: http
    tls: true
    x_forwarded: false
    resources:
      - names: [client]
        compress: true
      - names: [federation]  # Federation APIs
        compress: false
  {% endif %}

Removing the line "-e SYNAPSE_NO_TLS=1" enables it indeed:

[root@cassandra ~]# podman exec  synapse netstat -naplt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 :::8448                 :::*                    LISTEN      -
tcp        0      0 :::8008                 :::*                    LISTEN      -

@richvdh
Copy link
Member

richvdh commented Mar 1, 2019

@richvdh you closed this ticket way too fast...

I'll reopen it if you convince me there is an actual issue here

With SYNAPSE_NO_TLS=0

see #4663

@carroarmato0
Copy link
Author

@richvdh I can confirm that I experienced the same issue in #4663 as I mentioned above.

# With -e SYNAPSE_NO_TLS=1 \

## Ports ##

listeners:
  

  - port: 8008
    tls: false
    bind_addresses: ['::']
    type: http
    x_forwarded: false

# With  -e SYNAPSE_NO_TLS=0 \


## Ports ##

listeners:
  

  - port: 8008
    tls: false
    bind_addresses: ['::']
    type: http
    x_forwarded: false

If I simply remove the whole entry "-e SYNAPSE_NO_TLS=0" then the entries to define port 8448 is added.

@autoteelar

This comment was marked as abuse.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants