<h1 dir="auto">Checklist</h1>

<ul class="contains-task-list">
<li>[ x] I have checked the <a href="https://github.com/celery/celery/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+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%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li>[ x] 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>[x ] I have included all related issues and possible duplicate issues in this issue<br>
(If there are none, check this box anyway).</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>
<h1 dir="auto">Description</h1>

<p dir="auto">Following the First Steps tutorial all goes well<br>
Until I execute the command</p>
<p dir="auto">$ celery -A tasks worker --loglevel=info<br>
I get the following traceback I go to the trouble shooting section and no mention of how to deal with this error is mentioned. Could the documentation please be updated to include such information,  Note that a cursory attempt at debugging revealed that executing the command<br>
$ celery resulted in the same traceback error.</p>
<p dir="auto">Traceback (most recent call last):<br>
File "/home/chuck/.local/bin/celery", line 8, in <br>
sys.exit(main())<br>
File "/home/chuck/.local/lib/python2.7/site-packages/celery/<strong>main</strong>.py", line 15, in main<br>
from celery.bin.celery import main as _main<br>
File "/home/chuck/.local/lib/python2.7/site-packages/celery/bin/<strong>init</strong>.py", line 2, in <br>
from .base import Option<br>
File "/home/chuck/.local/lib/python2.7/site-packages/celery/bin/base.py", line 16, in <br>
from celery import VERSION_BANNER, Celery, maybe_patch_concurrency, signals<br>
File "/home/chuck/.local/lib/python2.7/site-packages/celery/signals.py", line 16, in <br>
from .utils.dispatch import Signal<br>
File "/home/chuck/.local/lib/python2.7/site-packages/celery/utils/<strong>init</strong>.py", line 8, in <br>
from .functional import memoize  # noqa<br>
File "/home/chuck/.local/lib/python2.7/site-packages/celery/utils/functional.py", line 10, in <br>
from kombu.utils.functional import (LRUCache, dictfilter, is_list, lazy,<br>
File "/home/chuck/.local/lib/python2.7/site-packages/kombu/utils/<strong>init</strong>.py", line 5, in <br>
from .compat import fileno, maybe_fileno, nested, register_after_fork<br>
File "/home/chuck/.local/lib/python2.7/site-packages/kombu/utils/compat.py", line 10, in <br>
import importlib_metadata<br>
File "/home/chuck/.local/lib/python2.7/site-packages/importlib_metadata/<strong>init</strong>.py", line 9, in <br>
import zipp<br>
File "/home/chuck/.local/lib/python2.7/site-packages/zipp.py", line 12, in <br>
import more_itertools<br>
File "/home/chuck/.local/lib/python2.7/site-packages/more_itertools/<strong>init</strong>.py", line 1, in <br>
from more_itertools.more import *  # noqa<br>
File "/home/chuck/.local/lib/python2.7/site-packages/more_itertools/more.py", line 340<br>
def _collate(*iterables, key=lambda a: a, reverse=False):<br>
^<br>
SyntaxError: invalid syntax<br>
)</p>
<h1 dir="auto">Suggestions</h1>

<p dir="auto">Please include the appropriate troubleshooting guidelines.</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 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 included all related issues and possible duplicate issues in this issue.</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" 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 tried reproducing the issue on more than one message broker and/or 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 workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue with retries, ETA/Countdown &amp; rate limits disabled.</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</strong>: 4.2.1 (windowlicker)</p>

<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="software -&gt; celery:4.2.1 (windowlicker) kombu:4.2.1 py:3.6.4
            billiard:3.5.0.4 redis:2.10.6
platform -&gt; system:Darwin arch:64bit imp:CPython
settings -&gt; transport:redis results:redis://localhost/

BROKER_URL: 'redis://localhost:6379//'
CELERY_RESULT_BACKEND: 'redis://localhost/'
BROKER_TRANSPORT_OPTIONS: {
 'visibility_timeout': 11700}"><pre class="notranslate"><code class="notranslate">software -&gt; celery:4.2.1 (windowlicker) kombu:4.2.1 py:3.6.4
            billiard:3.5.0.4 redis:2.10.6
