• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue sw-engine won't start

jay9123

New Pleskian
Hi,

I try to rebooted the server. Now everything is broken

I get the 502 Bad Gateway error when I try to access the Plesk login page.

When I try to run
systemctl status sw-cp-server.service
process:17940 ExecStartPre/usr/sbin/sw-cp-serverd -q -t (code=exited, status=1/Failure)

Any ideas what I can do to fix this?
 
Hi @jay9123 , thank you for posting. We'll need a bit more information. Normally, a reason is mentioned why sw-cp-server cannot start. Can you find a few more details in journald or /var/log/messages, /var/log/syslog or similar?
 
Jun 1 13:24:16 192-46-230-233 systemd[1]: Starting Startup script for Plesk control panel server...
Jun 1 13:24:16 192-46-230-233 sw-cp-serverd[8268]: nginx: [emerg] cannot load certificate "/opt/psa/var/certificates/scfuLoLFJ": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/opt/psa/var/certificates/scfuLoLFJ','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Jun 1 13:24:16 192-46-230-233 sw-cp-serverd[8268]: nginx: configuration file /etc/sw-cp-server/config test failed
Jun 1 13:24:16 192-46-230-233 systemd[1]: sw-cp-server.service: Control process exited, code=exited, status=1/FAILURE
Jun 1 13:24:16 192-46-230-233 systemd[1]: sw-cp-server.service: Failed with result 'exit-code'.
Jun 1 13:24:16 192-46-230-233 systemd[1]: Failed to start Startup script for Plesk control panel server.
Jun 1 13:24:16 192-46-230-233 systemd[1]: Started Session 30 of user root.
Jun 1 13:24:17 192-46-230-233 postfix/smtpd[2736]: disconnect from unknown[80.94.95.203] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Jun 1 13:24:17 192-46-230-233 plesk_saslauthd[2513]: No such user '[email protected]' in mail authorization database
Jun 1 13:24:17 192-46-230-233 plesk_saslauthd[2513]: failed mail authentication attempt for user '[email protected]' (password len=11)
Jun 1 13:24:17 192-46-230-233 postfix/smtpd[2402]: warning: unknown[80.94.95.242]: SASL LOGIN authentication failed: authentication failure
Jun 1 13:24:18 192-46-230-233 postfix/smtpd[2397]: connect from unknown[80.94.95.203]
Jun 1 13:24:18 192-46-230-233 postfix/smtpd[2397]: disconnect from unknown[80.94.95.203] quit=1 commands=1
 
Starting Startup script for Plesk control panel server...
Jun 1 13:51:24 192-46-230-233 sw-cp-serverd[14144]: nginx: [emerg] cannot load certificate "/opt/psa/var/certificates/scfuLoLFJ": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/opt/psa/var/certificates/scfuLoLFJ','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Jun 1 13:51:24 192-46-230-233 sw-cp-serverd[14144]: nginx: configuration file /etc/sw-cp-server/config test failed
Jun 1 13:51:24 192-46-230-233 systemd[1]: sw-cp-server.service: Control process exited, code=exited, status=1/FAILURE
 
You're missing a certificate. Have you tried running this command?
Code:
# plesk repair web

If that doesn't work:
Code:
# plesk repair installation
 
In case this does not work: sw-cp-server is seeking a certificate that you have used to protect the host. Obviously that certificate is missing. You can try to go to Tools & Settings > Security > SSL/TLS Certificates and add a new certificate there ("+ Let's Encrypt").
 
In case this does not work: sw-cp-server is seeking a certificate that you have used to protect the host. Obviously that certificate is missing. You can try to go to Tools & Settings > Security > SSL/TLS Certificates and add a new certificate there ("+ Let's Encrypt").
Now unable access the Plesk login page
 
I getting this error!!!!


root@192-46-230-233:~# plesk bin certificate --assign-cert "Lets Encrypt certificate" -ip 192.46.230.233

SSL/TLS certificate 'Lets Encrypt certificate' was successfully assigned to IP address 192.46.230.233
[2023-06-02 15:05:22.931] 182973:647a053230d62 ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/f2bmng' '--set-options'] with exit code [1]
PHP Fatal error: Uncaught PleskUtilException: f2bmng failed: 2023-06-02 15:05:22,895 fail2ban [183012]: ERROR NOK: ("Failed to initialize any backend for Jail 'ssh'",)
ERROR:__main__:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255. in /opt/psa/admin/plib/Service/Agent.php:159
Stack trace:
#0 /opt/psa/admin/plib/Ip/Ban/Manager.php(515): Service_Agent->execAndGetResponse('f2bmng', Array, '{"ignoreip":"12...')
#1 /opt/psa/admin/plib/Ip/Ban/Manager.php(227): Ip_Ban_Manager->_callUtility('--set-options', '{"ignoreip":"12...')
#2 /opt/psa/admin/plib/Ip/Ban/Manager.php(237): Ip_Ban_Manager->saveTrustedIps()
#3 /opt/psa/admin/plib/Fail2Ban/EventListener.php(106): Ip_Ban_Manager->addTrustedIps(Array)
#4 [internal function]: Plesk\Fail2Ban\EventListener->applyChanges()
#5 {main}
thrown in /opt/psa/admin/plib/Service/Agent.php on line 159
exit status 255
 
Temporarily stop Fail2Ban:
Code:
# systemctl stop fail2ban

and try to assign the certificate again
 
Jun 3 00:00:37 192-46-230-233 systemd[1]: Starting Startup script for Plesk control panel server...
Jun 3 00:00:37 192-46-230-233 sw-cp-serverd[296322]: nginx: [emerg] cannot load certificate "/opt/psa/var/certificates/scfuLoLFJ": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/opt/psa/var/certificates/scfuLoLFJ','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Jun 3 00:00:37 192-46-230-233 sw-cp-serverd[296322]: nginx: configuration file /etc/sw-cp-server/config test failed
Jun 3 00:00:37 192-46-230-233 systemd[1]: sw-cp-server.service: Control process exited, code=exited, status=1/FAILURE
 
Please get in touch with Plesk Support to fix the issue directly on your server:

Note that Plesk Support is free for the 1st month, even if you obtained a Plesk license from a Plesk Partner or reseller.

You can give Plesk Support access to your server via the command line as explained here:
 
Sounds like the cert is corrupted. Try to manually replace it with the default certificate.

  1. Log in via SSH and run this command to get the default certificate:
    Code:
    plesk db "select id,cert_file,ca_file,name from certificates where name like '%default%'"
    It'll return something like this:
    Code:
    +----+-------------+---------+---------------------+
    | id | cert_file   | ca_file | name                |
    +----+-------------+---------+---------------------+
    |  2 | certvLc67VS |         | default certificate |
    +----+-------------+---------+---------------------+
  2. Replace the appropriate field in the command below with the cert file you got in the last step, and run it to replace the current cert:
    Code:
    cp /usr/local/psa/var/certificates/<cert_from_last_step> /opt/psa/var/certificates/scfuLoLFJ
  3. Try to start the services again and see if you can log in to Plesk.
If that doesn't work, then yeah contact Plesk Support to access the server directly and see what's up.
 
Back
Top