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

/_synapse/admin/v2/users is broken #6552

Closed
aaronraimist opened this issue Dec 15, 2019 · 3 comments
Closed

/_synapse/admin/v2/users is broken #6552

aaronraimist opened this issue Dec 15, 2019 · 3 comments
Labels
A-Admin-API z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@aaronraimist
Copy link
Contributor

aaronraimist commented Dec 15, 2019

Running the /_synapse/admin/v2/users as documented produces an internal server error

Postgres logs:

STATEMENT:  SELECT name, password_hash, is_guest, admin, user_type, deactivated FROM users WHERE is_guest = false AND deactivated = false ORDER BY name ASC LIMIT 10 OFFSET 0
ERROR:  operator does not exist: smallint = boolean at character 95

\d users shows that is_guest and deactivated are type smallint not boolean.


                          Table "public.users"
           Column           |   Type   | Collation | Nullable | Default
----------------------------+----------+-----------+----------+---------
 name                       | text     |           |          |
 password_hash              | text     |           |          |
 creation_ts                | bigint   |           |          |
 admin                      | smallint |           | not null | 0
 upgrade_ts                 | bigint   |           |          |
 is_guest                   | smallint |           | not null | 0
 appservice_id              | text     |           |          |
 consent_version            | text     |           |          |
 consent_server_notice_sent | text     |           |          |
 user_type                  | text     |           |          |
 deactivated                | smallint |           | not null | 0
@richvdh
Copy link
Member

richvdh commented Dec 16, 2019

@awesome-manuel any chance you could take a look at this?

@awesome-manuel
Copy link
Contributor

@richvdh Sure, I can fix it.

@wellic
Copy link

wellic commented Dec 21, 2019

@awesome-manuel

I think you forgot to change in code: parse_boolean to parse_integer for guests and deactivated:

  1. guests = parse_integer(request, "guests", default=1)
  2. deactivated = parse_integer(request, "deactivated", default=0)

@neilisfragile neilisfragile added z-bug (Deprecated Label) z-p2 (Deprecated Label) labels Jan 8, 2020
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) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

6 participants