wizarrrr / wizarr

Wizarr is an advanced user invitation and management system for Jellyfin, Plex, Emby etc.
https://docs.wizarr.dev
MIT License
1.25k stars 86 forks source link

[Bug] | Guest User causes Wizarr to remove server access for everyone #339

Closed ArmonicPvP closed 4 months ago

ArmonicPvP commented 5 months ago

Are you using the latest release?

Have you checked a bug report doesn't already exist?

What happened?

When I clicked to "Scan Users" I got a 500 error. Logging into Plex shows the server completely missing from my account. Restarting the Plex server fixes the issue. After disabling my Guest user, the issue seems to have fixed itself. I haven't scanned again, but it could just be an issue with me having a picture on my account.

Virtualisation

Unraid

What operating system are you seeing the problem on?

Windows

What browsers are you seeing the problem on?

Chrome

Project Location

Local

Bug Description

When I clicked to "Scan Users" I got a 500 error. Logging into Plex shows the server completely missing from my account. Restarting the Plex server fixes the issue. After disabling my Guest user, the issue seems to have fixed itself. I haven't scanned again, but it could just be an issue with me having a picture on my account.

Steps to Reproduce

  1. Scan Users with Guest account enabled

Relevant Log Output

06:59:35 ERROR Exception on /api/users/310486303/profile-picture [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/flask_restx/api.py", line 404, in wrapper
    resp = resource(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/flask/views.py", line 109, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/flask_restx/resource.py", line 46, in dispatch_request
    resp = meth(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/flask_jwt_extended/view_decorators.py", line 170, in decorator
    return current_app.ensure_sync(fn)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/flask_caching/__init__.py", line 399, in decorated_function
    rv = self._call_fn(f, *args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/flask_caching/__init__.py", line 175, in _call_fn
    return ensure_sync(fn)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/wizarr/backend/api/routes/users_api.py", line 52, in get
    picture = global_get_user_profile_picture(user_id)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/wizarr/backend/helpers/universal.py", line 238, in global_get_user_profile_picture
    return get_plex_profile_picture(user_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/wizarr/backend/helpers/plex.py", line 318, in get_plex_profile_picture
    user = get_plex_user(user_id=user_id, server_api_key=server_api_key, server_url=server_url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/wizarr/backend/helpers/plex.py", line 220, in get_plex_user
    response: MyPlexUser = plex.myPlexAccount().user(user_id)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plexapi/myplex.py", line 659, in user
    raise NotFound(f'Unable to find user {username}')
plexapi.exceptions.NotFound: Unable to find user 310486303
06:59:35 INFO 127.0.0.1 - - [2024-03-24 06:59:35] "GET /api/users/310486303/profile-picture HTTP/1.0" 500 383 1.088817
ArmonicPvP commented 5 months ago

Just tested again, and it happened this time with no 500 error. The sever is completely removed from my dashboard. I have to restart Plex for it to show up again.

image

wizarr-sentry[bot] commented 4 months ago

:tada: This issue has been resolved in version 4.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: