Search code examples
ubuntuplesk

502 Plesk connect() to unix:/var/run/sw-engine.sock failed- Ubuntu


I work in hosting and have the unfortunate disadvantage of troubleshooting customer's Plesk installs. I have noted 4 separate server have the same issue over the last hour.

Identification:

This can be identified by:

tail -n 2 /var/log/sw-cp-server/error_log

If you see output similar to the following then you have this issue:

user@hostname:~# tail -n 2 /var/log/sw-cp-server/error_log
2016/12/15 04:51:17 [crit] 2318#0: *2867 connect() to unix:/var/run/sw-engine.sock failed (2: No such file or directory) while connecting to upstream, client: 10.10.10.10, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/sw-engine.sock:", host: "123.45.67.89:8443"
2016/12/15 05:23:16 [crit] 2318#0: *2872 connect() to unix:/var/run/sw-engine.sock failed (2: No such file or directory) while connecting to upstream, client: 10.10.10.10, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/sw-engine.sock:", host: "123.45.67.89:8443"
user@hostname:~#

See below for resolution

Other useful articles that I touched while looking into this:

https://kb.plesk.com/en/118973 - Cannot open File Manager: "502 bad gateway"

Cause

  • The issue is triggered by the existence of a large number of files in the directory that you tried to open.

https://kb.plesk.com/en/123072 - Cannot open File Manager: "502 bad gateway"

Cause

  • Misconfigured startup links

https://kb.plesk.com/en/123735 - Plesk sw-engine is unavailable after each reboot on Ubuntu

Cause

  • Web server configuration files are corrupted or absent.

Solution

  • Resolution:

    Restart sw-engine.

    This can be done by running one of the following commands as a privileged user:

    service sw-engine restart

    OR

    /etc/init.d/sw-engine restart

    Cause:

    Unsure at this time. All four servers were updated in the last 24 hours though.

    I hope this helps someone else.