platform -&gt; system:Darwin arch:64bit imp:CPython
settings -&gt; transport:redis results:redis://localhost/

BROKER_URL: 'redis://localhost:6379//'
CELERY_RESULT_BACKEND: 'redis://localhost/'
BROKER_TRANSPORT_OPTIONS: {
 'visibility_timeout': 11700}
</code></pre></div>
<p dir="auto">Tried this with RabitMQ also. Same issue exists.</p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<p dir="auto">If I create a celery canvas with a <code class="notranslate">task - grouptask - task - task - grouptask - task</code>, it fails.<br>
If I change it to <code class="notranslate">task - grouptask - task - grouptask - task</code>, it works</p>
<h2 dir="auto">Minimally Reproducible Test Case</h2>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    @celery_app.task
    def print_task(val):
        print(&quot;Running print_task. val is: {}&quot;.format(val))

    final_task = celery.chain(
        print_task.si(val=&quot;Starter task&quot;),
        celery.group([
            print_task.si(val='group1, task1'),
            print_task.si(val='group1, task2'),
        ]),
        print_task.si(val=&quot;group1, after-task&quot;),
        print_task.si(val=&quot;group1, after-task2&quot;),  # &lt;---- commenting this makes it work
        celery.group([
            print_task.si(val='group2, task1'),
            print_task.si(val='group2, task2'),
        ]),
        print_task.si(val=&quot;FINAL task&quot;),
    )
    r = final_task()
    print(r.get())"><pre class="notranslate">    <span class="pl-en">@<span class="pl-s1">celery_app</span>.<span class="pl-s1">task</span></span>
    <span class="pl-k">def</span> <span class="pl-en">print_task</span>(<span class="pl-s1">val</span>):
        <span class="pl-en">print</span>(<span class="pl-s">"Running print_task. val is: {}"</span>.<span class="pl-en">format</span>(<span class="pl-s1">val</span>))

    <span class="pl-s1">final_task</span> <span class="pl-c1">=</span> <span class="pl-s1">celery</span>.<span class="pl-en">chain</span>(
        <span class="pl-s1">print_task</span>.<span class="pl-en">si</span>(<span class="pl-s1">val</span><span class="pl-c1">=</span><span class="pl-s">"Starter task"</span>),
        <span class="pl-s1">celery</span>.<span class="pl-en">group</span>([
            <span class="pl-s1">print_task</span>.<span class="pl-en">si</span>(<span class="pl-s1">val</span><span class="pl-c1">=</span><span class="pl-s">'group1, task1'</span>),
            <span class="pl-s1">print_task</span>.<span class="pl-en">si</span>(<span class="pl-s1">val</span><span class="pl-c1">=</span><span class="pl-s">'group1, task2'</span>),
        ]),
        <span class="pl-s1">print_task</span>.<span class="pl-en">si</span>(<span class="pl-s1">val</span><span class="pl-c1">=</span><span class="pl-s">"group1, after-task"</span>),
        <span class="pl-s1">print_task</span>.<span class="pl-en">si</span>(<span class="pl-s1">val</span><span class="pl-c1">=</span><span class="pl-s">"group1, after-task2"</span>),  <span class="pl-c"># &lt;---- commenting this makes it work</span>
        <span class="pl-s1">celery</span>.<span class="pl-en">group</span>([
            <span class="pl-s1">print_task</span>.<span class="pl-en">si</span>(<span class="pl-s1">val</span><span class="pl-c1">=</span><span class="pl-s">'group2, task1'</span>),
            <span class="pl-s1">print_task</span>.<span class="pl-en">si</span>(<span class="pl-s1">val</span><span class="pl-c1">=</span><span class="pl-s">'group2, task2'</span>),
        ]),
        <span class="pl-s1">print_task</span>.<span class="pl-en">si</span>(<span class="pl-s1">val</span><span class="pl-c1">=</span><span class="pl-s">"FINAL task"</span>),
    )
    <span class="pl-s1">r</span> <span class="pl-c1">=</span> <span class="pl-en">final_task</span>()
    <span class="pl-en">print</span>(<span class="pl-s1">r</span>.<span class="pl-en">get</span>())</pre></div>
