<p dir="auto">When calling <code class="notranslate">self.replace()</code> with a signature reconstructed from a serialized dictionary (e.g. after having been passed through a backend), if that signature is (or contains) a group which itself contains a chord, celery explodes after attempting to treat deeply nested dictionaries as signature objects. See below for a minimal repro I got together today.</p>
<p dir="auto">My gut feel is that instantiating a signature from a dictionary may not be recursing down through the structure far enough and it leaves some of the encapsulated tasks as dicts. I've also noticed that groups containing a group also break in the same way, but I think that's because there's an internal promotion to a chord happening somewhere.</p>
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown &amp; rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="226172436" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/4015" data-hovercard-type="pull_request" data-hovercard-url="/celery/celery/pull/4015/hovercard" href="https://github.com/celery/celery/pull/4015">#4015</a></li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment &amp; Settings</h2>

<p dir="auto"><strong>Celery version</strong>:</p>

<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>

<ul dir="auto">
<li><strong>Minimal Python Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Celery Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>

<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="amqp==5.0.1
billiard==3.6.3.0
# Editable install with no version control (celery==5.0.0rc3)
-e /home/maybe/tmp/capp/venv/lib/python3.8/site-packages
click==7.1.2
click-didyoumean==0.0.3
click-repl==0.1.6
future==0.18.2
kombu==5.0.2
prompt-toolkit==3.0.7
pytz==2020.1
redis==3.5.3
six==1.15.0
vine==5.0.0
wcwidth==0.2.5"><pre class="notranslate"><code class="notranslate">amqp==5.0.1
billiard==3.6.3.0
# Editable install with no version control (celery==5.0.0rc3)
-e /home/maybe/tmp/capp/venv/lib/python3.8/site-packages
click==7.1.2
click-didyoumean==0.0.3
click-repl==0.1.6
future==0.18.2
kombu==5.0.2
prompt-toolkit==3.0.7
pytz==2020.1
redis==3.5.3
six==1.15.0
vine==5.0.0
wcwidth==0.2.5
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>

<details>
<p dir="auto">
N/A
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>

<details>
<p dir="auto">
</p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import celery

app = celery.Celery(&quot;app&quot;, backend=&quot;redis://&quot;)

@app.task
def foo(*_):
    return 42

@app.task(bind=True)
def replace_with(self, sig):
    assert isinstance(sig, dict)
    sig = celery.Signature.from_dict(sig)
    raise self.replace(sig)

if __name__ == &quot;__main__&quot;:
    sig = celery.group(
        celery.group(foo.s()),
    )
    res = sig.delay()
    print(res.get())

    sig.freeze()
    res = replace_with.delay(sig)
    print(res.get())"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">celery</span>

<span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-s1">celery</span>.<span class="pl-v">Celery</span>(<span class="pl-s">"app"</span>, <span class="pl-s1">backend</span><span class="pl-c1">=</span><span class="pl-s">"redis://"</span>)

<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-s1">task</span></span>
<span class="pl-k">def</span> <span class="pl-en">foo</span>(<span class="pl-c1">*</span><span class="pl-s1">_</span>):
    <span class="pl-k">return</span> <span class="pl-c1">42</span>

<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">task</span>(<span class="pl-s1">bind</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)</span>
<span class="pl-k">def</span> <span class="pl-en">replace_with</span>(<span class="pl-s1">self</span>, <span class="pl-s1">sig</span>):
    <span class="pl-k">assert</span> <span class="pl-en">isinstance</span>(<span class="pl-s1">sig</span>, <span class="pl-s1">dict</span>)
    <span class="pl-s1">sig</span> <span class="pl-c1">=</span> <span class="pl-s1">celery</span>.<span class="pl-v">Signature</span>.<span class="pl-en">from_dict</span>(<span class="pl-s1">sig</span>)
    <span class="pl-k">raise</span> <span class="pl-s1">self</span>.<span class="pl-en">replace</span>(<span class="pl-s1">sig</span>)

<span class="pl-k">if</span> <span class="pl-s1">__name__</span> <span class="pl-c1">==</span> <span class="pl-s">"__main__"</span>:
    <span class="pl-s1">sig</span> <span class="pl-c1">=</span> <span class="pl-s1">celery</span>.<span class="pl-en">group</span>(
        <span class="pl-s1">celery</span>.<span class="pl-en">group</span>(<span class="pl-s1">foo</span>.<span class="pl-en">s</span>()),
    )
    <span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-s1">sig</span>.<span class="pl-en">delay</span>()
    <span class="pl-en">print</span>(<span class="pl-s1">res</span>.<span class="pl-en">get</span>())

    <span class="pl-s1">sig</span>.<span class="pl-en">freeze</span>()
    <span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-s1">replace_with</span>.<span class="pl-en">delay</span>(<span class="pl-s1">sig</span>)
    <span class="pl-en">print</span>(<span class="pl-s1">res</span>.<span class="pl-en">get</span>())</pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">It shouldn't explode. Presumably tasks within the group/chord should be signatures rather than dicts.</p>
<h1 dir="auto">Actual Behavior</h1>

<p dir="auto">Stack trace in the worker output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2020-09-08 12:44:05,453: DEBUG/MainProcess] Task accepted: app.replace_with[dcea02fd-23a3-404a-9fdd-b213eb51c0d1] pid:453431
[2020-09-08 12:44:05,457: ERROR/ForkPoolWorker-8] Task app.replace_with[dcea02fd-23a3-404a-9fdd-b213eb51c0d1] raised unexpected: AttributeError(&quot;'dict' object has no attribute '_app'&quot;)
Traceback (most recent call last):
  File &quot;/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/kombu/utils/objects.py&quot;, line 41, in __get__
    return obj.__dict__[self.__name__]
