Attempting to renew cert (***.com) from /etc/letsencrypt/renewal/***.com.conf produced an unexpected
第一种情况
Attempting to parse the version 0.27.1 renewal configuration file found at /etc/letsencrypt/renewal/***.com.conf with version 0.27.0 of Certbot. This might not work.
Could not choose appropriate plugin: The nginx plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError()
Attempting to renew cert (***.com) from /etc/letsencrypt/renewal/***.com.conf produced an unexpected error: The nginx plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError(). Skipping.
其中一种原因:
nginx -s reload
nginx: [error] invalid PID number "" in "/var/run/nginx.pid"
- 直接将 nginx 主进程的 PID 写入
"/run/nginx.pid" -
ps -aux | grep "nginx: master process" pid 11122 sudo echo 11122> /run/nginx.pid
第二种情况
Could not choose appropriate plugin: The nginx plugin is not working; there may be problems with your existing configuration.
5114 The error was: NoInstallationError("Could not find a usable 'nginx' binary. Ensure nginx exists, the binary is executable, and your PATH is set correctly.",)
5115 Failed to renew certificate test.store.zhenligroup.com with error: The nginx plugin is not working; there may be problems with your existing configuration.
5116 The error was: NoInstallationError("Could not find a usable 'nginx' binary. Ensure nginx exists, the binary is executable, and your PATH is set correctly.",)
指定 nginx path:--nginx-ctl /usr/sbin/nginx
/usr/bin/certbot --nginx-ctl /usr/sbin/nginx renew