<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"> 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"> 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"> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>

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

<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>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=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>

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

<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><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="
        &quot;Celery task conf&quot;
        def a_method(param1, param2, **kwargs):
            '''
            First time get executed, second time dosn't
            :return: 
            '''
            print(param1)
            print(param2)
            self.retry(kwargs=kwargs, countdown=15)
            
        my_dict_params = {&quot;param1&quot;: &quot;1&quot;,
                          &quot;param2&quot;: &quot;2&quot;}

        app.a_method(my_dict_params).delay()"><pre class="notranslate">        <span class="pl-s">"Celery task conf"</span>
        <span class="pl-k">def</span> <span class="pl-en">a_method</span>(<span class="pl-s1">param1</span>, <span class="pl-s1">param2</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>):
            <span class="pl-s">'''</span>
<span class="pl-s">            First time get executed, second time dosn't</span>
<span class="pl-s">            :return: </span>
<span class="pl-s">            '''</span>
            <span class="pl-en">print</span>(<span class="pl-s1">param1</span>)
            <span class="pl-en">print</span>(<span class="pl-s1">param2</span>)
            <span class="pl-s1">self</span>.<span class="pl-en">retry</span>(<span class="pl-s1">kwargs</span><span class="pl-c1">=</span><span class="pl-s1">kwargs</span>, <span class="pl-s1">countdown</span><span class="pl-c1">=</span><span class="pl-c1">15</span>)
            
        <span class="pl-s1">my_dict_params</span> <span class="pl-c1">=</span> {<span class="pl-s">"param1"</span>: <span class="pl-s">"1"</span>,
                          <span class="pl-s">"param2"</span>: <span class="pl-s">"2"</span>}

        <span class="pl-s1">app</span>.<span class="pl-en">a_method</span>(<span class="pl-s1">my_dict_params</span>).<span class="pl-en">delay</span>()</pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>

<p dir="auto">I expect retry do parameters expansion as the first normal call.</p>
<h1 dir="auto">Actual Behavior</h1>
Celery correcly saves "kwargs" state but on retry execution dosn't expand the kwargs arguments, asking for "positional arguments".
<p dir="auto">I am using SQS as a broker, and trying to use an existing queue. but everytime I am trying to send a message to the queue, celery creates a new queue with a random id as name.<br>
This is how my my tasks.py looks like</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from celery import Celery
from kombu.utils.url import safequote

# real credentials, faking them here.
aws_access_key = safequote(&quot;ABCDEFGHJIKL&quot;)
aws_secret_key = safequote(&quot;abcdefhjkiglkiominoql&quot;)
broker_transport_options = {'region': 'us-west-2'}

broker_url=f&quot;sqs://{aws_access_key}:{aws_secret_key}@&quot;
task_create_missing_queues = False
event_queue_prefix = None

app = Celery('tasks', broker=broker_url, backend='rpc://')

app.conf.broker_transport_options = broker_transport_options

app.conf.task_default_queue = 'myqueue'
app.conf.task_create_missing_queues = False
app.conf.event_queue_prefix = None

@app.task
def mytask(text):
    return f&quot;the text intput was {text}&quot;"><pre class="notranslate"><code class="notranslate">from celery import Celery
from kombu.utils.url import safequote

# real credentials, faking them here.
aws_access_key = safequote("ABCDEFGHJIKL")
aws_secret_key = safequote("abcdefhjkiglkiominoql")
broker_transport_options = {'region': 'us-west-2'}

broker_url=f"sqs://{aws_access_key}:{aws_secret_key}@"
task_create_missing_queues = False
event_queue_prefix = None

app = Celery('tasks', broker=broker_url, backend='rpc://')

app.conf.broker_transport_options = broker_transport_options

app.conf.task_default_queue = 'myqueue'
app.conf.task_create_missing_queues = False
app.conf.event_queue_prefix = None

@app.task
def mytask(text):
    return f"the text intput was {text}"
</code></pre></div>
<p dir="auto">Another one of my surprises is that the following still works. I never open on any tab a celery (server? process?) as all tutorials explain:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# I am not running this
celery -A tasks worker  --loglevel=INFO"><pre class="notranslate"><code class="notranslate"># I am not running this
celery -A tasks worker  --loglevel=INFO
</code></pre></div>
<p dir="auto">The only thing I am doing is opening a pytho interpreter, and for some reason, running a <code class="notranslate">mytask.delay('myexample')</code> still works. I was expecting for it not to work</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="python
Python 3.9.9 (main, Nov 17 2021, 16:40:29)
[GCC 8.3.0] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import tasks
# Why does the following works, regardless if I have a &quot;celery process&quot; running or not?
&gt;&gt;&gt; tasks.mytask.delay('asdasd')
&lt;AsyncResult: 311e6538-dd79-451a-b282-5be1b271d736&gt;"><pre class="notranslate"><code class="notranslate">python
Python 3.9.9 (main, Nov 17 2021, 16:40:29)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import tasks
# Why does the following works, regardless if I have a "celery process" running or not?
&gt;&gt;&gt; tasks.mytask.delay('asdasd')
&lt;AsyncResult: 311e6538-dd79-451a-b282-5be1b271d736&gt;
</code></pre></div>
<p dir="auto">so to summarize:</p>
<ol dir="auto">
<li>Why is this creating a new queue in SQS instead of just reusing <code class="notranslate">myqueue</code> declared in <code class="notranslate">app.conf.task_default_queue = 'myqueue'</code>?</li>
<li>why is this working, even if I don't have a celery process running?</li>
</ol>