<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" 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"> 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>
<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>:</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.2.0rc1 (dawn-chorus) kombu:5.2.0rc1 py:3.7.12
            billiard:3.6.4.0 py-amqp:5.0.6
platform -&gt; system:Linux arch:64bit, ELF
            kernel version:5.10.47-linuxkit imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:pyamqp results:disabled

broker_url: 'amqp://guest:********@broker:5672//'
deprecated_settings: None
"><pre class="notranslate"><code class="notranslate">
software -&gt; celery:5.2.0rc1 (dawn-chorus) kombu:5.2.0rc1 py:3.7.12
            billiard:3.6.4.0 py-amqp:5.0.6
platform -&gt; system:Linux arch:64bit, ELF
            kernel version:5.10.47-linuxkit imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:pyamqp results:disabled

broker_url: 'amqp://guest:********@broker:5672//'
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>: 3.7</li>
<li><strong>Minimal Celery Version</strong>: 5.1.2</li>
<li><strong>Minimal Kombu Version</strong>: N/A</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="amqp==5.0.6
billiard==3.6.4.0
cached-property==1.5.2
celery @ git+https://github.com/celery/celery@49452916f94d5ec60af246cea600855e6d976b48
click==8.0.1
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
importlib-metadata==4.8.1
kombu==5.2.0rc1
prompt-toolkit==3.0.20
pytz==2021.3
six==1.16.0
typing-extensions==3.10.0.2
vine==5.0.0
wcwidth==0.2.5
zipp==3.6.0"><pre class="notranslate"><code class="notranslate">amqp==5.0.6
billiard==3.6.4.0
cached-property==1.5.2
celery @ git+https://github.com/celery/celery@49452916f94d5ec60af246cea600855e6d976b48
click==8.0.1
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
importlib-metadata==4.8.1
kombu==5.2.0rc1
prompt-toolkit==3.0.20
pytz==2021.3
six==1.16.0
typing-extensions==3.10.0.2
vine==5.0.0
wcwidth==0.2.5
zipp==3.6.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="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from celery import Celery

