TITLE:
Let's Encrypt still causing issues with web server configuration on updating certificates
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:Onyx 17.0, CentOS 7.2, Let's Encrypt 2.0.3 release 31, 64-Bit
PROBLEM DESCRIPTION:SSL renewal breaks web server configuration. It still does :-(
STEPS TO REPRODUCE:Have many domains up for SS certificate renewal, then execute Let's Encrypt renewal routine in a situation where many certificates need renewal.
ACTUAL RESULT:Breaking web server configuration, requiring manual reconfiguration of a small number of domains and manual restart of httpd and nginx.
EXPECTED RESULT:Silently renew without breaking certificate file names or Plesk web server configuration.
ANY ADDITIONAL INFORMATION:The daily renewal task has renewed certificates. The renewal process lasted approximately 25 minutes. Many certificates were renewed. During the process, approximately a dozen times this error message is mailed to admin:
"Unable to generate the web server configuration file on the host <HOSTNAME.TLD> because of the following errors:
Template_Exception: nginx: [emerg] BIO_new_file("/usr/local/psa/var/certificates/cert-7CIkBh") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/psa/var/certificates/cert-7CIkBh','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed
file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
Please resolve the errors in web server configuration templates and generate the file again."
and similar from Nginx:
"Template_Exception: nginx: [emerg] BIO_new_file("/usr/local/psa/var/certificates/cert-7CIkBh") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/psa/var/certificates/cert-7CIkBh','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed"
httpd web server configuration tests ("apachectl -t") during the renewal process list configuration errors. During the last few minutes of the script run, nginx configuration tests ("nginx -t") also show errors. After the renewal script has finished these configuration errors do not longer appear, but in one case one Plesk configuration in the GUI was marked as "damaged" while it was not --> The first domain configuration that the mail came on. The only way to remove the error marker and message from GUI is to run Troubleshooter Extension and to reconfigure all erroneous configuration files.
But after doing that, we had to learn that Nginx displayed a 502 bad gateway error, although httpd was "active" according to the service status output. Only a manual restart of httpd and nginx afterwards resolved that issue.
This behavior is all not new, it's been the case for many months with different versions of the Let's Encrypt extension on different hosts that we operate. I know that this will be hard to figure out, because the test scenario is difficult to reproduce. I can only say that we've seen the wrong certificate links before. I read that with 2.0.3 the algorithm was replaced to use symbolic links instead of real files for the certificates, so that this could no longer happen, but it does not seem to work yet.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:"Unable to generate the web server configuration file on the host <HOSTNAME.TLD> because of the following errors:
Template_Exception: nginx: [emerg] BIO_new_file("/usr/local/psa/var/certificates/cert-7CIkBh") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/psa/var/certificates/cert-7CIkBh','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed
file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
Please resolve the errors in web server configuration templates and generate the file again."
and similar from Nginx:
"Template_Exception: nginx: [emerg] BIO_new_file("/usr/local/psa/var/certificates/cert-7CIkBh") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/psa/var/certificates/cert-7CIkBh','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed"
httpd web server configuration tests ("apachectl -t") during the renewal process list configuration errors. During the last few minutes of the script run, nginx configuration tests ("nginx -t") also show errors. After the renewal script has finished these configuration errors do not longer appear, but in one case one Plesk configuration in the GUI was marked as "damaged" while it was not --> The first domain configuration that the mail came on. The only way to remove the error marker and message from GUI is to run Troubleshooter Extension and to reconfigure all erroneous configuration files.
But after doing that, we had to learn that Nginx displayed a 502 bad gateway error, although httpd was "active" according to the service status output. Only a manual restart of httpd and nginx afterwards resolved that issue.
This behavior is all not new, it's been the case for many months with different versions of the Let's Encrypt extension on different hosts that we operate. I know that this will be hard to figure out, because the test scenario is difficult to reproduce. I can only say that we've seen the wrong certificate links before. I read that with 2.0.3 the algorithm was replaced to use symbolic links instead of real files for the certificates, so that this could no longer happen, but it does not seem to work yet.
Confirm bug