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

Trying to rejoin a local empty room gives a 500 error #2141

Closed
ChazyTheBest opened this issue Apr 20, 2017 · 14 comments
Closed

Trying to rejoin a local empty room gives a 500 error #2141

ChazyTheBest opened this issue Apr 20, 2017 · 14 comments

Comments

@ChazyTheBest
Copy link

In a quick setup of my custom server I tried the following and got an error:

  • Create a new room
  • Leave
  • Try to join again
  • Internal server error (M_UNKNOWN)

With both the web client and riot.im. But the room still exists, and I can see the history (only using riot.im, the synapse web client redirects to home).

@richvdh
Copy link
Member

richvdh commented Apr 20, 2017

@ChazyTheBest when I do this, I don't get an internal server error; I get a 404 with:

{"errcode":"M_UNKNOWN","error":"No known servers"}

This is somewhat expected, as per https://github.com/vector-im/riot-web/issues/1194, https://github.com/matrix-org/matrix-doc/issues/534, and #1533.

If you're actually seeing an internal server error, could you share logs from your homeserver?

@richvdh
Copy link
Member

richvdh commented Apr 20, 2017

With both the web client and riot.im.

riot.im is the web client.

@richvdh
Copy link
Member

richvdh commented Apr 20, 2017

With both the web client and riot.im.

riot.im is the web client.

ohh, you meant the matrix console client. Ignore the last message.

@ChazyTheBest
Copy link
Author

ChazyTheBest commented Apr 20, 2017

No, I meant the synapse web client, the one i can access via https://127.0.0.1:8448. The internal server error is from riot.im

Where are the logs located? I'm not too good with systemd and I think they may be in the journal somewhere.

@richvdh
Copy link
Member

richvdh commented Apr 20, 2017

The webapp bundled with synapse is called matrix console: http://matrix.org/docs/projects/client/matrix-console.html.

riot.im is just serving static assets; it's very unlikely to be serving an internal server error. Can you share a screenshot?

The synapse logs will be wherever you (or the distribution you use) has configured them to be... check the homeserver.yaml for log_config or log_file; or try journalctl -u synapse to get the logs from the synapse systemd unit. Sorry, it's very hard to guess where they might be. I suggest you come and get support in one of the public matrix rooms if you can't find them.

@ChazyTheBest
Copy link
Author

So that's it, sorry I didn't know.

Here's a screenshot of the error and the steps:

From riot.im:

  • Create the new room
  • Give the room a local address and list it publicly
  • Check it's listed and enter again
  • Leave room and try to rejoin

screenshot_20170421_202505

The homeserver.yaml file says the log file is in /var/lib/synapse/homeserver.log but it's not there (not created).

@richvdh
Copy link
Member

richvdh commented Apr 21, 2017

Ok thanks. That looks like synapse is returning an ISE to the join request.

I fear we're not going to get far without the synapse logs.

Worth noting that log_config takes precedence over log_file if both are specified.

@ChazyTheBest
Copy link
Author

The *log.config file says the same: filename: /var/lib/synapse/homeserver.log.

I'll join the matrix room tomorrow to ask how to get the logs.

@richvdh
Copy link
Member

richvdh commented Apr 26, 2017

if you get the logs let us know and we can reopen this

@richvdh richvdh closed this as completed Apr 26, 2017
@david-austin
Copy link

I just ran into this Problem yesterday and want to share my log:
matrix_synapse_exception.log

I used the docker image from Silvio to install a Synapse server and did just the same thing:

  • create a new room
  • leave
  • try to join again

If you need any further information let me know

@edwinbalani
Copy link

@richvdh I have been able to reproduce this issue, using a different environment from what @david-austin has (details below).

Description

Unable to join a room that contains no members. The homeserver returns HTTP 500 (internal server error) to the join request.

The room used to reproduce this belonged to the same homeserver to which I was connected.

Steps to reproduce

  1. Create a room (in this example, #test-public:_redacted_.example.com), make it joinable by all
  2. Leave the room, meaning it has no members
  3. Attempt to join the room again
  • Result: server returns code 500.
  • Client behaviour:
    • riot-web shows a modal entitled "Failed to join room", with the message "Internal server error"
    • This Weechat client logs HTTP API returned error. Code: 500, reason: Internal Server Error

homeserver.log

2018-04-08 22:29:40,829 - synapse.http.server - 191 - ERROR - POST-3- Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x7f118ccd4fd0>: <XForwardedForRequest 
at 0x7f118c192b90 method=POST uri=/_matrix/client/r0/join/%23test-public%3A_redacted_.example.com?access_token=<redacted> clientproto=HTTP/1.0 site=8008>: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1445, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1299, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python2.7/dist-packages/synapse/handlers/federation.py", line 1199, in _make_and_verify_event
    content,
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1445, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1299, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python2.7/dist-packages/synapse/federation/federation_client.py", line 536, in make_membership_event
    raise RuntimeError("Failed to send to any server.")
exceptions.RuntimeError: Failed to send to any server.

Environment information

  • Homeserver: Own Synapse homeserver. Hostname is the same as Matrix 'server name', in both cases I've changed it to _redacted_.example.com here, as the homeserver is a private one.
  • Version: 0.27.2
  • Install method: apt, from Debian repo at https://matrix.org/packages/debian/
  • Platform: Debian 9.4 Stretch, running in an Amazon EC2 t2.micro instance.
  • Networking:
    • Port 8008 is proxied behind nginx on 443, but port 8448 goes directly to the Synapse daemon.
    • The request in this case came in on 443 and was forwarded by nginx to Synapse.
    • Both IPv4 and IPv6 in use.

@ara4n
Copy link
Member

ara4n commented Apr 8, 2018

This is https://github.com/matrix-org/matrix-doc/issues/534. Thanks for the comprehensive bug report, but the best bet is to upvote that one instead.

@edwinbalani
Copy link

Thanks for the heads-up @ara4n; I was posting here mainly because of this:

when I do this, I don't get an internal server error; I get a 404
If you're actually seeing an internal server error, could you share logs from your homeserver?

And I've reproduced this -- i.e. not getting 404 but 500, which seems to be a deviation from what's expected.

@richvdh richvdh changed the title Can't rejoin a room that I created and left Trying to rejoin a local empty room gives a 500 error Apr 9, 2018
@richvdh
Copy link
Member

richvdh commented Apr 9, 2018

thanks for the reports. It looks like we return a 500 when the room alias is on the local server.

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

5 participants