app = Celery(&quot;tasks&quot;, broker=&quot;pyamqp://guest@broker//&quot;)


class BrokenException(Exception):
    &quot;&quot;&quot;
    This Exception can't be unpickled by default
    &quot;&quot;&quot;
    def __init__(self, msg, other_arg):
        super().__init__(msg)
        self.other_arg = other_arg

@app.task(bind=True)
def unsafe_exception(self):
    self.retry(exc=BrokenException(&quot;msg&quot;, &quot;other_arg&quot;))


def main():
    unsafe_exception.delay()

if __name__ == &quot;__main__&quot;:
    main()"><pre class="notranslate"><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-s1">app</span> <span class="pl-c1">=</span> <span class="pl-v">Celery</span>(<span class="pl-s">"tasks"</span>, <span class="pl-s1">broker</span><span class="pl-c1">=</span><span class="pl-s">"pyamqp://guest@broker//"</span>)


<span class="pl-k">class</span> <span class="pl-v">BrokenException</span>(<span class="pl-v">Exception</span>):
    <span class="pl-s">"""</span>
<span class="pl-s">    This Exception can't be unpickled by default</span>
<span class="pl-s">    """</span>
    <span class="pl-k">def</span> <span class="pl-en">__init__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">msg</span>, <span class="pl-s1">other_arg</span>):
        <span class="pl-en">super</span>().<span class="pl-en">__init__</span>(<span class="pl-s1">msg</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">other_arg</span> <span class="pl-c1">=</span> <span class="pl-s1">other_arg</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">unsafe_exception</span>(<span class="pl-s1">self</span>):
    <span class="pl-s1">self</span>.<span class="pl-en">retry</span>(<span class="pl-s1">exc</span><span class="pl-c1">=</span><span class="pl-v">BrokenException</span>(<span class="pl-s">"msg"</span>, <span class="pl-s">"other_arg"</span>))


<span class="pl-k">def</span> <span class="pl-en">main</span>():
    <span class="pl-s1">unsafe_exception</span>.<span class="pl-en">delay</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">Then run with <code class="notranslate">python tasks.py</code></p>
<p dir="auto">Repo here:<br>
<a href="https://github.com/amcgavin/celery-issue/">https://github.com/amcgavin/celery-issue/</a></p>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">Exception occurs in the worker handler, but handled gracefully.</p>
<p dir="auto"><em>note</em>: this was the behaviour in celery==5.0.2</p>
<h1 dir="auto">Actual Behavior</h1>
<p dir="auto">worker process crashes, with exit code 0.</p>
<p dir="auto">Note that raising the exception directly doesn't crash (see the repo for detailed example).</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="celery_1  | [2021-10-08 08:34:10,200: INFO/MainProcess] Task tasks.unsafe_exception[38b08c18-451b-4645-a4ac-ada2e6b43e5e] received
celery_1  | [2021-10-08 08:34:10,201: CRITICAL/MainProcess] Unrecoverable error: TypeError(&quot;__init__() missing 1 required positional argument: 'other_arg'&quot;)
celery_1  | Traceback (most recent call last):
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/worker/worker.py&quot;, line 203, in start
celery_1  |     self.blueprint.start(self)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/bootsteps.py&quot;, line 116, in start
celery_1  |     step.start(parent)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/bootsteps.py&quot;, line 365, in start
celery_1  |     return self.obj.start()
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py&quot;, line 326, in start
celery_1  |     blueprint.start(self)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/bootsteps.py&quot;, line 116, in start
celery_1  |     step.start(parent)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py&quot;, line 618, in start
celery_1  |     c.loop(*c.loop_args())
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/worker/loops.py&quot;, line 81, in asynloop
celery_1  |     next(loop)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/kombu/asynchronous/hub.py&quot;, line 361, in create_loop
celery_1  |     cb(*cbargs)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py&quot;, line 325, in on_result_readable
celery_1  |     next(it)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py&quot;, line 306, in _recv_message
celery_1  |     message = load(bufv)
celery_1  | TypeError: __init__() missing 1 required positional argument: 'other_arg'
celery_1  | [2021-10-08 08:34:41,378: ERROR/MainProcess] Task handler raised error: WorkerLostError('Worker exited prematurely: exitcode 0 Job: 2.')
celery_1  | Traceback (most recent call last):
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/worker/worker.py&quot;, line 203, in start
celery_1  |     self.blueprint.start(self)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/bootsteps.py&quot;, line 116, in start
celery_1  |     step.start(parent)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/bootsteps.py&quot;, line 365, in start
celery_1  |     return self.obj.start()
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py&quot;, line 326, in start
celery_1  |     blueprint.start(self)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/bootsteps.py&quot;, line 116, in start
celery_1  |     step.start(parent)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py&quot;, line 618, in start
celery_1  |     c.loop(*c.loop_args())
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/worker/loops.py&quot;, line 81, in asynloop
celery_1  |     next(loop)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/kombu/asynchronous/hub.py&quot;, line 361, in create_loop
celery_1  |     cb(*cbargs)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py&quot;, line 325, in on_result_readable
celery_1  |     next(it)
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py&quot;, line 306, in _recv_message
celery_1  |     message = load(bufv)
celery_1  | TypeError: __init__() missing 1 required positional argument: 'other_arg'
celery_1  | 
celery_1  | During handling of the above exception, another exception occurred:
celery_1  | 
celery_1  | Traceback (most recent call last):
celery_1  |   File &quot;/usr/local/lib/python3.7/site-packages/billiard/pool.py&quot;, line 1267, in mark_as_worker_lost
celery_1  |     human_status(exitcode), job._job),
celery_1  | billiard.exceptions.WorkerLostError: Worker exited prematurely: exitcode 0 Job: 2.
celery-example_celery_1 exited with code 0"><pre class="notranslate"><code class="notranslate">celery_1  | [2021-10-08 08:34:10,200: INFO/MainProcess] Task tasks.unsafe_exception[38b08c18-451b-4645-a4ac-ada2e6b43e5e] received
celery_1  | [2021-10-08 08:34:10,201: CRITICAL/MainProcess] Unrecoverable error: TypeError("__init__() missing 1 required positional argument: 'other_arg'")
celery_1  | Traceback (most recent call last):
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/worker/worker.py", line 203, in start
celery_1  |     self.blueprint.start(self)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 116, in start
celery_1  |     step.start(parent)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 365, in start
celery_1  |     return self.obj.start()
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 326, in start
celery_1  |     blueprint.start(self)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 116, in start
celery_1  |     step.start(parent)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 618, in start
celery_1  |     c.loop(*c.loop_args())
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/worker/loops.py", line 81, in asynloop
celery_1  |     next(loop)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/kombu/asynchronous/hub.py", line 361, in create_loop
celery_1  |     cb(*cbargs)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py", line 325, in on_result_readable
celery_1  |     next(it)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py", line 306, in _recv_message
celery_1  |     message = load(bufv)
celery_1  | TypeError: __init__() missing 1 required positional argument: 'other_arg'
celery_1  | [2021-10-08 08:34:41,378: ERROR/MainProcess] Task handler raised error: WorkerLostError('Worker exited prematurely: exitcode 0 Job: 2.')
celery_1  | Traceback (most recent call last):
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/worker/worker.py", line 203, in start
celery_1  |     self.blueprint.start(self)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 116, in start
celery_1  |     step.start(parent)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 365, in start
celery_1  |     return self.obj.start()
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 326, in start
celery_1  |     blueprint.start(self)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 116, in start
celery_1  |     step.start(parent)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 618, in start
celery_1  |     c.loop(*c.loop_args())
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/worker/loops.py", line 81, in asynloop
celery_1  |     next(loop)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/kombu/asynchronous/hub.py", line 361, in create_loop
celery_1  |     cb(*cbargs)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py", line 325, in on_result_readable
celery_1  |     next(it)
celery_1  |   File "/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py", line 306, in _recv_message
celery_1  |     message = load(bufv)
celery_1  | TypeError: __init__() missing 1 required positional argument: 'other_arg'
celery_1  | 
celery_1  | During handling of the above exception, another exception occurred:
celery_1  | 
celery_1  | Traceback (most recent call last):
celery_1  |   File "/usr/local/lib/python3.7/site-packages/billiard/pool.py", line 1267, in mark_as_worker_lost
celery_1  |     human_status(exitcode), job._job),
celery_1  | billiard.exceptions.WorkerLostError: Worker exited prematurely: exitcode 0 Job: 2.
celery-example_celery_1 exited with code 0
</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 checked the <a href="https://github.com/celery/celery/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+label%3A%22Issue+Type%3A+Feature+Request%22+">issues list</a><br>
for similar or identical feature requests.</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?utf8=%E2%9C%93&amp;q=is%3Apr+label%3A%22PR+Type%3A+Feature%22+">pull requests list</a><br>
for existing proposed implementations of this feature.</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 if the same feature was already implemented in the<br>
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>
<h1 dir="auto">Request</h1>
<p dir="auto">Hi there! I would love to have the celery logo as an SVG please. Can you share it in the repo please?</p>