matrix-org / sydent

Sydent: Reference Matrix Identity Server
http://matrix.org
Apache License 2.0
303 stars 84 forks source link

[Question] Connect with homeserver #559

Closed Maypul closed 1 year ago

Maypul commented 1 year ago

Hi there! Could I please ask someone to tell me what exactly is needed to be configured on Synapse's end to make Sydent work with it? It seems no matter what I do, I always get timeout in Sydent's logs -> sydent.http.servlets.registerservlet - 64 - WARNING - Unable to contact the Matrix homeserver (TimeoutError) My setup is pretty simple, I think, everything in docker, Synapse itself works, federation works (via delegation), I have have Synapse behind nginx proxy, matrix.domain.com, domain.com and federation.domain.com for federation port, I hae it as separate listener on a separate port.

2023-03-20T16:15:25.243941160Z stderr 2023-03-20 17:15:25,243 - twisted - 147 - INFO - Timing out client: IPv4Address(type='TCP', host='XX.XX.X.XXX', port=44678) 2023-03-20T16:14:25.243098431Z stderr 2023-03-20 17:14:25,242 - twisted - 147 - INFO - Stopping factory _HTTP11ClientFactory(<function HTTPConnectionPool._newConnection..quiescentCallback at 0x7f8cf28f7d30>, <twisted.internet.endpoints._WrapperEndpoint object at 0x7f8cf28fa0d0>) 2023-03-20T16:14:25.242920211Z stderr 2023-03-20 17:14:25,242 - twisted - 147 - INFO - "XX.XX.X.XXX" - - [20/Mar/2023:16:14:25 +0000] "POST /_matrix/identity/v2/account/register HTTP/1.1" 500 91 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0" 2023-03-20T16:14:25.242365370Z stderr 2023-03-20 17:14:25,242 - sydent.http.servlets.registerservlet - 64 - WARNING - Unable to contact the Matrix homeserver (TimeoutError) 2023-03-20T16:13:55.240677739Z stderr 2023-03-20 17:13:55,240 - twisted - 147 - INFO - Starting factory _HTTP11ClientFactory(<function HTTPConnectionPool._newConnection..quiescentCallback at 0x7f8cf28f7d30>, <twisted.internet.endpoints._WrapperEndpoint object at 0x7f8cf28fa0d0>) 2023-03-20T16:13:55.238697715Z stderr 2023-03-20 17:13:55,238 - twisted - 147 - INFO - Stopping protocol <twisted.names.dns.DNSDatagramProtocol object at 0x7f8cf28fa7c0> 2023-03-20T16:13:55.238447344Z stderr 2023-03-20 17:13:55,238 - twisted - 147 - INFO - (UDP Port 9767 Closed) 2023-03-20T16:13:55.237144302Z stderr 2023-03-20 17:13:55,237 - sydent.http.matrixfederationagent - 396 - INFO - Connecting to domain.com:8448 2023-03-20T16:13:55.237014811Z stderr 2023-03-20 17:13:55,236 - sydent.http.matrixfederationagent - 391 - INFO - Endpoint created with b'domain.com':8448 2023-03-20T16:13:55.180246698Z stderr 2023-03-20 17:13:55,180 - twisted - 147 - INFO - Starting protocol <twisted.names.dns.DNSDatagramProtocol object at 0x7f8cf28fa7c0> 2023-03-20T16:13:55.180012678Z stderr 2023-03-20 17:13:55,179 - twisted - 147 - INFO - DNSDatagramProtocol starting on 9767

I have account creation disabled on synapse, guest access is disabled too at the moment, only account creation is allowed via oauth provider. I can not seem to figure it out. The only thing "not working" on my Synapse installation would be external integration manager but that was never the aim to make it work and I guess that is because I have registration disabled so bot can not register with my server. Is the case with Sydent similar?

reivilibre commented 1 year ago

I'd suggest trying https://federationtester.matrix.org/ to see if federation looks about right for your homeserver.

Maypul commented 1 year ago

I'd suggest trying https://federationtester.matrix.org/ to see if federation looks about right for your homeserver.

It does look right. It does work. It connects on site, I can connect to external servers, they can to mine. I just can not get Sydent to work, no idea what could be wrong/blocking it. I always get a timeout after a while. At first Sydent did say that IP was blacklisted so I added it to whitelist (synapse's server) and it does connect looking at the logs, just clients time outs.

Maypul commented 1 year ago

I checked public server, it can connect to my Sydent instance. There must be some specific setting in Synapse that is blocking and timing out this connection that I am not aware of.

Somewhow public server shows it connects at port 443 whereas for my server it tries to connect at 8443. Though, in the delefation I do deletate it to port 443.

Well-Known Matrix Server

location /.well-known/matrix/server {
    default_type application/json;
    return 200 '{"m.server": "federation.domain.com:443"}';
    add_header Access-Control-Allow-Origin *;
}

Possibly that's the issue but I wonder why it would use different port when the federation does work otherwise?

H-Shay commented 1 year ago

Hi there, this looks like a support request rather than a bug report - I am going to redirect you to #sydent:matrix.org and #synapse:matrix.org for further questions.