KeyError: 'app'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/app/trace.py&quot;, line 409, in trace_task
    R = retval = fun(*args, **kwargs)
  File &quot;/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/app/trace.py&quot;, line 701, in __protected_call__
    return self.run(*args, **kwargs)
  File &quot;/home/maybe/tmp/capp/app.py&quot;, line 13, in replace_with
    raise self.replace(sig)
  File &quot;/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/app/task.py&quot;, line 894, in replace
    sig.freeze(self.request.id)
  File &quot;/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/canvas.py&quot;, line 1302, in freeze
    self.tasks = group(self.tasks, app=self.app)
  File &quot;/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/kombu/utils/objects.py&quot;, line 43, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File &quot;/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/canvas.py&quot;, line 1456, in app
    return self._get_app(self.body)
  File &quot;/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/canvas.py&quot;, line 1466, in _get_app
    app = tasks[0]._app
AttributeError: 'dict' object has no attribute '_app'"><pre class="notranslate"><code class="notranslate">[2020-09-08 12:44:05,453: DEBUG/MainProcess] Task accepted: app.replace_with[dcea02fd-23a3-404a-9fdd-b213eb51c0d1] pid:453431
[2020-09-08 12:44:05,457: ERROR/ForkPoolWorker-8] Task app.replace_with[dcea02fd-23a3-404a-9fdd-b213eb51c0d1] raised unexpected: AttributeError("'dict' object has no attribute '_app'")
Traceback (most recent call last):
  File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/kombu/utils/objects.py", line 41, in __get__
    return obj.__dict__[self.__name__]
KeyError: 'app'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/app/trace.py", line 409, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/app/trace.py", line 701, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/maybe/tmp/capp/app.py", line 13, in replace_with
    raise self.replace(sig)
  File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/app/task.py", line 894, in replace
    sig.freeze(self.request.id)
  File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/canvas.py", line 1302, in freeze
    self.tasks = group(self.tasks, app=self.app)
  File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/kombu/utils/objects.py", line 43, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/canvas.py", line 1456, in app
    return self._get_app(self.body)
  File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/canvas.py", line 1466, in _get_app
    app = tasks[0]._app
AttributeError: 'dict' object has no attribute '_app'
</code></pre></div>
<h1 dir="auto">Checklist</h1>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown &amp; rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>

<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment &amp; Settings</h2>

<p dir="auto">5.0.5 (singularity):</p>

<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="software -&gt; celery:5.0.5 (singularity) kombu:5.0.2 py:3.8.5
            billiard:3.6.4.0 py-amqp:5.0.6
platform -&gt; system:Linux arch:64bit, ELF
            kernel version:5.8.0-48-generic imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:pyamqp results:redis://localhost/

