<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. (No option to post for me)</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). - Celery 4.4.0 (cliffs)</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"> 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" checked=""> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies. Works in Celery 4.1</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"><strong>Celery version 4.4.0 (cliffs)</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>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sig = signature('any_taskname', queue='any_q')
chain( [ chain( sig ) ] ).apply_async()"><pre class="notranslate"><code class="notranslate">sig = signature('any_taskname', queue='any_q')
chain( [ chain( sig ) ] ).apply_async()
</code></pre></div>
<h2 dir="auto">Required Dependencies</h2>

<ul dir="auto">
<li><strong>Minimal Python Version</strong>: 2.7</li>
<li><strong>Minimal Celery Version</strong>: 4.4</li>
<li><strong>Minimal Kombu Version</strong>: 4.6.7</li>
<li><strong>Minimal Broker Version</strong>: N/A</li>
<li><strong>Minimal Result Backend Version</strong>: N/A</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: N/A</li>
<li><strong>Minimal Broker Client Version</strong>: N/A</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A</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=""><pre class="notranslate"><code class="notranslate"></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="sig = signature('any_taskname', queue='any_q')
chain( [ chain( sig ) ] ).apply_async()"><pre class="notranslate"><code class="notranslate">sig = signature('any_taskname', queue='any_q')
chain( [ chain( sig ) ] ).apply_async()
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">It should publish task 'any_taskname' to queue 'any_q'</p>
<h1 dir="auto">Actual Behavior</h1>
<p dir="auto">Max recursion depth exceeded</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;test.py&quot;, line 30, in &lt;module&gt;
    chain([chain(s2)]).apply_async() # issue
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 642, in apply_async
    dict(self.options, **options) if options else self.options))
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 660, in run
    task_id, group_id, chord,
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 721, in prepare_steps
    task = task.clone(args, kwargs)
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 620, in clone
    for sig in signature.kwargs['tasks']
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 1513, in maybe_signature
    d = d.clone()
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 620, in clone
    for sig in signature.kwargs['tasks']
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 1513, in maybe_signature
    d = d.clone()
...
..
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 620, in clone
    for sig in signature.kwargs['tasks']
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 1513, in maybe_signature
    d = d.clone()
keeps repeating
..
..
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 617, in clone
    signature = Signature.clone(self, *args, **kwargs)
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 272, in clone
    app=self._app)
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 153, in from_dict
    return target_cls.from_dict(d, app=app)
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 599, in from_dict
    return _upgrade(d, _chain(tasks, app=app, **d['options']))
  File &quot;/bb/bin/dl/celery/4.4/celery/canvas.py&quot;, line 602, in __init__
    tasks = (regen(tasks[0]) if len(tasks) == 1 and is_list(tasks[0])
  File &quot;/bb/bin/dl/celery/4.4/kombu/utils/functional.py&quot;, line 256, in is_list
    return isinstance(l, iters) and not isinstance(l, scalars or ())
  File &quot;/opt/bb/lib/python2.7/abc.py&quot;, line 132, in __instancecheck__
    if subclass is not None and subclass in cls._abc_cache:
  File &quot;/opt/bb/lib/python2.7/_weakrefset.py&quot;, line 72, in __contains__
    wr = ref(item)
RuntimeError: maximum recursion depth exceeded"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "test.py", line 30, in &lt;module&gt;
    chain([chain(s2)]).apply_async() # issue
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 642, in apply_async
    dict(self.options, **options) if options else self.options))
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 660, in run
    task_id, group_id, chord,
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 721, in prepare_steps
    task = task.clone(args, kwargs)
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 620, in clone
    for sig in signature.kwargs['tasks']
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 1513, in maybe_signature
    d = d.clone()
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 620, in clone
    for sig in signature.kwargs['tasks']
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 1513, in maybe_signature
    d = d.clone()
...
..
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 620, in clone
    for sig in signature.kwargs['tasks']
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 1513, in maybe_signature
    d = d.clone()
keeps repeating
..
..
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 617, in clone
    signature = Signature.clone(self, *args, **kwargs)
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 272, in clone
    app=self._app)
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 153, in from_dict
    return target_cls.from_dict(d, app=app)
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 599, in from_dict
    return _upgrade(d, _chain(tasks, app=app, **d['options']))
  File "/bb/bin/dl/celery/4.4/celery/canvas.py", line 602, in __init__
    tasks = (regen(tasks[0]) if len(tasks) == 1 and is_list(tasks[0])
  File "/bb/bin/dl/celery/4.4/kombu/utils/functional.py", line 256, in is_list
    return isinstance(l, iters) and not isinstance(l, scalars or ())
  File "/opt/bb/lib/python2.7/abc.py", line 132, in __instancecheck__
    if subclass is not None and subclass in cls._abc_cache:
  File "/opt/bb/lib/python2.7/_weakrefset.py", line 72, in __contains__
    wr = ref(item)
RuntimeError: maximum recursion depth exceeded
</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"> 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" 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"> 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>Introduced by <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/celery/celery/commit/0463bff0530b8aef8d31bd8039f245735295db59/hovercard" href="https://github.com/celery/celery/commit/0463bff0530b8aef8d31bd8039f245735295db59"><tt>0463bff</tt></a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="625829967" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/6122" data-hovercard-type="pull_request" data-hovercard-url="/celery/celery/pull/6122/hovercard" href="https://github.com/celery/celery/pull/6122">#6122</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>: 4.4.4</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>
<ol dir="auto">
<li>Upgrade from Celery 4.4.3 to 4.4.4</li>
<li>Get <code class="notranslate">ModuleNotFoundError: No module named 'future'</code> eror</li>
</ol>
<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=""><pre class="notranslate"><code class="notranslate"></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=""><pre class="notranslate"></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">It would work after upgrade. In case new dependencies were introduced, these should be installed.</p>

<h1 dir="auto">Actual Behavior</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" weblate_1   |   File &quot;/usr/local/lib/python3.7/dist-packages/celery/backends/redis.py&quot;, line 25, in &lt;module&gt;
weblate_1   |     from .base import BaseKeyValueStoreBackend
weblate_1   |   File &quot;/usr/local/lib/python3.7/dist-packages/celery/backends/base.py&quot;, line 10, in &lt;module&gt;
weblate_1   |     from future.utils import raise_with_traceback
weblate_1   | ModuleNotFoundError: No module named 'future'"><pre class="notranslate"><code class="notranslate"> weblate_1   |   File "/usr/local/lib/python3.7/dist-packages/celery/backends/redis.py", line 25, in &lt;module&gt;
weblate_1   |     from .base import BaseKeyValueStoreBackend
weblate_1   |   File "/usr/local/lib/python3.7/dist-packages/celery/backends/base.py", line 10, in &lt;module&gt;
weblate_1   |     from future.utils import raise_with_traceback
weblate_1   | ModuleNotFoundError: No module named 'future'
</code></pre></div>
<p dir="auto">See <a href="https://github.com/WeblateOrg/docker/runs/733499300">https://github.com/WeblateOrg/docker/runs/733499300</a></p>