You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
The ListMediaInRoom from the admin API does not get the auth token from the request. So every request to /_synapse/admin/v1/room/[room-id]/media fails with the error:
{
"errcode": "M_UNKNOWN",
"error": "Internal server error"
}
classListMediaInRoom(RestServlet):
"""Lists all of the media in a given room. """PATTERNS=historical_admin_path_patterns("/room/(?P<room_id>[^/]+)/media")
def__init__(self, hs):
self.store=hs.get_datastore()
# -------------------------# I guess here is missing: # self.auth = hs.get_auth() # ------------------------- @defer.inlineCallbacksdefon_GET(self, request, room_id):
requester=yieldself.auth.get_user_by_req(request)
is_admin=yieldself.auth.is_server_admin(requester.user)
ifnotis_admin:
raiseAuthError(403, "You are not a server admin")
local_mxcs, remote_mxcs=yieldself.store.get_media_mxcs_in_room(room_id)
defer.returnValue((200, {"local": local_mxcs, "remote": remote_mxcs}))
changed the title [-]Admin API: ListMediaInRoom does not fetch auth token from request; throws always error[/-][+]Admin API: `/_synapse/admin/v1/room/[room-id]/media` always throws 500 error[/+]on Jul 23, 2019
Activity
richvdh commentedon Jul 23, 2019
can you share the stacktrace from the logs please?
zingi commentedon Jul 23, 2019
richvdh commentedon Jul 23, 2019
thanks
[-]Admin API: ListMediaInRoom does not fetch auth token from request; throws always error[/-][+]Admin API: `/_synapse/admin/v1/room/[room-id]/media` always throws 500 error[/+]Ensure an auth instance is available to ListMediaInRoom
Ensure an auth instance is available to ListMediaInRoom (#5967)