Issue 1:
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:

software -> celery:5.1.0 (sun-harmonics) kombu:5.1.0 py:3.9.5
billiard:3.6.4.0 py-amqp:5.0.6
platform -> system:Linux arch:64bit, ELF
kernel version:5.10.35-1-lts imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:pyamqp results:couchdb://.....

broker_url: 'amqp://.....
result_backend: 'couchdb://.....
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:

amqp==5.0.6
billiard==3.6.4.0
celery==5.1.0
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
click-didyoumean==0.0.3
click-plugins==1.1.1
click-repl==0.1.6
idna==2.10
kombu==5.1.0
prompt-toolkit==3.0.18
pycouchdb==1.14.1
pygobject==3.26.1
python-apt==1.6.5+ubuntu0.5
pytz==2021.1
requests==2.25.1
six==1.16.0
unattended-upgrades==0.1
urllib3==1.26.4
vine==5.0.0
wcwidth==0.2.5

Other Dependencies

Couchdb v. 3.1.1

Minimally Reproducible Test Case

This is the code example from the getting started guide. RabbotMQ as a broker and couchdb as a backend.

from celery import Celery
app = Celery("tasks", broker="pyamqp://....", backend="couchdb://...")
@app.task
def add(x, y):
return x + y

Expected Behavior

The result is stored in the backend.

Actual Behavior

The following error message is displayed:

[2021-05-23 19:34:24,965: ERROR/MainProcess] Pool callback raised exception: TypeError("a bytes-like object is required, not 'str'")
Traceback (most recent call last):
File "/config/.local/lib/python3.9/site-packages/billiard/pool.py", line 1796, in safe_apply_callback
fun(*args, **kwargs)
File "/config/.local/lib/python3.9/site-packages/celery/worker/request.py", line 567, in on_failure
self.task.backend.mark_as_failure(
File "/config/.local/lib/python3.9/site-packages/celery/backends/base.py", line 171, in mark_as_failure
self.store_result(task_id, exc, state,
File "/config/.local/lib/python3.9/site-packages/celery/backends/base.py", line 477, in store_result
self._store_result(task_id, result, state, traceback,
File "/config/.local/lib/python3.9/site-packages/celery/backends/base.py", line 898, in _store_result
current_meta = self._get_task_meta_for(task_id)
File "/config/.local/lib/python3.9/site-packages/celery/backends/base.py", line 920, in _get_task_meta_for
meta = self.get(self.get_key_for_task(task_id))
File "/config/.local/lib/python3.9/site-packages/celery/backends/couchdb.py", line 79, in get
return self.connection.get(key)['value']
File "/config/.local/lib/python3.9/site-packages/pycouchdb/client.py", line 345, in get
(resp, result) = self.resource(*_id_to_path(doc_id)).get(params=params)
File "/config/.local/lib/python3.9/site-packages/pycouchdb/resource.py", line 52, in __call__
base_url = utils.urljoin(self.base_url, *path)
File "/config/.local/lib/python3.9/site-packages/pycouchdb/utils.py", line 86, in urljoin
return reduce(_join, path, base)
File "/config/.local/lib/python3.9/site-packages/pycouchdb/utils.py", line 55, in _join
parts = [head.rstrip(URLSPLITTER), tail.lstrip(URLSPLITTER)]
TypeError: a bytes-like object is required, not 'str'

It looks like this function

celery/celery/backends/couchdb.py

Line 77
in
025bad6

def get(self, key):

is getting a bytes-like object but a string is needed. I enclosed the key in str(). Then it worked.

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

#6189

Possible Duplicates

None

Environment & Settings

Celery version: 5.0.1 (singularity)

celery report Output:

software -> celery:5.0.1 (singularity) kombu:5.0.2 py:3.9.0
billiard:3.6.3.0 py-amqp:5.0.1
platform -> system:Linux arch:64bit, ELF
kernel version:5.8.0-26-generic 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: 4.x

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:

Other Dependencies

N/A

Minimally Reproducible Test Case

from celery import shared_task, chain

@shared_task
def foo(*args):
return 'foo'

@shared_task(bind=True)
def replace_with_empty_chain():
self.replace(chain())

chain(foo.s(), replace_with_empty_chain.s()).delay()

Expected Behavior

A clear error message is raised.

Actual Behavior

An IndexError is raised with a message that doesn't explain what went wrong.