Issue 1:
Checklist

I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussions forum first.

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

I have tried reproducing the issue on more than one message broker and/or

result backend.

I have tried reproducing the issue on more than one version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version:

celery report Output:

software -> celery:5.2.5 (dawn-chorus) kombu:5.2.4 py:3.10.2
billiard:3.6.4.0 py-amqp:5.1.0
platform -> system:Darwin arch:64bit
kernel version:21.4.0 imp:CPython
loader -> celery.loaders.default.Loader
settings -> transport:amqp results:disabled

deprecated_settings: None

Steps to Reproduce

Required Dependencies

Minimal Python Version: N/A or Unknown

Minimal Celery Version: N/A or Unknown

Minimal Kombu Version: N/A or Unknown

Minimal Broker Version: N/A or Unknown

Minimal Result Backend Version: N/A or Unknown

Minimal OS and/or Kernel Version: N/A or Unknown

Minimal Broker Client Version: N/A or Unknown

Minimal Result Backend Client Version: N/A or Unknown

Python Packages

pip freeze Output:

$ poetry export --without-hashes
amqp==5.1.0; python_version >= "3.7"
asgiref==3.5.0; python_version >= "3.7" and python_version < "4.0" and python_full_version >= "3.7.0"
async-timeout==4.0.2; python_version >= "3.7"
beautifulsoup4==4.10.0; python_full_version > "3.0.0"
billiard==3.6.4.0; python_version >= "3.7"
boto3==1.21.32; python_version >= "3.6"
botocore==1.24.32; python_version >= "3.6"
celery==5.2.5; python_version >= "3.7"
certifi==2021.10.8; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0"
charset-normalizer==2.0.12; python_full_version >= "3.6.0" and python_version >= "3"
click-didyoumean==0.3.0; python_full_version >= "3.6.2" and python_full_version < "4.0.0" and python_version >= "3.7"
click-plugins==1.1.1; python_version >= "3.7"
click-repl==0.2.0; python_version >= "3.7"
click==8.1.2; python_full_version >= "3.6.2" and python_full_version < "4.0.0" and python_version >= "3.7"
colorama==0.4.4; python_version >= "3.7" and python_full_version < "3.0.0" and platform_system == "Windows" or platform_system == "Windows" and python_version >= "3.7" and python_full_version >= "3.5.0"
css-class-names==0.0.1
cssutils==2.4.0; python_version >= "3.7"
deprecated==1.2.13; python_version >= "3.7" and python_full_version < "3.0.0" or python_version >= "3.7" and python_full_version >= "3.4.0"
dj-database-url==0.5.0
django-allianceutils==2.2.0; python_version >= "3.6"
django-celery-results==2.3.0
django-cors-headers==3.11.0; python_version >= "3.7"
django-csvpermissions==0.2.0; python_version >= "3.6" and python_version < "4.0"
django-extensions==3.1.5; python_version >= "3.6"
django-extra-fields==3.0.2; python_version >= "3.5"
django-filter==21.1; python_version >= "3.6"
django-hijack==3.2.0
django-inlinecss==0.3.0
django-pgconnection==1.0.2; python_full_version >= "3.7.0" and python_version < "4"
django-pghistory==1.4.0; python_full_version >= "3.7.0" and python_version < "4"
django-pgtrigger==2.4.1; python_full_version >= "3.7.0" and python_version < "4"
django-phonenumber-field==6.1.0; python_version >= "3.7"
django-safedelete==1.1.2
django-storages==1.12.3; python_version >= "3.5"
django-stronghold==0.4.0
django==3.2.12; python_version >= "3.6"
djangorestframework-api-key==2.2.0; python_version >= "3.6"
djangorestframework==3.13.1; python_version >= "3.6"
escapejson==1.0
freezegun==1.2.1; python_version >= "3.6"
future==0.18.2; python_version >= "2.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0"
gunicorn==20.1.0; python_version >= "3.5"
idna==3.3; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.5"
isort==5.10.1; python_full_version >= "3.6.1" and python_version < "4.0"
isoweek==1.3.3
jmespath==1.0.0; python_version >= "3.7"
kombu==5.2.4; python_version >= "3.7"
oauthlib==3.2.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
packaging==21.3; python_version >= "3.6"
phonenumbers==8.12.46; python_version >= "3.7"
pillow==9.1.0; python_version >= "3.7"
prompt-toolkit==3.0.28; python_full_version >= "3.6.2" and python_version >= "3.7"
psycopg2==2.9.3; python_version >= "3.6"
pynliner==0.8.0
pyparsing==3.0.7; python_version >= "3.7"
python-dateutil==2.8.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6"
python-dotenv==0.20.0; python_version >= "3.5"
pytz==2022.1
qrcode==7.3.1; python_version >= "3.6"
redis==4.2.1; python_version >= "3.7"
requests-oauthlib==1.3.1; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
requests==2.27.1; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.6.0")
rules==3.3
s3transfer==0.5.2; python_version >= "3.6"
sentry-sdk==1.5.8
six==1.16.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.7"
soupsieve==2.3.1; python_version >= "3.6" and python_full_version > "3.0.0"
sqlparse==0.4.2; python_version >= "3.7" and python_version < "4.0" and python_full_version >= "3.7.0"
urllib3==1.26.9; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "4" and python_version >= "3.6"
vine==5.0.0; python_version >= "3.7"
wcwidth==0.2.5; python_full_version >= "3.6.2" and python_version >= "3.7"
werkzeug==2.0.3; python_version >= "3.6"
wrapt==1.14.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_version >= "3.7" and python_full_version >= "3.5.0"

