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

Cannot set a user as an admin with the admin API #6910

Closed
turt2live opened this issue Feb 13, 2020 · 4 comments
Closed

Cannot set a user as an admin with the admin API #6910

turt2live opened this issue Feb 13, 2020 · 4 comments
Labels
A-Admin-API z-bug (Deprecated Label)

Comments

@turt2live
Copy link
Member

2020-02-13 19:15:53,449 - synapse.http.server - 110 - ERROR - PUT-31 - Failed handle request via 'UserRestServletV2': <SynapseRequest at 0x7f6a6035bfd0 method='PUT' uri='/_synapse/admin/v2/users/@mjolnir-dev:redacted' clientproto='HTTP/1.0' site=8008>
Traceback (most recent call last):
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: {'displayname': 'mjolnir-dev', 'avatar_url': None}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: {'displayname': 'mjolnir-dev', 'avatar_url': None}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: ProfileInfo(avatar_url=None, display_name='mjolnir-dev')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/synapse/http/server.py", line 78, in wrapped_request_handler
    await h(self, request)
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/synapse/http/server.py", line 331, in _async_render
    callback_return = await callback_return
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/synapse/rest/admin/users.py", line 185, in on_PUT
    await self.admin_handler.set_user_server_admin(
AttributeError: 'AdminHandler' object has no attribute 'set_user_server_admin'

Synapse 1.10

Request:

curl -s -X PUT -H "Authorization: Bearer ${token}" -H "Content-Type: application/json" -d '{"admin":true}' https://dev.t2host.io/_synapse/admin/v2/users/@mjolnir-dev:redacted
{
    "errcode": "M_UNKNOWN",
    "error": "Internal server error"
}
@richvdh richvdh added the z-bug (Deprecated Label) label Feb 14, 2020
@richvdh
Copy link
Member

richvdh commented Feb 14, 2020

I think this was introduced by #6751

@dklimpel
Copy link
Contributor

Also old api (/_synapse/admin/v1/users/<user_id>/admin) is broken

@richvdh richvdh changed the title Cannot set a user as an admin with the new API Cannot set a user as an admin with the admin API Feb 20, 2020
@Cadair
Copy link
Contributor

Cadair commented Feb 21, 2020

This has just bit me as well, I had no idea why it was misbehaving until @Half-Shot pointed me at this.

@richvdh
Copy link
Member

richvdh commented Feb 21, 2020

@dklimpel has made a PR to fix this at #6928; hopefully it will land soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Admin-API z-bug (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

4 participants