Plesk

Plesk never loads or fails with 502 Bad Gateway/504 Gateway errors

Applicable to:

  • Plesk for Linux

Symptoms

Cause

Plesk panel services are stuck.

Resolution

  1. Connect to the Plesk server via SSH.

  2. Stop the sw-engine and sw-cp-server services:

    # systemctl stop sw-engine stop && systemctl stop sw-cp-server

  3. Find hanged sw-engine processes:

    # ps aux | grep sw-engine
    root 23173 0.0 0.3 383796 37504 ? SN 09:19 0:00 /usr/bin/sw-engine -c /usr/local/psa/admin/conf/php.ini /usr/local/psa/admin/plib/DailyMaintainance/script.php
    root 30148 0.0 0.3 398044 45916 ? SN 09:20 0:00 /usr/bin/sw-engine -c /usr/local/psa/admin/conf/php.ini /usr/local/psa/admin/plib/DailyMaintainance/task-script.php PleskUsage --period=daily
    root 30164 0.0 0.3 391748 38820 ? SN 09:20 0:04 /usr/bin/sw-engine -c /usr/local/psa/admin/conf/php.ini /usr/local/psa/bin/php_handler --list -json true

  4. Kill all listed above processes using their PID:

    # kill -9 23173 30148 30164

  5. Start Plesk services:

    # systemctl start sw-cp-server && systemctl start sw-engine