Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
A task (scheduled task, WordPress installation, extension update, etc.) is stuck in Plesk. How to stop this stuck task and close the "tasks in progress" window?
Answer
- Connect to your Plesk server via SSH.
-
Create a backup of the Plesk database:
# plesk db dump > /root/psa_dump_for_kb_12377460333463.sql
-
Find the stuck process:
# plesk db "SELECT id,type,status,finishTime FROM longtasks WHERE status <> 'done'"
+----+-----------------------------+---------+---------------------+
| id | type | status | finishTime |
+----+-----------------------------+---------+---------------------+
| 56 | ext-wp-toolkit-task\install | started | 0000-00-00 00:00:00 |
+----+-----------------------------+---------+---------------------+ -
Delete the task from the
longtaskstable usingidfrom step 3:# plesk db "DELETE FROM longtasks WHERE id=56"
-
Delete entries from the
longtaskparamstable usingidfrom step 3:# plesk db "DELETE FROM longtaskparams WHERE task_id=56"
-
If there are several stuck tasks that have to be cancelled, run the commands below to delete them:
# plesk db -Ne "SELECT id FROM longtasks WHERE status <> 'done'" | while read i; do plesk db "DELETE FROM longtaskparams WHERE task_id=$i" ; done
# plesk db "DELETE FROM longtasks WHERE status <> 'done'"
-
-
Stop the process that manages the stuck task:
# pkill task-async-executor
In case new tasks keep getting stuck in Plesk after performing the above actions, clear the lock manager using the command:
# systemctl stop sw-engine && rm -rf /var/lock/lmlib/container_locks/* && rm -f /usr/local/psa/var/cache/* && systemctl start sw-engine
- Connect to your Plesk server via RDP.
- Start a command prompt as an Administrator.
-
Create a backup of the Plesk database:
C:\> plesk db dump > C:\psa_dump.sql
-
Find the stuck process:
C:\> plesk db "SELECT id,type,status,finishTime FROM longtasks WHERE status <> 'done'"
+----+-----------------------------+---------+---------------------+
| id | type | status | finishTime |
+----+-----------------------------+---------+---------------------+
| 56 | ext-wp-toolkit-task\install | started | 0000-00-00 00:00:00 |
+----+-----------------------------+---------+---------------------+ -
Delete the task from the
longtaskstable usingidfrom step 4:C:\> plesk db "DELETE FROM longtasks WHERE id=56"
-
Delete entries from the
longtaskparamstable usingidfrom step 4:C:\> plesk db "DELETE FROM longtaskparams WHERE task_id=56"
Comments
thank you so much for sharing
This ensured I could remove the stuck task from the queue, but when I go to run the task again (ie: remove a subscription), it just gets stuck again... tried the steps to clear the lock manager, but no difference :(
I have done all the steps, but I still have problems
Thanks for your help
# pkill task-async-executor
produced the following error message on ubuntu 24.04:
pkill: pattern that searches for process name longer than 15 characters will result in zero matches
Try `pkill -f' option to match against the complete command line.
Other than that, it was definitely helpful and to the point.
Please sign in to leave a comment.