Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing, undeclared future dependency of celery #273

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

DasSkelett
Copy link
Member

Problem

Traceback (most recent call last):
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/kombu/utils/objects.py", line 42, in __get__
    return obj.__dict__[self.__name__]
KeyError: 'backend'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/KerbalStuff/common.py", line 78, in go
    ret = f(*args, **kw)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/KerbalStuff/blueprints/api.py", line 126,in wrapper
    return func(*args, **kwargs)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/KerbalStuff/common.py", line 121, in wrapper
    result = f(*args, **kwargs)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/KerbalStuff/blueprints/api.py", line 432,in change_password
    send_password_changed(current_user)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/KerbalStuff/email.py", line 37, in send_password_changed
    send_mail.delay(_cfg('support-mail'), [user.email], f'Your password on {_cfg("site-name")} hasbeen changed',
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/celery/app/task.py", line 425, in delay
    return self.apply_async(args, kwargs)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/celery/app/task.py", line 565, in apply_async
    return app.send_task(
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/celery/app/base.py", line 779, in send_task
    self.backend.on_task_call(P, task_id)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/kombu/utils/objects.py", line 44, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/celery/app/base.py", line 1232, in backend
    return self._get_backend()
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/celery/app/base.py", line 947, in _get_backend
    backend, url = backends.by_url(
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/celery/app/backends.py", line 74, in by_url
    return by_name(backend, loader), url
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/celery/app/backends.py", line 54, in by_name
    cls = symbol_by_name(backend, aliases)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/kombu/utils/imports.py", line 57, in symbol_by_name
    module = imp(module_name, package=package, **kwargs)
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/var/www/virtual/spacedock.info/htdocs/SpaceDock/lib/python3.8/site-packages/celery/backends/base.py", line 10, in <module>
    from future.utils import raise_with_traceback
ModuleNotFoundError: No module named 'future'

Flask crashes when trying to send an email

Cause

Python's special future module is a new dependency by celery v4.4.4, which they forgot to list in the requirements:
celery/celery#6145
celery/celery#6148
And a fixing PR is already merged, but it may take some time until they release a new version:
celery/celery#6146

Solution

Install the future module manually for now.

A new dependency by celery v4.4.4, which they forgot to list in the requirements:
celery/celery#6145
celery/celery#6148
And a fixing PR:
celery/celery#6146
So we just need to install the future module ourselves for now.
@DasSkelett DasSkelett added Type: Bug Area: Backend Related to the Python code that runs inside gunicorn Area: Email Related to automated emails that we send to users Priority: High labels Jun 3, 2020
@DasSkelett DasSkelett changed the title Add missing, undeclared requirement of celery Add missing, undeclared future dependency of celery Jun 3, 2020
@HebaruSan HebaruSan merged commit 0822bcd into KSP-SpaceDock:alpha Jun 3, 2020
@DasSkelett DasSkelett deleted the fix/celery-future branch June 3, 2020 16:16
@HebaruSan HebaruSan mentioned this pull request Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Backend Related to the Python code that runs inside gunicorn Area: Email Related to automated emails that we send to users Priority: High Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants