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

/admin/whois broken in v1.44.0rc1 #10957

Closed
squahtx opened this issue Sep 30, 2021 · 1 comment · Fixed by #10968
Closed

/admin/whois broken in v1.44.0rc1 #10957

squahtx opened this issue Sep 30, 2021 · 1 comment · Fixed by #10968
Assignees
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release

Comments

@squahtx
Copy link
Contributor

squahtx commented Sep 30, 2021

Description

/_matrix/client/r0/admin/whois/{user_id} is broken and returns {"errcode":"M_UNKNOWN","error":"Internal server error"}

https://sentry.matrix.org/sentry/synapse-matrixorg/issues/231740/

Traceback (most recent call last):
  File "/home/squah/repos/synapse/synapse/http/server.py", line 258, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/home/squah/repos/synapse/synapse/http/server.py", line 446, in _async_render
    callback_return = await raw_callback_return
  File "/home/squah/repos/synapse/synapse/rest/admin/users.py", line 565, in on_GET
    ret = await self.admin_handler.get_whois(target_user)
  File "/home/squah/repos/synapse/synapse/handlers/admin.py", line 42, in get_whois
    sessions = await self.store.get_user_ip_and_agents(user)
  File "/home/squah/repos/synapse/synapse/storage/databases/main/client_ips.py", line 593, in get_user_ip_and_agents
    )
  File "/home/squah/repos/synapse/synapse/storage/databases/main/client_ips.py", line 594, in <genexpr>
TypeError: tuple indices must be integers or slices, not str

Note that the sytest test for this endpoint passes because during the test, get_user_ip_and_agents obtains the user data from _batch_row_update in-memory and no user data has been persisted to the database yet.

Steps to reproduce

curl 'https://matrix.org/_matrix/client/r0/admin/whois/@squah:matrix.org' -H 'accept: application/json' -H 'authorization: Bearer syt_<... borrow this from Element Web>'

replacing matrix.org with your own homeserver, the user id with your own, and the token with your own.

Version information

  • Version: v1.44.0rc1
@squahtx squahtx added T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release labels Sep 30, 2021
@squahtx squahtx self-assigned this Oct 1, 2021
@babolivier
Copy link
Contributor

babolivier commented Oct 4, 2021

Not sure why github didn't automatically close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants