<h2 dir="auto">Checklist</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.</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 in this issue.</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"> 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 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"> 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>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="320405238" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/4707" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/4707/hovercard" href="https://github.com/celery/celery/issues/4707">#4707</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="320525925" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/4709" data-hovercard-type="pull_request" data-hovercard-url="/celery/celery/pull/4709/hovercard" href="https://github.com/celery/celery/pull/4709">#4709</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="321429920" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/4721" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/4721/hovercard" href="https://github.com/celery/celery/issues/4721">#4721</a></li>
</ul>
<h2 dir="auto">Environment &amp; Settings</h2>
<p dir="auto"><strong>Celery version</strong>: 4.3.0rc1</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="$ celery -A bug report

software -&gt; celery:4.3.0rc1 (rhubarb) kombu:4.4.0 py:3.7.2
            billiard:3.6.0.0 redis:3.2.1
platform -&gt; system:Linux arch:64bit
            kernel version:4.9.125-linuxkit imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:redis results:redis://redis:6379/0

broker_url: 'redis://redis:6379/0'
result_backend: 'redis://redis:6379/0'"><pre class="notranslate"><code class="notranslate">$ celery -A bug report

software -&gt; celery:4.3.0rc1 (rhubarb) kombu:4.4.0 py:3.7.2
            billiard:3.6.0.0 redis:3.2.1
platform -&gt; system:Linux arch:64bit
            kernel version:4.9.125-linuxkit imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:redis results:redis://redis:6379/0

broker_url: 'redis://redis:6379/0'
result_backend: 'redis://redis:6379/0'
</code></pre></div>
<p dir="auto"></p>
</details>
<h2 dir="auto">Steps to Reproduce</h2>
<h3 dir="auto">Required Dependencies</h3>
<ul dir="auto">
<li><strong>Minimal Python Version</strong>: Python 3.5</li>
<li><strong>Minimal Broker Version</strong>: Redis 3.0</li>
<li><strong>Minimal Result Backend Version</strong>: Redis 3.0</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: Linux (Docker for Mac)</li>
<li><strong>Minimal Broker Client Version</strong>: redis-py 3.2.1</li>
<li><strong>Minimal Result Backend Client Version</strong>: redis-py 3.2.1</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==2.4.2               # via kombu
billiard==3.6.0.0         # via celery
celery[redis]==4.3.0rc1
kombu==4.4.0
pytz==2018.9              # via celery
redis==3.2.1              # via celery
vine==1.3.0               # via amqp"><pre class="notranslate"><code class="notranslate">amqp==2.4.2               # via kombu
billiard==3.6.0.0         # via celery
celery[redis]==4.3.0rc1
kombu==4.4.0
pytz==2018.9              # via celery
redis==3.2.1              # via celery
vine==1.3.0               # via amqp
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Minimally Reproducible Test Case</h3>
<details>
<p dir="auto">
</p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# bug/celery.py
from celery import Celery
from redis import StrictRedis

REDIS_URL = 'redis://redis:6379/0'

app = Celery(
    'bug',
    broker=REDIS_URL,
    backend=REDIS_URL,
)

redis = StrictRedis.from_url(REDIS_URL)


@app.task(ignore_result=True)
def ignore_me_A(key, value):
    redis.set(key, value)


@app.task
def ignore_me_B(key, value):
    redis.set(key, value)
    
# bug/main.py
from time import sleep, time
from .celery import ignore_me_A, ignore_me_B, redis

KEY_PATTERN = 'celery-task-meta-*'


def value_equals(key, expected):
    raw = redis.get(key)
    if raw:
        return raw.decode('utf-8') == expected
    return False


def test_task_result(task):
    assert len(list(redis.scan_iter(KEY_PATTERN))) == 0

    key = f'results/{task.name}'
    value = str(time())
    task.apply_async((key, value), ignore_result=True)

    while not value_equals(key, value):
        print(f'waiting for result of {key}')
        sleep(1.0)

    redis.delete(key)
    assert len(list(redis.scan_iter(KEY_PATTERN))) == 0
    print('result of `ignore_me_A` is not persisted')


def main():
    for key in redis.scan_iter(KEY_PATTERN):
        redis.delete(key)

    test_task_result(ignore_me_A)
    test_task_result(ignore_me_B)


if __name__ == &quot;__main__&quot;:
    main()"><pre class="notranslate"><span class="pl-c"># bug/celery.py</span>
<span class="pl-k">from</span> <span class="pl-s1">celery</span> <span class="pl-k">import</span> <span class="pl-v">Celery</span>
<span class="pl-k">from</span> <span class="pl-s1">redis</span> <span class="pl-k">import</span> <span class="pl-v">StrictRedis</span>

<span class="pl-v">REDIS_URL</span> <span class="pl-c1">=</span> <span class="pl-s">'redis://redis:6379/0'</span>

<span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-v">Celery</span>(
    <span class="pl-s">'bug'</span>,
    <span class="pl-s1">broker</span><span class="pl-c1">=</span><span class="pl-v">REDIS_URL</span>,
    <span class="pl-s1">backend</span><span class="pl-c1">=</span><span class="pl-v">REDIS_URL</span>,
)

<span class="pl-s1">redis</span> <span class="pl-c1">=</span> <span class="pl-v">StrictRedis</span>.<span class="pl-en">from_url</span>(<span class="pl-v">REDIS_URL</span>)


<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">task</span>(<span class="pl-s1">ignore_result</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)</span>
<span class="pl-k">def</span> <span class="pl-en">ignore_me_A</span>(<span class="pl-s1">key</span>, <span class="pl-s1">value</span>):
    <span class="pl-s1">redis</span>.<span class="pl-en">set</span>(<span class="pl-s1">key</span>, <span class="pl-s1">value</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">ignore_me_B</span>(<span class="pl-s1">key</span>, <span class="pl-s1">value</span>):
    <span class="pl-s1">redis</span>.<span class="pl-en">set</span>(<span class="pl-s1">key</span>, <span class="pl-s1">value</span>)
    
<span class="pl-c"># bug/main.py</span>
<span class="pl-k">from</span> <span class="pl-s1">time</span> <span class="pl-k">import</span> <span class="pl-s1">sleep</span>, <span class="pl-s1">time</span>
<span class="pl-k">from</span> .<span class="pl-s1">celery</span> <span class="pl-k">import</span> <span class="pl-s1">ignore_me_A</span>, <span class="pl-s1">ignore_me_B</span>, <span class="pl-s1">redis</span>

<span class="pl-v">KEY_PATTERN</span> <span class="pl-c1">=</span> <span class="pl-s">'celery-task-meta-*'</span>


<span class="pl-k">def</span> <span class="pl-en">value_equals</span>(<span class="pl-s1">key</span>, <span class="pl-s1">expected</span>):
    <span class="pl-s1">raw</span> <span class="pl-c1">=</span> <span class="pl-s1">redis</span>.<span class="pl-en">get</span>(<span class="pl-s1">key</span>)
    <span class="pl-k">if</span> <span class="pl-s1">raw</span>:
        <span class="pl-k">return</span> <span class="pl-s1">raw</span>.<span class="pl-en">decode</span>(<span class="pl-s">'utf-8'</span>) <span class="pl-c1">==</span> <span class="pl-s1">expected</span>
    <span class="pl-k">return</span> <span class="pl-c1">False</span>


<span class="pl-k">def</span> <span class="pl-en">test_task_result</span>(<span class="pl-s1">task</span>):
    <span class="pl-k">assert</span> <span class="pl-en">len</span>(<span class="pl-en">list</span>(<span class="pl-s1">redis</span>.<span class="pl-en">scan_iter</span>(<span class="pl-v">KEY_PATTERN</span>))) <span class="pl-c1">==</span> <span class="pl-c1">0</span>

    <span class="pl-s1">key</span> <span class="pl-c1">=</span> <span class="pl-s">f'results/<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">task</span>.<span class="pl-s1">name</span><span class="pl-kos">}</span></span>'</span>
    <span class="pl-s1">value</span> <span class="pl-c1">=</span> <span class="pl-en">str</span>(<span class="pl-en">time</span>())
    <span class="pl-s1">task</span>.<span class="pl-en">apply_async</span>((<span class="pl-s1">key</span>, <span class="pl-s1">value</span>), <span class="pl-s1">ignore_result</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)

    <span class="pl-k">while</span> <span class="pl-c1">not</span> <span class="pl-en">value_equals</span>(<span class="pl-s1">key</span>, <span class="pl-s1">value</span>):
        <span class="pl-en">print</span>(<span class="pl-s">f'waiting for result of <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">key</span><span class="pl-kos">}</span></span>'</span>)
        <span class="pl-en">sleep</span>(<span class="pl-c1">1.0</span>)

    <span class="pl-s1">redis</span>.<span class="pl-en">delete</span>(<span class="pl-s1">key</span>)
    <span class="pl-k">assert</span> <span class="pl-en">len</span>(<span class="pl-en">list</span>(<span class="pl-s1">redis</span>.<span class="pl-en">scan_iter</span>(<span class="pl-v">KEY_PATTERN</span>))) <span class="pl-c1">==</span> <span class="pl-c1">0</span>
    <span class="pl-en">print</span>(<span class="pl-s">'result of `ignore_me_A` is not persisted'</span>)


<span class="pl-k">def</span> <span class="pl-en">main</span>():
    <span class="pl-k">for</span> <span class="pl-s1">key</span> <span class="pl-c1">in</span> <span class="pl-s1">redis</span>.<span class="pl-en">scan_iter</span>(<span class="pl-v">KEY_PATTERN</span>):
        <span class="pl-s1">redis</span>.<span class="pl-en">delete</span>(<span class="pl-s1">key</span>)

    <span class="pl-en">test_task_result</span>(<span class="pl-s1">ignore_me_A</span>)
    <span class="pl-en">test_task_result</span>(<span class="pl-s1">ignore_me_B</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-en">main</span>()</pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Start Celery worker (<code class="notranslate">celery -A bug worker</code>) and execute <code class="notranslate">python3 -m bug.main</code> - <strong>there should be no "celery-task-meta-*" keys in Redis</strong>, and the output should be:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="waiting for result of results/bug.celery.ignore_me_A
...
result of `ignore_me_A` is not persisted
    
waiting for result of results/bug.celery.ignore_me_B
...
result of `ignore_me_B` is not persisted"><pre class="notranslate"><code class="notranslate">waiting for result of results/bug.celery.ignore_me_A
...
result of `ignore_me_A` is not persisted
    
waiting for result of results/bug.celery.ignore_me_B
...
result of `ignore_me_B` is not persisted
</code></pre></div>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto"><code class="notranslate">python3 -m bug.main</code> exits with error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="waiting for result of results/bug.celery.ignore_me_A
...
result of `ignore_me_A` is not persisted
    
waiting for result of results/bug.celery.ignore_me_B
...
Traceback (most recent call last):
  File &quot;/usr/lib/python3.7/runpy.py&quot;, line 193, in _run_module_as_main
    &quot;__main__&quot;, mod_spec)
  File &quot;/usr/lib/python3.7/runpy.py&quot;, line 85, in _run_code
    exec(code, run_globals)
  File &quot;/src/bug/main.py&quot;, line 39, in &lt;module&gt;
    main()
  File &quot;/src/bug/main.py&quot;, line 35, in main
    test_task_result(ignore_me_B)
  File &quot;/src/bug/main.py&quot;, line 26, in test_task_result
    assert len(list(redis.scan_iter(KEY_PATTERN))) == 0
AssertionError"><pre class="notranslate"><code class="notranslate">waiting for result of results/bug.celery.ignore_me_A
...
result of `ignore_me_A` is not persisted
    
waiting for result of results/bug.celery.ignore_me_B
...
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/src/bug/main.py", line 39, in &lt;module&gt;
    main()
  File "/src/bug/main.py", line 35, in main
    test_task_result(ignore_me_B)
  File "/src/bug/main.py", line 26, in test_task_result
    assert len(list(redis.scan_iter(KEY_PATTERN))) == 0
AssertionError
</code></pre></div>
<p dir="auto">And <code class="notranslate">redis-cli keys *</code> shows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1) &quot;_kombu.binding.celery&quot;
2) &quot;_kombu.binding.celeryev&quot;
3) &quot;celery-task-meta-8406a282-ea03-439c-bc49-91a56e201860&quot;
4) &quot;_kombu.binding.celery.pidbox&quot;"><pre class="notranslate"><code class="notranslate">1) "_kombu.binding.celery"
2) "_kombu.binding.celeryev"
3) "celery-task-meta-8406a282-ea03-439c-bc49-91a56e201860"
4) "_kombu.binding.celery.pidbox"
</code></pre></div>
<p dir="auto">I know there are a few other posts similar to this already, and I have copied their solutions.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Example = app.register_task(Example()) 
Example.apply_async()"><pre class="notranslate"><code class="notranslate">Example = app.register_task(Example()) 
Example.apply_async()
</code></pre></div>
<p dir="auto">But this format does not register tasks. I think there must be a simple problem with my app or celery settings. Class-based tasks are still supposed to work, right? When I run tasks.py in isolation and print tasks, I can see the class-based tasks as registered. By the time they get to the workers, they are no longer registered, but my decorator-based tasks are.</p>
<p dir="auto">Edit: Further work. When I run</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="celery -A caliper.celery.celery_app:app inspect registered"><pre class="notranslate"><code class="notranslate">celery -A caliper.celery.celery_app:app inspect registered
</code></pre></div>
<p dir="auto">I can actually see the QueuedOneTimeSurvey task in there, BUT the workers are - empty -. When I add a task to the queue, then all of the decorator-base tasks get added to the workers, but the lone class-based task doesn't get added.</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" 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"> 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"> 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"> 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" checked=""> 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.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>

<h4 dir="auto">Related Issues</h4>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="239492364" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/4112" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/4112/hovercard" href="https://github.com/celery/celery/issues/4112">#4112</a></p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="211035884" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/3874" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/3874/hovercard" href="https://github.com/celery/celery/issues/3874">#3874</a></p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="199384975" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/3744" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/3744/hovercard" href="https://github.com/celery/celery/issues/3744">#3744</a></p>
<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.0</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:4.4.0 (cliffs) kombu:4.6.8 py:3.7.6
            billiard:3.6.3.0 py-amqp:2.5.2
platform -&gt; system:Linux arch:64bit, ELF
            kernel version:4.4.0-1098-aws imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:amqp results:disabled

CELERYD_LOG_LEVEL: 'INFO'
CELERY_ACCEPT_CONTENT: ['pickle']
CELERY_BROKER_URL: 'amqp://staging:********@********'
CELERY_IMPORTS: ['caliper.celery.tasks',
 'caliper.celery.tasks_lambda']
CELERY_RESULT_SERIALIZER: 'pickle'
CELERY_SEND_TASK_ERROR_EMAILS: True
CELERY_TASK_DEFAULT_EXCHANGE: 'default'
CELERY_TASK_DEFAULT_EXCHANGE_TYPE: 'direct'
CELERY_TASK_DEFAULT_QUEUE: 'caliper.default'
CELERY_TASK_IGNORE_RESULT: True
CELERY_TASK_QUEUES: {
    'caliper.OneTimeSurvey': {'binding_key': '********'},
    'caliper.default': {'binding_key': '********'}}
CELERY_TASK_ROUTES:
    ('caliper.celery.routers.CaliperRouter',)
CELERY_TASK_SERIALIZER: 'pickle'
CELERY_WORKER_PREFETCH_MULTIPLIER: 4
binding: {
 'binding_key': '********'}
existing: {
 }
os: &lt;module 'os' from '/usr/lib/python3.7/os.py'&gt;
q: 'caliper.OneTimeSurvey'
settings: &lt;module 'siphon.settings' from '/deploy/siphon/siphon/settings.py'&gt;
settings_messagebroker: &lt;module 'siphon.settings_messagebroker' from '/deploy/siphon/siphon/settings_messagebroker.py'&gt;
task_protocol: 1"><pre class="notranslate"><code class="notranslate">software -&gt; celery:4.4.0 (cliffs) kombu:4.6.8 py:3.7.6
            billiard:3.6.3.0 py-amqp:2.5.2
platform -&gt; system:Linux arch:64bit, ELF
            kernel version:4.4.0-1098-aws imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:amqp results:disabled

CELERYD_LOG_LEVEL: 'INFO'
CELERY_ACCEPT_CONTENT: ['pickle']
CELERY_BROKER_URL: 'amqp://staging:********@********'
CELERY_IMPORTS: ['caliper.celery.tasks',
 'caliper.celery.tasks_lambda']
CELERY_RESULT_SERIALIZER: 'pickle'
CELERY_SEND_TASK_ERROR_EMAILS: True
CELERY_TASK_DEFAULT_EXCHANGE: 'default'
CELERY_TASK_DEFAULT_EXCHANGE_TYPE: 'direct'
CELERY_TASK_DEFAULT_QUEUE: 'caliper.default'
CELERY_TASK_IGNORE_RESULT: True
CELERY_TASK_QUEUES: {
    'caliper.OneTimeSurvey': {'binding_key': '********'},
    'caliper.default': {'binding_key': '********'}}
