Solveddjango celery beat Not compatible with celery 5.0.0

Summary:

When go to admin periodictask page, these is an error.

  • Celery Version: 5.0.0
  • Celery-Beat Version: 2.0.0

Exact steps to reproduce the issue:

  1. Login to admin page
  2. Click Periodic tasks
  3. Boom

Detailed information

LOGS

Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/django_celery_beat/periodictask/

Django Version: 3.1.1
Python Version: 3.8.5
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'user_sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mptt',
'import_export',
'graphene_django',
'django_celery_beat',
'storage',
'board',
'xiaoai',
'iot',
'corsheaders']
Installed Middleware:
['corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'user_sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback (most recent call last):
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\core\handlers\base.py", line 179, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\contrib\admin\options.py", line 614, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\utils\decorators.py", line 130, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\views\decorators\cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\contrib\admin\sites.py", line 233, in inner
return view(request, *args, **kwargs)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django_celery_beat\admin.py", line 156, in changelist_view
extra_context['wrong_scheduler'] = not is_database_scheduler(scheduler)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django_celery_beat\utils.py", line 42, in is_database_scheduler
from .schedulers import DatabaseScheduler
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django_celery_beat\schedulers.py", line 11, in
from celery.utils.encoding import safe_str, safe_repr

Exception Type: ModuleNotFoundError at /admin/django_celery_beat/periodictask/
Exception Value: No module named 'celery.utils.encoding'

17 Answers

✔️Accepted Answer

if you need a quick local fix, you can monkey patch it in a high level init module:

import sys
from kombu.utils import encoding
sys.modules['celery.utils.encoding'] = encoding

Other Answers:

v2.1.0 is now on pypi

v2.1.0 works with Celery v5.0.0 in my setup the issue is resolved and can be closed.

Related Issues:

15
django celery beat Not compatible with celery 5.0.0
if you need a quick local fix you can monkey patch it in a high level init module: ...
13
django celery beat Django Celery Beat admin updating Cron Schedule Periodic task not taking effect?
Same issue as OP after save in admin the beat process outputs DatabaseScheduler: Schedule changed bu...
147
cookiecutter django No support for python3? I am getting: invalid syntax: raise ValueError, "No frame marked with %s." % fname
For me the issue was that I installed the environ package instead of the django-environ package. ...
22
kombu Table empty or key no longer exists
faced this same issue on the first queue whenever i started a second or more queues fixed by downgra...
22
cookiecutter django Invalid HTTP_HOST header: <ip>. You may need to add <ip> to ALLOWED_HOSTS.
@piyushmaurya23 if you do set ALLOWED_HOSTS = ['*'] for the love of God don't leave it as such once ...
11
cookiecutter django docker/celery exits because celery is run as root
It's only running locally where it's a problem In my dev.yml I added C_FORCE_ROOT to the environment...
373
Zappa bad magic number in 'application': b'\x03\xf3\r\n': ImportError
I was able to fix this too by doing find -name \*.pyc -delete Mine definitely wasn't caused by PY2 -...
94
Zappa AttributeError: 'module' has no attribute 'get_installed_distributions'
You probably have a newer pip they made changes to their public api top level functions recently Try...
91
graphene django Bypass csrf
Hi @nlhkh! You can do something like: I have the use case of a mobile client app accessing graphql r...
51
sentry sentry 9 clean install - Oops! Something went wrong
Well we can try to do something here :) Run sentry shell which will give you a python REPL within Se...
50
graphene django Is it possible to get the headers from the request?
@Oxyrus you can access request and its headers by using context field from info parameter in your re...
41
graphene django Is totalCount not implemented on Relay?
This is how to do it in version 2 (graphene is woefully undocumented) :( This gives me an error in /...
32
djongo int() argument must be a string, a bytes-like object or a number, not 'ObjectId'
Hello @Rockflo and @raghava-k2; Basically under the hood Well I may have missed something there (dja...
31
djongo Cannot correctly set primary key
Fix for the issue with error similar to the one given below : Hey @ngdcminhuet I too faced this issu...
26
graphene django Different types with the same name in the schema - Django fields with choices
It seems you're not allowed to include type in your field's name Hi ...
25
django webpack loader render_bundle failing with TypeError: string indices must be integers
@owais please note that installing the npm package as per README results in a package.json that incl...
22
sentry [ERROR] celery.worker.job: Task sentry.tasks.store.save_event[c092365d-609b-454a-a66f-2b7039fb44d8] raised unexpected
Well I fixed this problem it is not easy I build sentry and run it with docker and i can create my p...
22
djongo Having trouble connecting to MongoDB Atlas
pip install djongo pip install dnspython in settings.py DATABASES = { 'default': { 'ENGINE': 'djongo...
15
factory_boy ImportError: The fake-factory package is now called Faker.
Just fixed with 2.8.1 — I had to upload a couple of versions to fix an issue with recent setuptools ...
15
awx Error with pip-docker (3.0.1): "Error connecting: load_config() got an unexpected keyword argument 'config_dict'"
For me even installing docker 3.1.3 resulted in errors What I had to do was: And the error stopped. ...
15
sentry Slack Integration: Inability to connect private channel
Thanks for the report! We added support for reporting to private channels just yesterday 18ae499 Bec...
14
awx Playbook fails when ssh host key changes
Giant pain in Ansible Tower Anytime an IP is recycled we've got manually clear it from the known_hos...
13
Zappa Error loading psycopg2 module on Python 3.6 (when on Lambda)
I solved the issue by installing psycopg2-binary Context Shiny new Zappa 0.41 and Python 3.6 Django=...
12
awx Provide custom CA certificate or skip-verify option for LDAP auth
I'm just passing following env var to awxweb container: env: LDAPTLS_REQCERT: never ...
11
django storages GS_CREDENTIALS clarification
We found another way Instead of doing this do this I've downloaded the service account json file and...
8
weblate weblate & icu format
Hello I've been looking at using Weblate for the FrankerFaceZ project (browser extension for Twitch)...
6
graphene django How to extend connection info?
I made the code reusable IMHO But it is not a beautiful. Hi ...
6
pretix don't use flags to indicate languages
Just a word of appreciation and gratitude for the welcoming gesture Hi please don't spread the bad h...
6
wagtail Latest code throws 'unexpected keyword argument parent_page' in django-modelcluster
Funny that we all encounter the same problem within minutes I have the same problem I have a working...
4
django blog zinnia Zinnia0.18, in Python3 venv, DEBUG on, Cannot resolve keyword 'entries' into field. Choices are:avatar, comment_comments,...
I don't understand what's going under the hood but here is what I have found When DEBUG is True ...
4
sentry sentry-cli releases set-commits --auto not working -> trying to match repo url https to ssh
@petterhoel Have you considered re-adding the origin remote to the clone that netlify made? @marksto...
4
Zappa Error when deploying AWS Lambda with Zappa package
I seems that https://pypi.org/project/troposphere/ causes the problem: release 3.0.0 does not instal...
3
awx Web Service not working due to missing instance for the host
I found the root cause of the problem lies between the file awx/installer/roles/image_build/files/la...
3
django rest framework django rest filter working but browsable api not showing filter forms
@xordoquy Isn't this a real issue? I have been facing the same problem from v3.5.4 to v3.6.2 ...
3
django oauth toolkit Grant type client_credentials not working with Django 1.11
I think it might be better to override the OAuth2Authentication class and pull out the application u...
3
saleor Error build-assets - new decorators proposal is not supported yet. You must pass the"legacy": true option
I solved this error changing the two lines below at package.json I don't know if this is the best so...
926
keras Loading model with custom loss function: ValueError: 'Unknown loss function'
I solved this problem by adding 'custom_bojects' my loss function: I trained and saved a model that ...
731
scrapy ' error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 '
@euler16 for scrapy with Python 3 you'll need with Python 2 you'll need I wanted to install scrapy i...
633
keras Tensorflow backend - bug in model._make_predict_function(...)
I had this problem when doing inference in a different thread than where I loaded my model ...
575
mysqlclient Can't install mysqlclient on MacOS
You can set ssl library path explicitly. Hi I'm on MacOSX Sierra ...
516
keras Creating Model variable throws "AttributeError: 'Tensor' object has no attribute '_keras_history'"
@zaid478 oh I assumed you were doing it on coursera Anyway Hello all setup: Keras 2.0 Tensorflow 1.0...
456
tensorflow ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory
@rhinsall I just found this out myself not sure if it's common knowledge but got around this by doin...
423
ipython Last jedi release (0.18.0) is incompatible with ipython (7.19 and 7.18 tested); reason - column arg was deprecated, and now removed
As a temporary fix for anyone just trying to get things working again: It would be really nice if yo...
416
pyodbc pip install pyodbc failing: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory #include <sql.h> ^ Your machine do...
395
keras "<tensor> is not an element of this graph." when loading model.
I had a problem similar to that of @piraka9011 which was solved by calling model._make_predict_funct...
392
psycopg2 psycopg2-binary fails to install on macOS Big Sur 11.0.1 and Python 3.9.0 (with possible workaround)
Actually figured it out Haven't worked on a Mac in a while and forgot about the PostgreSQL dependenc...
387
pytorch I can't import PyTorch, libomp.dylib can't be loaded.
brew install libomp solves the problem. 🐛 Bug I tried to install PyTorch but I can't use it ...
380
pytorch RuntimeError: cuda runtime error (59) : device-side assert triggered when running transfer_learning_tutorial
@soumith Hi I find the error it is due to my labels contain value -1 which is unacceptable in criter...
356
tensorflow At Runtime : "Error while reading resource variable softmax/kernel from Container: localhost"
I had the same issue in tensorflow 1.13.1 which I have resolved by creating a reference to the sessi...