broker_url: 'amqp://guest:********@localhost:5672//'
result_backend: 'redis://localhost/'
deprecated_settings: None"><pre class="notranslate"><code class="notranslate">software -&gt; celery:5.0.5 (singularity) kombu:5.0.2 py:3.8.5
            billiard:3.6.4.0 py-amqp:5.0.6
platform -&gt; system:Linux arch:64bit, ELF
            kernel version:5.8.0-48-generic imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:pyamqp results:redis://localhost/

broker_url: 'amqp://guest:********@localhost:5672//'
result_backend: 'redis://localhost/'
deprecated_settings: None
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>

<ul dir="auto">
<li><strong>Minimal Python Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Celery Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>

<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="aiohttp==3.7.4.post0
aiohttp-cors==0.7.0
aioredis==1.3.1
amqp==5.0.6
anykeystore==0.2
apex==0.9.10.dev0
argh==0.26.2
argon2-cffi==20.1.0
astroid==2.4.2
async-generator==1.10
async-timeout==3.0.1
attrs==20.2.0
axial-positional-embedding==0.2.1
backcall==0.2.0
billiard==3.6.4.0
bleach==3.2.1
blessings==1.7
cachetools==4.2.1
celery==5.0.5
certifi==2020.6.20
cffi==1.14.3
chardet==3.0.4
click==7.1.2
click-default-group==1.2.2
click-didyoumean==0.0.3
click-plugins==1.1.1
click-repl==0.1.6
cloudpickle==1.6.0
colorama==0.4.4
colorful==0.5.4
contrastive-learner==0.1.0
cryptacular==1.5.5
cycler==0.10.0
dask==2021.4.0
db-to-sqlite==1.3
decorator==4.4.2
defusedxml==0.6.0
dlib==19.21.0
dnspython==1.16.0
entrypoints==0.3
eventlet==0.30.2
face-recognition==1.3.0
face-recognition-models==0.3.0
filelock==3.0.12
fire==0.3.1
Flask==1.1.2
Flask-Resize==2.0.4
fsspec==0.9.0
future==0.18.2
gevent==21.1.2
google-api-core==1.26.3
google-auth==1.29.0
google-images-download==2.8.0
googleapis-common-protos==1.53.0
gpustat==0.6.0
greenlet==1.0.0
grpcio==1.37.0
hiredis==2.0.0
hupper==1.10.2
idna==2.10
imageio==2.9.0
imutils==0.5.3
ipdb==0.13.4
ipykernel==5.3.4
ipython==7.18.1
ipython-genutils==0.2.0
ipywidgets==7.5.1
isort==5.6.4
itsdangerous==1.1.0
jedi==0.17.2
Jinja2==2.11.2
json5==0.9.5
jsonschema==3.2.0
jupyter-client==6.1.7
jupyter-core==4.6.3
jupyterlab==2.2.8
jupyterlab-pygments==0.1.2
jupyterlab-server==1.2.0
kiwisolver==1.2.0
kombu==5.0.2
kornia==0.4.1
lazy-object-proxy==1.4.3
linear-attention-transformer==0.14.1
linformer==0.2.0
local-attention==1.0.2
locket==0.2.1
lxml==4.6.2
MarkupSafe==1.1.1
matplotlib==3.3.2
mccabe==0.6.1
mistune==0.8.4
modin==0.9.1
msgpack==1.0.2
multidict==5.1.0
nbclient==0.5.0
nbconvert==6.0.7
nbformat==5.0.7
nest-asyncio==1.4.1
networkx==2.5
notebook==6.1.4
numpy==1.19.2
nvidia-ml-py3==7.352.0
oauthlib==3.1.0
opencensus==0.7.12
opencensus-context==0.1.2
opencv-python==4.4.0.46
packaging==20.4
pandas==1.1.3
pandocfilters==1.4.2
parso==0.7.1
partd==1.2.0
PasteDeploy==2.1.1
pbkdf2==1.3
pexpect==4.8.0
pickleshare==0.7.5
pika==1.2.0
pilkit==2.0
Pillow==7.2.0
plaster==1.0
plaster-pastedeploy==0.7
product-key-memory==0.1.10
prometheus-client==0.8.0
prompt-toolkit==3.0.8
protobuf==3.15.8
psutil==5.8.0
psycopg2==2.8.6
ptyprocess==0.6.0
py==1.9.0
py-spy==0.3.5
pyarrow==1.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
Pygments==2.7.1
pylint==2.6.0
pyparsing==2.4.7
pyramid==1.10.4
pyramid-mailer==0.15.1
pyrsistent==0.17.3
python-dateutil==2.8.1
python3-openid==3.2.0
pytorch-fid==0.1.1
pytz==2020.1
PyWavelets==1.1.1
pywikibot==5.6.0
PyYAML==5.4.1
pyzmq==19.0.2
ray==1.1.0
redis==3.5.3
repoze.sendmail==4.4.1
requests==2.24.0
requests-oauthlib==1.3.0
retry==0.9.2
rsa==4.7.2
scikit-image==0.18.1
scipy==1.5.3
selenium==3.141.0
Send2Trash==1.5.0
six==1.15.0
SQLAlchemy==1.3.20
sqlite-fts4==1.0.1
sqlite-utils==3.6
swifter==1.0.7
tabulate==0.8.9
termcolor==1.1.0
terminado==0.9.1
testpath==0.4.4
tifffile==2021.3.5
toml==0.10.1
toolz==0.11.1
torch==1.6.0
torchvision==0.7.0
tornado==6.0.4
tqdm==4.50.2
traitlets==5.0.4
transaction==3.0.0
translationstring==1.4
typing-extensions==3.7.4.3
urllib3==1.25.10
vector-quantize-pytorch==0.1.0
velruse==1.1.1
venusian==3.0.0
vine==5.0.0
wcwidth==0.2.5
webencodings==0.5.1
WebOb==1.8.6
Werkzeug==1.0.1
widgetsnbextension==3.5.1
wrapt==1.12.1
WTForms==2.3.3
wtforms-recaptcha==0.3.2
yarl==1.6.3
zope.deprecation==4.4.0
zope.event==4.5.0
zope.interface==5.1.2
zope.sqlalchemy==1.3
"><pre class="notranslate"><code class="notranslate">aiohttp==3.7.4.post0
aiohttp-cors==0.7.0
aioredis==1.3.1
amqp==5.0.6
anykeystore==0.2
apex==0.9.10.dev0
argh==0.26.2
argon2-cffi==20.1.0
astroid==2.4.2
async-generator==1.10
async-timeout==3.0.1
attrs==20.2.0
axial-positional-embedding==0.2.1
backcall==0.2.0
billiard==3.6.4.0
bleach==3.2.1
blessings==1.7
cachetools==4.2.1
celery==5.0.5
certifi==2020.6.20
cffi==1.14.3
chardet==3.0.4
click==7.1.2
click-default-group==1.2.2
click-didyoumean==0.0.3
click-plugins==1.1.1
click-repl==0.1.6
cloudpickle==1.6.0
colorama==0.4.4
colorful==0.5.4
contrastive-learner==0.1.0
cryptacular==1.5.5
cycler==0.10.0
dask==2021.4.0
db-to-sqlite==1.3
decorator==4.4.2
defusedxml==0.6.0
dlib==19.21.0
dnspython==1.16.0
entrypoints==0.3
eventlet==0.30.2
face-recognition==1.3.0
face-recognition-models==0.3.0
filelock==3.0.12
fire==0.3.1
Flask==1.1.2
Flask-Resize==2.0.4
fsspec==0.9.0
future==0.18.2
gevent==21.1.2
google-api-core==1.26.3
google-auth==1.29.0
google-images-download==2.8.0
googleapis-common-protos==1.53.0
gpustat==0.6.0
greenlet==1.0.0
grpcio==1.37.0
hiredis==2.0.0
hupper==1.10.2
idna==2.10
imageio==2.9.0
imutils==0.5.3
ipdb==0.13.4
ipykernel==5.3.4
ipython==7.18.1
ipython-genutils==0.2.0
ipywidgets==7.5.1
isort==5.6.4
itsdangerous==1.1.0
jedi==0.17.2
Jinja2==2.11.2
json5==0.9.5
jsonschema==3.2.0
jupyter-client==6.1.7
jupyter-core==4.6.3
jupyterlab==2.2.8
jupyterlab-pygments==0.1.2
jupyterlab-server==1.2.0
kiwisolver==1.2.0
kombu==5.0.2
kornia==0.4.1
lazy-object-proxy==1.4.3
linear-attention-transformer==0.14.1
linformer==0.2.0
local-attention==1.0.2
locket==0.2.1
lxml==4.6.2
MarkupSafe==1.1.1
matplotlib==3.3.2
mccabe==0.6.1
mistune==0.8.4
modin==0.9.1
msgpack==1.0.2
multidict==5.1.0
nbclient==0.5.0
nbconvert==6.0.7
nbformat==5.0.7
nest-asyncio==1.4.1
networkx==2.5
notebook==6.1.4
numpy==1.19.2
nvidia-ml-py3==7.352.0
oauthlib==3.1.0
opencensus==0.7.12
opencensus-context==0.1.2
opencv-python==4.4.0.46
packaging==20.4
pandas==1.1.3
pandocfilters==1.4.2
parso==0.7.1
partd==1.2.0
PasteDeploy==2.1.1
pbkdf2==1.3
pexpect==4.8.0
pickleshare==0.7.5
pika==1.2.0
pilkit==2.0
Pillow==7.2.0
plaster==1.0
plaster-pastedeploy==0.7
product-key-memory==0.1.10
prometheus-client==0.8.0
prompt-toolkit==3.0.8
protobuf==3.15.8
psutil==5.8.0
psycopg2==2.8.6
ptyprocess==0.6.0
py==1.9.0
py-spy==0.3.5
pyarrow==1.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
Pygments==2.7.1
pylint==2.6.0
pyparsing==2.4.7
pyramid==1.10.4
pyramid-mailer==0.15.1
pyrsistent==0.17.3
python-dateutil==2.8.1
python3-openid==3.2.0
pytorch-fid==0.1.1
pytz==2020.1
PyWavelets==1.1.1
pywikibot==5.6.0
PyYAML==5.4.1
pyzmq==19.0.2
ray==1.1.0
redis==3.5.3
repoze.sendmail==4.4.1
requests==2.24.0
requests-oauthlib==1.3.0
retry==0.9.2
rsa==4.7.2
scikit-image==0.18.1
scipy==1.5.3
selenium==3.141.0
Send2Trash==1.5.0
six==1.15.0
SQLAlchemy==1.3.20
sqlite-fts4==1.0.1
sqlite-utils==3.6
swifter==1.0.7
tabulate==0.8.9
termcolor==1.1.0
terminado==0.9.1
testpath==0.4.4
tifffile==2021.3.5
toml==0.10.1
toolz==0.11.1
torch==1.6.0
torchvision==0.7.0
tornado==6.0.4
tqdm==4.50.2
traitlets==5.0.4
transaction==3.0.0
translationstring==1.4
typing-extensions==3.7.4.3
urllib3==1.25.10
vector-quantize-pytorch==0.1.0
velruse==1.1.1
venusian==3.0.0
vine==5.0.0
wcwidth==0.2.5
webencodings==0.5.1
WebOb==1.8.6
Werkzeug==1.0.1
widgetsnbextension==3.5.1
wrapt==1.12.1
WTForms==2.3.3
wtforms-recaptcha==0.3.2
yarl==1.6.3
zope.deprecation==4.4.0
zope.event==4.5.0
zope.interface==5.1.2
zope.sqlalchemy==1.3

</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>

<details>
<p dir="auto">
N/A
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>

<details>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from celery import Celery
from celery.execute import send_task

#random_name = Celery('tasks', backend='redis://localhost', broker='pyamqp://')
r1 = send_task('tasks.add',(1,1))
print(r1.get())"><pre class="notranslate"><code class="notranslate">from celery import Celery
from celery.execute import send_task

#random_name = Celery('tasks', backend='redis://localhost', broker='pyamqp://')
r1 = send_task('tasks.add',(1,1))
print(r1.get())
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>

<p dir="auto">2 printed to the screen without uncommenting the line #random_name<br>
(it makes no sense for this line to have any effect on the program)</p>
<h1 dir="auto">Actual Behavior</h1>

<p dir="auto">"No result backend" Exception, unless the only commented out line is uncommented.</p>
<p dir="auto">Accompanying file:</p>
<p dir="auto">tasks.py</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from celery import Celery
app = Celery('tasks', backend='redis://localhost', broker='pyamqp://')


@app.task
def add(x, y):
    return x + y


``"><pre class="notranslate"><code class="notranslate">from celery import Celery
app = Celery('tasks', backend='redis://localhost', broker='pyamqp://')


@app.task
def add(x, y):
    return x + y


``
</code></pre></div>