Ouranosinc / Magpie

AuthN/AuthZ services
https://pavics-magpie.readthedocs.io
Apache License 2.0
1 stars 5 forks source link

[BUG] Unable to create user with Magpie 3.8.0 #427

Closed tlvu closed 3 years ago

tlvu commented 3 years ago

Describe the bug Creating a new user (username: lvu2, email: a@b.c, password: more_than_12_char, group: users) result in this error in the logs (docker logs magpie):

[2021-05-04 13:37:17,017] INFO       [ThreadPoolExecutor-0_0][magpie.api.requests] User 'admin' is authenticated
[2021-05-04 13:37:17,017] INFO       [ThreadPoolExecutor-0_0][magpie.api.requests] User 'admin' is authenticated
[2021-05-04 13:37:17,025] ERROR      [ThreadPoolExecutor-0_0][magpie.ui.utils] Unexpected API error under UI operation. [TypeError: argument of type 'Response' is not iterable]
Traceback (most recent call last):
  File "/opt/local/src/magpie/magpie/ui/utils.py", line 123, in wrap
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pyramid/viewderivers.py", line 436, in rendered_view
    result = view(context, request)
  File "/usr/local/lib/python3.7/site-packages/pyramid/viewderivers.py", line 116, in _class_requestonly_view
    response = getattr(inst, attr)()
  File "/opt/local/src/magpie/magpie/ui/management/views.py", line 232, in add_user
    if user_email in self.get_user_emails():
TypeError: argument of type 'Response' is not iterable
[2021-05-04 13:37:17,034] INFO       [ThreadPoolExecutor-0_0][magpie.utils] Request: [POST pavics.ouranos.ca:443 /magpie/ui/error]

Screenshot_2021-05-04 Magpie

Desktop (please complete the following information):

Impact

This is blocking us from creating new Jupyter users in production. If a work-around exists without waiting for a new version with a fix, please let us know.

@tlogan2000 FYI.

tlvu commented 3 years ago

Found a work-around, using https://github.com/bird-house/birdhouse-deploy/blob/02d1e9db0cfc0ca0c2ca382e379228a48d4ca182/birdhouse/scripts/create-magpie-authtest-user#L13-L19 and replacing that config with the user we want to create.

fmigneault commented 3 years ago

@tlvu As a workaround, you can do the calls via API or CLI until the fix is integrated. Seems the issue is only specific to the UI.

fmigneault commented 3 years ago

fix available in 3.10.1