<p dir="auto">Also, when we do a <code class="notranslate">print(final_task)</code>, it shows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="print_task(val='Starter task')
| %(print_task([
		print_task(val='group1, task1'),
		print_task(val='group1, task2')
	], val='group1, after-task')
	| print_task(val='group1, after-task2')
) | %print_task([
		print_task(val='group2, task1'),
		print_task(val='group2, task2')
	], val='FINAL task')"><pre class="notranslate"><code class="notranslate">print_task(val='Starter task')
| %(print_task([
		print_task(val='group1, task1'),
		print_task(val='group1, task2')
	], val='group1, after-task')
	| print_task(val='group1, after-task2')
) | %print_task([
		print_task(val='group2, task1'),
		print_task(val='group2, task2')
	], val='FINAL task')
</code></pre></div>
<h2 dir="auto">Required Dependencies</h2>

<ul dir="auto">
<li><strong>Minimal Python Version</strong>: Python 3.6.4 :: Anaconda, Inc.</li>
<li><strong>Minimal Broker Version</strong>: Redis 4.0.9</li>
<li><strong>Minimal Result Backend Version</strong>: Redis 4.0.9</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: Mac OSX 10.13, Linux CentOS7</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>
<p dir="auto">I've also tried with latest git master versions of celery, kombu, amqp, redis-py, vine.</p>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">The output should have executed the entire canvas:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Running print_task. val is: Starter task
Running print_task. val is: group1, task1
Running print_task. val is: group1, task2
Running print_task. val is: group1, after-task
Running print_task. val is: group1, after-task2
Running print_task. val is: group2, task1
Running print_task. val is: group2, task2
Running print_task. val is: FINAL task"><pre class="notranslate"><code class="notranslate">Running print_task. val is: Starter task
Running print_task. val is: group1, task1
Running print_task. val is: group1, task2
Running print_task. val is: group1, after-task
Running print_task. val is: group1, after-task2
Running print_task. val is: group2, task1
Running print_task. val is: group2, task2
Running print_task. val is: FINAL task
</code></pre></div>
<h1 dir="auto">Actual Behavior</h1>
<p dir="auto">The tasks until <code class="notranslate">group1, after-task2</code> work fine. The <code class="notranslate">group1, after-task2</code> also completes execution according to celery logs.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Running print_task. val is: Starter task
Running print_task. val is: group1, task1
Running print_task. val is: group1, task2
Running print_task. val is: group1, after-task
Running print_task. val is: group1, after-task2
[2019-02-22 16:30:18,041: INFO/MainProcess] Task print_task[beaea403-5f2e-4b84-8f64-bcada7c07000] succeeded in 0.004693654947914183s: None"><pre class="notranslate"><code class="notranslate">Running print_task. val is: Starter task
Running print_task. val is: group1, task1
Running print_task. val is: group1, task2
Running print_task. val is: group1, after-task
Running print_task. val is: group1, after-task2
[2019-02-22 16:30:18,041: INFO/MainProcess] Task print_task[beaea403-5f2e-4b84-8f64-bcada7c07000] succeeded in 0.004693654947914183s: None
</code></pre></div>
<p dir="auto">The redis-cli shows that is completed too:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="127.0.0.1:6379&gt; get celery-task-meta-beaea403-5f2e-4b84-8f64-bcada7c07000
&quot;{\&quot;status\&quot;: \&quot;SUCCESS\&quot;, \&quot;result\&quot;: null, \&quot;traceback\&quot;: null, \&quot;children\&quot;: [], \&quot;task_id\&quot;: \&quot;beaea403-5f2e-4b84-8f64-bcada7c07000\&quot;}&quot;"><pre class="notranslate"><code class="notranslate">127.0.0.1:6379&gt; get celery-task-meta-beaea403-5f2e-4b84-8f64-bcada7c07000
"{\"status\": \"SUCCESS\", \"result\": null, \"traceback\": null, \"children\": [], \"task_id\": \"beaea403-5f2e-4b84-8f64-bcada7c07000\"}"
</code></pre></div>
<p dir="auto">But for some reason, the <code class="notranslate">children</code> is empty - even though there are children.</p>