Articles in this section

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

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

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

  • sw-engine processes cause high CPU usage.

  • One of the following error messages appears in /var/log/sw-cp-server/error_log:

    CONFIG_TEXT: [error] 8074#0: *1046 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 203.0.113.2, server: , request: "GET /login_up.php3 HTTP/1.1", upstream: "fastcgi://unix:/var/run/sw-engine.sock", host: "example.com:8443"


    CONFIG_TEXT: [error] 2550#0: *521 recv() failed (104: Connection reset by peer) while reading response header from upstream, client:203.0.113.2, server: , request: "GET /login_up.php3 HTTP/1.1", upstream: "fastcgi://unix:/var/run/sw-engine.sock:", host: "203.0.113.2:8443"

  • Restarting Plesk services has no effect:

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

Cause

One or several processes of Plesk services is/are stuck.

Resolution

  1. Connect to your Plesk server via SSH.

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

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

  3. List hung 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

Was this article helpful?

Comments

5 comments
Date Votes
  • kill doesn't exist as a bash

    0
  • Only rebooting the server solved the problem for us.

    0
  • i got this error 

    ps aux | grep sw-engine

    psaadm      1915  0.0  0.1 134476 51720 ?        Ss   08:23   0:04 /usr/bin/sw-engine -c /opt/psa/admin/conf/php.ini /opt/psa/admin/plib/WebSocket/bin/ws-server.php

    root      644734  0.0  0.0   6316   708 pts/0    S+   20:53   0:00 grep sw-engine

    root@cloud:~# kill -9 644734

    bash: kill: (644734) - No such process

    root@cloud:~# systemctl start sw-cp-server && systemctl start sw-engine

    Job for sw-cp-server.service failed because the control process exited with error code.

    See "systemctl status sw-cp-server.service" and "journalctl -xe" for details.

    0
  • can I restore my website 

    0
  • @Muhammed Aslan 

    644734 was your grep process.

    You have to execute

    kill -9 1915

    You can also try:

    pkill 'sw-engine'
    0

Please sign in to leave a comment.