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

/publicRooms causes internal server error if the server parameter matches the homeserver domain #6325

Closed
sbiberhofer opened this issue Nov 4, 2019 · 1 comment
Assignees
Labels
A-Room-Directory z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@sbiberhofer
Copy link

Description

When calling the /_matrix/client/r0/publicRooms endpoint with a server parameter within a server's domain, the server experiences an internal error, e.g.:

curl --request POST --header "Content-Type: application/json"  --data '{"limit":20,"include_all_networks":true}' "https://matrix.domain.tld/_matrix/client/r0/publicRooms?server=something.domain.tld&access_token=<le_token>

On the server, this results in the following homeserver.log:

2019-11-04 19:52:26,074 - synapse.http.server - 109 - ERROR - POST-705775- Failed handle request via 'PublicRoomListRestServlet': <XForwardedForRequest at 0x80e5ef048 method='POST' uri='/_matrix/client/r0/publicRooms?server=domain.tld&access_token=<redacted>' clientproto='HTTP/1.1' site=8008>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/synapse/http/server.py", line 77, in wrapped_request_handler
    await h(self, request)
  File "/usr/local/lib/python3.6/site-packages/synapse/http/server.py", line 326, in _async_render
    callback_return = await callback_return
  File "/usr/local/lib/python3.6/site-packages/synapse/rest/client/v1/room.py", line 417, in on_POST
    third_party_instance_id=third_party_instance_id,
  File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/usr/local/lib/python3.6/site-packages/synapse/handlers/room_list.py", line 391, in get_remote_public_room_list
    third_party_instance_id=third_party_instance_id,
  File "/usr/local/lib/python3.6/site-packages/synapse/handlers/room_list.py", line 441, in _get_remote_list_cached
    third_party_instance_id=third_party_instance_id,
  File "/usr/local/lib/python3.6/site-packages/synapse/util/caches/response_cache.py", line 151, in wrap
    result = self.set(key, d)
  File "/usr/local/lib/python3.6/site-packages/synapse/util/caches/response_cache.py", line 95, in set
    result = ObservableDeferred(deferred, consumeErrors=True)
  File "/usr/local/lib/python3.6/site-packages/synapse/util/async_helpers.py", line 87, in __init__
    deferred.addCallbacks(callback, errback)
AttributeError: 'NoneType' object has no attribute 'addCallbacks'

This does not cause synapse to crash, but at least causes the explore room functionality in riot to stop working. It also doesn't matter if a subdomain exists or not, or if the server domain name itself is used.

Steps to reproduce

  • obtain access_token or add server explicitly to room list in riot
  • call the API endpoint (as outlined above) or use riot's explore feature and navigate to that server entry

Version information

  • Version: 1.5.0 and 1.4.1
  • Install method: FreeBSD packages as well as on Debian via matrix.org repo
  • Platform: FreeBSD, GNU/Linux
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Room-Directory z-bug (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

4 participants