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
To cancel a task that is stuck, please follow the steps corresponding to your environment:
To cancel a stuck task in Plesk on a Linux Server
-
Connect to the Plesk server via SSH.
-
Create a backup of the Plesk database:
# plesk db dump > /root/psa_dump.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
longtasks
table usingid
from step 3:# plesk db "DELETE FROM longtasks WHERE id=56"
-
Delete entries from the
longtaskparams
table usingid
from step 3:# plesk db "DELETE FROM longtaskparams WHERE task_id=56"
-
Kill the stuck process:
# pkill task-async-executor
Note: In case tasks keep getting stuck after performing the above actions, clear the lock manager using the below commands:
# service sw-engine stop
# rm -rf /var/lock/lmlib/container_locks
# rm -f /usr/local/psa/var/cache/*
# service sw-engine start
To cancel a stuck task in Plesk on a Windows Server
-
Connect to the Plesk server via RDP.
-
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
longtasks
table usingid
from step 4:C:\> plesk db "DELETE FROM longtasks WHERE id=56"
-
Delete entries from the
longtaskparams
table usingid
from step 4:C:\> plesk db "DELETE FROM longtaskparams WHERE task_id=56"
Comments
2 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 :(
Please sign in to leave a comment.