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 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-taskinstall | 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"
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
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-taskinstall | 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"