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

BAD GATEWAY when I try to join a room #2957

Closed
bzhfloriane opened this issue Mar 7, 2018 · 7 comments
Closed

BAD GATEWAY when I try to join a room #2957

bzhfloriane opened this issue Mar 7, 2018 · 7 comments

Comments

@bzhfloriane
Copy link

bzhfloriane commented Mar 7, 2018

I'm trying to join the room #matrix-dev:matrix.org, but I get a 502 Bad Gateway error.
Here are my logs when I try to join this room:

2018-03-06 12:14:31,666 - synapse.access.http.8008 - 59 - INFO - GET-434- - - 8008 - Received request: GET /_matrix/client/api/v1/directory/room/%23matrix-dev%3Amatrix.org
2018-03-06 12:14:31,668 - synapse.http.outbound - 154 - INFO - GET-434- {GET-O-12} [matrix.org] Sending request: GET matrix://matrix.org/_matrix/federation/v1/query/directory?room_alias=%23matrix-dev%3Amatrix.org
2018-03-06 12:14:32,797 - synapse.handlers.typing - 78 - INFO - - Checking for typing timeouts
2018-03-06 12:14:32,797 - synapse.handlers.presence - 327 - INFO - - Handling presence timeouts
2018-03-06 12:14:32,873 - synapse.storage.TIME - 213 - INFO - - Total database time: 0.004% {get_destination_retry_timings(1): 0.003%, _update_client_ips_batch(2): 0.001%, who_forgot(0): 0.000%} {}
2018-03-06 12:14:37,796 - synapse.handlers.typing - 78 - INFO - - Checking for typing timeouts
2018-03-06 12:14:37,797 - synapse.handlers.presence - 327 - INFO - - Handling presence timeouts
2018-03-06 12:14:42,795 - synapse.handlers.typing - 78 - INFO - - Checking for typing timeouts
2018-03-06 12:14:42,797 - synapse.handlers.presence - 327 - INFO - - Handling presence timeouts
2018-03-06 12:14:42,872 - synapse.storage.TIME - 213 - INFO - - Total database time: 0.001% {_update_client_ips_batch(2): 0.001%, who_forgot(0): 0.000%, update_user_directory_stream_pos(0): 0.000%} {}
2018-03-06 12:14:42,899 - synapse.http.outbound - 236 - INFO - GET-434- {GET-O-12} [matrix.org] Result: 502 Bad Gateway
2018-03-06 12:14:42,900 - root - 188 - WARNING - GET-434- Error retrieving alias
2018-03-06 12:14:42,902 - synapse.http.server - 127 - ERROR - GET-434- 502: Bad Gateway
Traceback (most recent call last):
  File "/root/.synapse/lib/python2.7/site-packages/synapse/http/server.py", line 117, in wrapped_request_handler
    yield request_handler(self, request, request_metrics)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/root/.synapse/lib/python2.7/site-packages/synapse/http/server.py", line 263, in _async_render
    callback_return = yield callback(request, **kwargs)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/root/.synapse/lib/python2.7/site-packages/synapse/rest/client/v1/directory.py", line 50, in on_GET
    res = yield dir_handler.get_association(room_alias)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/root/.synapse/lib/python2.7/site-packages/synapse/handlers/directory.py", line 185, in get_association
    ignore_backoff=True,
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/root/.synapse/lib/python2.7/site-packages/synapse/federation/transport/client.py", line 188, in make_query
    ignore_backoff=ignore_backoff,
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/root/.synapse/lib/python2.7/site-packages/synapse/http/matrixfederationclient.py", line 442, in get_json
    ignore_backoff=ignore_backoff,
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1386, in _inlineCallbacks
    result = g.send(result)
  File "/root/.synapse/lib/python2.7/site-packages/synapse/http/matrixfederationclient.py", line 247, in _request
    response.code, response.phrase, body
HttpResponseException: 502: Bad Gateway

My conf of nginx is :

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen 80;
        server_name localhost;

        location /_matrix {
            proxy_pass http://localhost:8008;
            proxy_set_header X-Forwarded-For $remote_addr;
        }
   }
}

Any help is appreciated..

@neilisfragile
Copy link
Contributor

Hi @bzhfloriane is this issue persisting? Can you join other rooms?

@bzhfloriane
Copy link
Author

bzhfloriane commented Mar 9, 2018

@neilisfragile
Yes I still have this problem. No, I can not join any room. And I'm also trying to create a discussion with another server, but that puts me these errors :

2018-03-08 17:38:47,207 - synapse.handlers.profile - 123 - ERROR - POST-793- Failed to get displayname
Traceback (most recent call last):
  File "/root/.synapse/lib/python2.7/site-packages/synapse/handlers/profile.py", line 115, in get_displayname
    ignore_backoff=True,
ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.

2018-03-08 17:38:47,515 - synapse.handlers.profile - 176 - ERROR - POST-793- Failed to get avatar_url
Traceback (most recent call last):
  File "/root/.synapse/lib/python2.7/site-packages/synapse/handlers/profile.py", line 169, in get_avatar_url
    ignore_backoff=True,
ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.

2018-03-08 17:38:53,261 - synapse.http.server - 145 - ERROR - POST-793- Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x53777d0>: <XForwardedForRequest at 0x5ecaa70 method=POST uri=/_matrix/client/api/v1/createRoom?access_token=<redacted> clientproto=HTTP/1.1 site=8008>: Traceback (most recent call last):
Failure: twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.

@iammer
Copy link

iammer commented May 15, 2018

I am seeing this too. Did you ever find a solution?

@neilisfragile
Copy link
Contributor

Can't reproduce and so struggling to debug - can you send through some recent logs?

@iammer
Copy link

iammer commented May 16, 2018

@neilisfragile, I believe I had figured this out. I had misconfigured my SRV record and was pointing to the wrong port. 8448 vs 443

@richvdh richvdh closed this as completed Sep 18, 2018
@Torstein-Eide

This comment has been minimized.

@Half-Shot
Copy link
Collaborator

@Eideen it would be better to create a new issue rather than trying to reuse a closed one. You've already created #5086, so let's use that.

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

6 participants