CELERY_TASK_ROUTES:
    ('caliper.celery.routers.CaliperRouter',)
CELERY_TASK_SERIALIZER: 'pickle'
CELERY_WORKER_PREFETCH_MULTIPLIER: 4
binding: {
 'binding_key': '********'}
existing: {
 }
os: &lt;module 'os' from '/usr/lib/python3.7/os.py'&gt;
q: 'caliper.OneTimeSurvey'
settings: &lt;module 'siphon.settings' from '/deploy/siphon/siphon/settings.py'&gt;
settings_messagebroker: &lt;module 'siphon.settings_messagebroker' from '/deploy/siphon/siphon/settings_messagebroker.py'&gt;
task_protocol: 1
</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>: 3.7</li>
<li><strong>Minimal Celery Version</strong>: 4.4.0</li>
<li><strong>Minimal Kombu Version</strong>: 4.6.8</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>: Ubuntu 16</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==2.5.2
anyjson==0.3.3
asgiref==3.2.3
backcall==0.1.0
bcrypt==3.1.7
beautifulsoup4==4.5.1
billiard==3.6.3.0
boto==2.38.0
boto3==1.4.0
botocore==1.4.93
celery==4.4.0
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
concurrencytest==0.1.2
cryptography==2.8
decorator==4.4.1
Django==3.0
django-localflavor==2.2
django-ses==0.8.13
django-timedeltafield==0.7.10
djorm-pgarray==1.2
docutils==0.16
dogslow==1.2
ExifRead==2.1.2
extras==1.0.0
facebook-sdk==3.1.0
fixtures==3.0.0
flickrapi==2.4.0
future==0.18.2
geographiclib==1.50
geojson==2.5.0
geopy==1.20.0
graypy==2.1.0
html2text==2019.9.26
httplib2==0.14.0
idna==2.8
importlib-metadata==1.5.0
ipython==7.10.2
ipython-genutils==0.2.0
iso8601==0.1.12
jedi==0.16.0
jmespath==0.9.4
kafka==1.3.5
kombu==4.6.8
linecache2==1.0.0
lxml==4.5.0
mock==3.0.5
nose==1.3.7
numpy==1.17.4
oauth==1.0.1
oauth2==1.9.0.post1
oauthlib==3.1.0
overpy==0.4
pandas==0.25.3
paramiko==2.7.1
parso==0.6.1
pbr==5.4.4
pexpect==4.8.0
pickleshare==0.7.5
Pillow==6.2.1
prompt-toolkit==3.0.3
psycopg2==2.7.5
ptyprocess==0.6.0
pycparser==2.19
Pygments==2.5.2
pykml==0.2.0
pylibmc==1.6.1
PyNaCl==1.3.0
python-dateutil==2.8.1
python-mimeparse==1.6.0
python-stdnum==1.13
python-subunit==1.3.0
pytz==2019.3
raven==6.10.0
requests==2.22.0
requests-oauthlib==1.3.0
requests-toolbelt==0.9.1
s3transfer==0.1.13
scipy==1.4.0
selenium==3.141.0
simplekml==1.3.1
six==1.14.0
SQLAlchemy==1.3.12
sqlalchemy-redshift==0.7.5
sqlparse==0.3.0
testtools==2.3.0
traceback2==1.4.0
traitlets==4.3.3
unittest2==1.1.0
urllib3==1.25.8
utm==0.5.0
vine==1.3.0
virtualenv==16.7.9
wcwidth==0.1.8
xlrd==1.2.0
xlwt==1.3.0
zipp==3.0.0"><pre class="notranslate"><code class="notranslate">amqp==2.5.2
anyjson==0.3.3
asgiref==3.2.3
backcall==0.1.0
bcrypt==3.1.7
beautifulsoup4==4.5.1
billiard==3.6.3.0
boto==2.38.0
boto3==1.4.0
botocore==1.4.93
celery==4.4.0
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
concurrencytest==0.1.2
cryptography==2.8
decorator==4.4.1
Django==3.0
django-localflavor==2.2
django-ses==0.8.13
django-timedeltafield==0.7.10
djorm-pgarray==1.2
docutils==0.16
dogslow==1.2
ExifRead==2.1.2
extras==1.0.0
facebook-sdk==3.1.0
fixtures==3.0.0
flickrapi==2.4.0
future==0.18.2
geographiclib==1.50
geojson==2.5.0
geopy==1.20.0
graypy==2.1.0
html2text==2019.9.26
httplib2==0.14.0
idna==2.8
importlib-metadata==1.5.0
ipython==7.10.2
ipython-genutils==0.2.0
iso8601==0.1.12
jedi==0.16.0
jmespath==0.9.4
kafka==1.3.5
kombu==4.6.8
linecache2==1.0.0
lxml==4.5.0
mock==3.0.5
nose==1.3.7
numpy==1.17.4
oauth==1.0.1
oauth2==1.9.0.post1
oauthlib==3.1.0
overpy==0.4
pandas==0.25.3
paramiko==2.7.1
parso==0.6.1
pbr==5.4.4
pexpect==4.8.0
pickleshare==0.7.5
Pillow==6.2.1
prompt-toolkit==3.0.3
psycopg2==2.7.5
ptyprocess==0.6.0
pycparser==2.19
Pygments==2.5.2
pykml==0.2.0
pylibmc==1.6.1
PyNaCl==1.3.0
python-dateutil==2.8.1
python-mimeparse==1.6.0
python-stdnum==1.13
python-subunit==1.3.0
pytz==2019.3
raven==6.10.0
requests==2.22.0
requests-oauthlib==1.3.0
requests-toolbelt==0.9.1
s3transfer==0.1.13
scipy==1.4.0
selenium==3.141.0
simplekml==1.3.1
six==1.14.0
SQLAlchemy==1.3.12
sqlalchemy-redshift==0.7.5
sqlparse==0.3.0
testtools==2.3.0
traceback2==1.4.0
traitlets==4.3.3
unittest2==1.1.0
urllib3==1.25.8
utm==0.5.0
vine==1.3.0
virtualenv==16.7.9
wcwidth==0.1.8
xlrd==1.2.0
xlwt==1.3.0
zipp==3.0.0
</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="CELERY_TASK_IGNORE_RESULT = True

