<p>The answer was, to delete the first row of the <code>queue</code> table <em>in the correct database</em>.<br>
Also, it helped to increase <code>max_execution_time</code> in /etc/php/7.1/apache2/php.ini</p>

CC BY-SA 4.0
2018-05-07T13:16:07.380Z
2018-05-07T13:16:07.380Z
kr37
<p>I've got 12 pending tasks, and can't get rid of the first stuck one.  </p>

<ul>
<li><code>CP-&gt;Utilities-&gt;Clear Caches</code> doesn't seem to help.  </li>
<li>In the database, in <code>craft_queue</code> there were five rows, the first one seeming to be the stuck one. I deleted all of those</li>
</ul>

<p>Still the first task is stuck, and by now there are 14 tasks waiting.<br>
I see that <code>craft_templatecachequeries</code> has over 11,000 rows. Would those be helpful to delete?</p>

CC BY-SA 4.0
2018-05-05T13:41:34.163Z
Can't you delete them in your Database  interface (phpmyadmin /adminer...) ? If not delete them via Craft query
Robin Schambach
CC BY-SA 4.0
2018-05-06T01:02:24.553Z
@RobinSchambach Thanks, I did that, but things haven't changed. Question updated with additional info.
kr37
CC BY-SA 4.0
2018-05-06T06:14:44.387Z
Could you please tell us the name of that task? They should not reappear when you delete them
Robin Schambach
CC BY-SA 4.0
2018-05-06T12:17:44.347Z
Thank you, @RobinSchambach, it was a dumb mistake. I deleted them from the wrong database (staging instead of development). Progressing now.
kr37
<craft3><stalled-tasks>
In Craft 3, how to clear stuck "Deleting Stale Template Caches"
# In Craft 3, how to clear stuck "Deleting Stale Template Caches"

(Asked by: username_0 on 2018-05-05)

I've got 12 pending tasks, and can't get rid of the first stuck one.

* `CP->Utilities->Clear Caches` doesn't seem to help.
* In the database, in `craft_queue` there were five rows, the first one seeming to be the stuck one. I deleted all of those

Still the first task is stuck, and by now there are 14 tasks waiting.  
I see that `craft_templatecachequeries` has over 11,000 rows. Would those be helpful to delete?

**Tags:** craft3, stalled-tasks
> **Comments:**
> **username_1**: Can't you delete them in your Database  interface (phpmyadmin /adminer...) ? If not delete them via Craft query  
> **username_0**: @RobinSchambach Thanks, I did that, but things haven't changed. Question updated with additional info.  
> **username_1**: Could you please tell us the name of that task? They should not reappear when you delete them  
> **username_0**: Thank you, @RobinSchambach, it was a dumb mistake. I deleted them from the wrong database (staging instead of development). Progressing now.  

---

## 1 answers

### Answer by username_0 on 2018-05-07. Score: 3 | Accepted answer

The answer was, to delete the first row of the `queue` table *in the correct database*.  
Also, it helped to increase `max_execution_time` in /etc/php/7.1/apache2/php.ini


---

