Can't play audios when logged in
Steps to reproduce
What happens?
An error occurs and audios are not played if you are logged in. If you are not logged in, audios are played without a problem.
What is expected?
The audios should be played.
Context
Funkwhale version(s) affected: x.y 1.2.2
Tested with Firefox and Chrome. Docker mono-container installation using nginx as proxy.
Looks like it's related to #1540 (closed).
Error log:
funkwhale | 2022-02-08 16:49:07,637 django.request ERROR Internal Server Error: /api/v1/activity
funkwhale | Traceback (most recent call last):
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
funkwhale | return self.cursor.execute(sql, params)
funkwhale | psycopg2.errors.UndefinedColumn: column users_accesstoken.id_token_id does not exist
funkwhale | LINE 1: ...e_refresh_token_id", "users_accesstoken"."token", "users_acc...
funkwhale | ^
funkwhale |
funkwhale |
funkwhale | The above exception was the direct cause of the following exception:
funkwhale |
funkwhale | Traceback (most recent call last):
funkwhale | File "/usr/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
funkwhale | response = get_response(request)
funkwhale | File "/usr/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
funkwhale | response = wrapped_callback(request, *callback_args, **callback_kwargs)
funkwhale | File "/usr/lib/python3.9/contextlib.py", line 79, in inner
funkwhale | return func(*args, **kwds)
funkwhale | File "/usr/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
funkwhale | return view_func(*args, **kwargs)
funkwhale | File "/usr/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view
funkwhale | return self.dispatch(request, *args, **kwargs)
funkwhale | File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
funkwhale | response = self.handle_exception(exc)
funkwhale | File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
funkwhale | self.raise_uncaught_exception(exc)
funkwhale | File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
funkwhale | raise exc
funkwhale | File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 497, in dispatch
funkwhale | self.initial(request, *args, **kwargs)
funkwhale | File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 414, in initial
funkwhale | self.perform_authentication(request)
funkwhale | File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 324, in perform_authentication
funkwhale | request.user
funkwhale | File "/usr/lib/python3.9/site-packages/rest_framework/request.py", line 227, in user
funkwhale | self._authenticate()
funkwhale | File "/usr/lib/python3.9/site-packages/rest_framework/request.py", line 380, in _authenticate
funkwhale | user_auth_tuple = authenticator.authenticate(self)
funkwhale | File "/app/api/funkwhale_api/common/authentication.py", line 42, in authenticate
funkwhale | return super().authenticate(request)
funkwhale | File "/usr/lib/python3.9/site-packages/oauth2_provider/contrib/rest_framework/authentication.py", line 27, in authenticate
funkwhale | valid, r = oauthlib_core.verify_request(request, scopes=[])
funkwhale | File "/usr/lib/python3.9/site-packages/oauth2_provider/oauth2_backends.py", line 200, in verify_request
funkwhale | valid, r = self.server.verify_request(uri, http_method, body, headers, scopes=scopes)
funkwhale | File "/app/api/funkwhale_api/users/oauth/server.py", line 33, in verify_request
funkwhale | valid = self.request_validator.validate_bearer_token(
funkwhale | File "/usr/lib/python3.9/site-packages/oauth2_provider/oauth2_validators.py", line 385, in validate_bearer_token
funkwhale | access_token = self._load_access_token(token)
funkwhale | File "/usr/lib/python3.9/site-packages/oauth2_provider/oauth2_validators.py", line 407, in _load_access_token
funkwhale | return AccessToken.objects.select_related("application", "user").filter(token=token).first()
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 674, in first
funkwhale | for obj in (self if self.ordered else self.order_by('pk'))[:1]:
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 280, in __iter__
funkwhale | self._fetch_all()
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all
funkwhale | self._result_cache = list(self._iterable_class(self))
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 51, in __iter__
funkwhale | results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
funkwhale | cursor.execute(sql, params)
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
funkwhale | return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
funkwhale | return executor(sql, params, many, context)
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
funkwhale | return self.cursor.execute(sql, params)
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
funkwhale | raise dj_exc_value.with_traceback(traceback) from exc_value
funkwhale | File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
funkwhale | return self.cursor.execute(sql, params)
funkwhale | django.db.utils.ProgrammingError: column users_accesstoken.id_token_id does not exist
funkwhale | LINE 1: ...e_refresh_token_id", "users_accesstoken"."token", "users_acc...