Plesk

 How to cancel a stuck task in Plesk

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

 

Canceling a stuck task in Plesk for Linux

 

  1. Connect to the Plesk server via SSH.

  2. Create a backup of the Plesk database:

    # plesk db dump > /root/psa_dump.sql

  3. 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 |
    +----+-----------------------------+---------+---------------------+

  4. Delete the task from the longtasks table using id from step 3:

    # plesk db "DELETE FROM longtasks WHERE id=56"

  5. Delete entries from the longtaskparams table using id from step 3:

    # plesk db "DELETE FROM longtaskparams WHERE task_id=56"

  6. 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

 

Canceling a stuck task in Plesk for Windows Server

 

  1. Connect to the Plesk server via RDP.

  2. Start a command prompt as an Administrator.

  3. Create a backup of the Plesk database:

    C:> plesk db dump > C:psa_dump.sql

  4. 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 |
    +----+-----------------------------+---------+---------------------+

  5. Delete the task from the longtasks table using id from step 4:

    C:> plesk db "DELETE FROM longtasks WHERE id=56"

  6. Delete entries from the longtaskparams table using id from step 4:

    C:> plesk db "DELETE FROM longtaskparams WHERE task_id=56"

 

Exit mobile version