CELERY_IMPORTS = ['cal.celery.tasks', 'cal.tasks_lambda']

CELERY_TASK_ROUTES = ('cal.celery.routers.Router', )

CELERY_TASK_QUEUES = {
    'caliper.OneTimeSurvey': ****,
}

for q in CELERY_TASK_QUEUES:
    existing = CELERY_TASK_QUEUES[q]
    binding = {'binding_key': q}
    CELERY_TASK_QUEUES[q] = dict(list(existing.items()) + list(binding.items()))

CELERY_TASK_DEFAULT_QUEUE = 'cal.default'
CELERY_TASK_DEFAULT_EXCHANGE = 'default'
CELERY_TASK_DEFAULT_EXCHANGE_TYPE = 'direct'

CELERY_SEND_TASK_ERROR_EMAILS = True  
CELERYD_LOG_LEVEL = &quot;INFO&quot;

CELERY_ACCEPT_CONTENT = ['pickle']
CELERY_TASK_SERIALIZER = 'pickle'
CELERY_RESULT_SERIALIZER = 'pickle'

CELERY_WORKER_PREFETCH_MULTIPLIER = 4"><pre class="notranslate"><code class="notranslate">CELERY_TASK_IGNORE_RESULT = True

CELERY_IMPORTS = ['cal.celery.tasks', 'cal.tasks_lambda']

CELERY_TASK_ROUTES = ('cal.celery.routers.Router', )

CELERY_TASK_QUEUES = {
    'caliper.OneTimeSurvey': ****,
}

for q in CELERY_TASK_QUEUES:
    existing = CELERY_TASK_QUEUES[q]
    binding = {'binding_key': q}
    CELERY_TASK_QUEUES[q] = dict(list(existing.items()) + list(binding.items()))

CELERY_TASK_DEFAULT_QUEUE = 'cal.default'
CELERY_TASK_DEFAULT_EXCHANGE = 'default'
CELERY_TASK_DEFAULT_EXCHANGE_TYPE = 'direct'

CELERY_SEND_TASK_ERROR_EMAILS = True  
CELERYD_LOG_LEVEL = "INFO"

CELERY_ACCEPT_CONTENT = ['pickle']
CELERY_TASK_SERIALIZER = 'pickle'
CELERY_RESULT_SERIALIZER = 'pickle'

CELERY_WORKER_PREFETCH_MULTIPLIER = 4
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import django
django.setup()

from siphon import settings_celery
import celery 
from celery import Celery

app = Celery(accept_content=['pickle'])
app.conf.task_protocol = 1
app.config_from_object(settings_celery, namespace='CELERY')