Other Dependencies

N/A

Minimally Reproducible Test Case

Expected Behavior

Hey folks,

I have a codebase that uses Celery 3.2.5 with Redis in combination with django-celery-results 2.3.0.

When I run some code with apply_async() I get the following exception:

Traceback (most recent call last):
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/celery/app/base.py", line 1250, in backend
return self._local.backend
AttributeError: '_thread._local' object has no attribute 'backend'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/path/to/project/django-root/./manage.py", line 20, in <module>
execute_from_command_line(sys.argv)
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/path/to/project/django-root/master_portal_app/management/commands/fetch_and_store_zoho_layout.py", line 15, in handle
fetch_and_save_dependency_mapping().delay(layout_id=layout.id)
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/celery/app/task.py", line 425, in delay
return self.apply_async(args, kwargs)
File "/path/to/project/django-root/master_portal_app/celery.py", line 71, in apply_async
return super().apply_async(*args, **kwargs)
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/celery/app/task.py", line 575, in apply_async
return app.send_task(
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/celery/app/base.py", line 787, in send_task
self.backend.on_task_call(P, task_id)
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/celery/app/base.py", line 1252, in backend
self._local.backend = new_backend = self._get_backend()
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/celery/app/base.py", line 955, in _get_backend
backend, url = backends.by_url(
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/celery/app/backends.py", line 69, in by_url
return by_name(backend, loader), url
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/celery/app/backends.py", line 47, in by_name
aliases.update(load_extension_class_names(extension_namespace))
File "/path/to/project/.direnv/python-3.10.2/lib/python3.10/site-packages/celery/utils/imports.py", line 146, in load_extension_class_names
yield ep.name, ':'.join([ep.module_name, ep.attrs[0]])
AttributeError: 'EntryPoint' object has no attribute 'module_name'

Looking at the importlib docs, there doesn't appear to be attributes module_name or attrs on EntryPoint: https://docs.python.org/3.8/library/importlib.metadata.html#entry-points (also confirmed with dir(ep)) ? The correct attribute seems to be module but unsure what the correct attribute would be for attrs as attr returned a string. 🤷

What is/would this generator have been referring to? 🤔

Actual Behavior

Issue 2:
Checklist

I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussion group first.

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

I have tried reproducing the issue on more than one message broker and/or

result backend.

I have tried reproducing the issue on more than one version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version:

celery report Output:

Steps to Reproduce

Required Dependencies

Minimal Python Version: python 3.5

Minimal Celery Version: celery 4.3

Minimal Kombu Version: N/A or Unknown

Minimal Broker Version: redis 6.0.5

Minimal Result Backend Version: redis 6.0.5

Minimal OS and/or Kernel Version: osx 10.15.5, ubuntu 20.04

Minimal Broker Client Version: redis==3.5.3

Minimal Result Backend Client Version: redis==3.5.3

Python Packages

pip freeze Output:

Other Dependencies

N/A

Minimally Reproducible Test Case

Expected Behavior

Results should be stored when CELERY_RESULT_BACKEND config setting is specified.

Actual Behavior

CELERY_RESULT_BACKEND is ignored. result_backend works as expected.