class QueuedOneTimeSurvey(celery.Task):
    name='QueuedOneTimeSurvey'

    def run(self):
        @transaction.atomic
        def run_inner():
            print(&quot;hello&quot;)
        return run_inner()
QueuedOneTimeSurvey = app.register_task(QueuedOneTimeSurvey())

QueuedOneTimeSurveyTask.apply_async()"><pre class="notranslate"><code class="notranslate">import django
django.setup()

from siphon import settings_celery
import celery 
from celery import Celery

app = Celery(accept_content=['pickle'])
app.conf.task_protocol = 1
app.config_from_object(settings_celery, namespace='CELERY')

class QueuedOneTimeSurvey(celery.Task):
    name='QueuedOneTimeSurvey'

    def run(self):
        @transaction.atomic
        def run_inner():
            print("hello")
        return run_inner()
QueuedOneTimeSurvey = app.register_task(QueuedOneTimeSurvey())

QueuedOneTimeSurveyTask.apply_async()
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>

<p dir="auto">I expect the task to register and execute.</p>
<h1 dir="auto">Actual Behavior</h1>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2020-03-06 16:23:29,425: ERROR/MainProcess] Received unregistered task of type 'QueuedOneTimeSurvey'.
The message has been ignored and discarded.

Did you remember to import the module containing this task?
Or maybe you're using relative imports?

Please see
http://docs.celeryq.org/en/latest/internals/protocol.html
for more information.

The full contents of the message body was:
b'\x80\x02}q\x00(X\x04\x00\x00\x00taskq\x01X\x13\x00\x00\x00QueuedOneTimeSurveyq\x02X\x02\x00\x00\x00idq\x03X$\x00\x00\x0040f69c1a-c201-4498-9e36-43abe605a2f2q\x04X\x04\x00\x00\x00argsq\x05)X\x06\x00\x00\x00kwargsq\x06}q\x07X\x05\x00\x00\x00groupq\x08NX\x07\x00\x00\x00retriesq\tK\x00X\x03\x00\x00\x00etaq\nNX\x07\x00\x00\x00expiresq\x0bNX\x03\x00\x00\x00utcq\x0c\x88X\t\x00\x00\x00callbacksq\rNX\x08\x00\x00\x00errbacksq\x0eNX\t\x00\x00\x00timelimitq\x0fNN\x86q\x10X\x07\x00\x00\x00tasksetq\x11NX\x05\x00\x00\x00chordq\x12Nu.' (273b)
Traceback (most recent call last):
  File &quot;/deploy/pythonenvs/env/lib/python3.7/site-packages/celery/worker/consumer/consumer.py&quot;, line 559, in on_task_received
    strategy = strategies[type_]
KeyError: 'QueuedOneTimeSurvey'"><pre class="notranslate"><code class="notranslate">[2020-03-06 16:23:29,425: ERROR/MainProcess] Received unregistered task of type 'QueuedOneTimeSurvey'.
The message has been ignored and discarded.

Did you remember to import the module containing this task?
Or maybe you're using relative imports?

Please see
http://docs.celeryq.org/en/latest/internals/protocol.html
for more information.

The full contents of the message body was:
b'\x80\x02}q\x00(X\x04\x00\x00\x00taskq\x01X\x13\x00\x00\x00QueuedOneTimeSurveyq\x02X\x02\x00\x00\x00idq\x03X$\x00\x00\x0040f69c1a-c201-4498-9e36-43abe605a2f2q\x04X\x04\x00\x00\x00argsq\x05)X\x06\x00\x00\x00kwargsq\x06}q\x07X\x05\x00\x00\x00groupq\x08NX\x07\x00\x00\x00retriesq\tK\x00X\x03\x00\x00\x00etaq\nNX\x07\x00\x00\x00expiresq\x0bNX\x03\x00\x00\x00utcq\x0c\x88X\t\x00\x00\x00callbacksq\rNX\x08\x00\x00\x00errbacksq\x0eNX\t\x00\x00\x00timelimitq\x0fNN\x86q\x10X\x07\x00\x00\x00tasksetq\x11NX\x05\x00\x00\x00chordq\x12Nu.' (273b)
Traceback (most recent call last):
  File "/deploy/pythonenvs/env/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 559, in on_task_received
    strategy = strategies[type_]
KeyError: 'QueuedOneTimeSurvey'
</code></pre></div>