SSL certifcate failed

My domain is: 46.101.14.60 linked to subtleradio.live

I ran this command:

  1. SSH into the serverSSH into the server running your HTTP website as a user with sudo privileges.

  2. Add Certbot PPAYou’ll need to add the Certbot PPA to your list of repositories. To do so, run the following commands on the command line on the machine:

  3. sudo apt-get update

  4. sudo apt-get install software-properties-common

  5. sudo add-apt-repository universe

  6. sudo add-apt-repository ppa:certbot/certbot

  7. sudo apt-get update

  8. Install CertbotRun this command on the command line on the machine to install Certbot.

sudo apt-get install certbot python-certbot-nginx

  1. Choose how you’d like to run Certbot
  • Either get and install your certificates…Run this command to get a certificate and have Certbot edit your Nginx configuration automatically to serve it, turning on HTTPS access in a single step.

sudo certbot --nginx

  • Or, just get a certificateIf you’re feeling more conservative and would like to make the changes to your Nginx configuration by hand, run this command.

sudo certbot certonly --nginx

It produced this output:

root@automation:~# sudo apt-get update Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease Hit:2 http://ppa.launchpad.net/certbot/certbot/ubuntu xenial InRelease Hit:3 http://mirrors.digitalocean.com/ubuntu xenial InRelease Ign:4 http://download.opensuse.org/repositories/home:/hairmare:/silan/Ubuntu_14.10_standard ./ InRelease Hit:5 http://download.opensuse.org/repositories/home:/hairmare:/silan/Ubuntu_14.10_standard ./ Release Get:6 http://mirrors.digitalocean.com/ubuntu xenial-updates InRelease [109 kB] Get:7 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB] Get:8 http://mirrors.digitalocean.com/ubuntu xenial-backports InRelease [107 kB] Err:9 http://download.opensuse.org/repositories/home:/hairmare:/silan/Ubuntu_14.10_standard ./ Release.gpg The following signatures were invalid: KEYEXPIRED 1563022714 Get:10 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 Packages [1,119 kB] Fetched 1,444 kB in 1s (1,297 kB/s) Reading package lists... Done W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.opensuse.org/repositories/home:/hairmare:/silan/Ubuntu_14.10_standard ./ Release: The following signatures were invalid: KEYEXPIRED 1563022714 W: Failed to fetch http://download.opensuse.org/repositories/home:/hairmare:/silan/Ubuntu_14.10_standard/./Release.gpg The following signatures were invalid: KEYEXPIRED 1563022714 W: Some index files failed to download. They have been ignored, or old ones used instead. root@automation:~# sudo apt-get install software-properties-common
$: command not found
root@automation:~# $sudo apt-get install software-properties-common
Reading package lists… Done
Building dependency tree
Reading state information… Done
software-properties-common is already the newest version (0.96.20.9).
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-138 linux-headers-4.4.0-138-generic linux-headers-4.4.0-139 linux-headers-4.4.0-139-generic
linux-headers-4.4.0-141 linux-headers-4.4.0-141-generic linux-headers-4.4.0-143 linux-headers-4.4.0-143-generic
linux-headers-4.4.0-145 linux-headers-4.4.0-145-generic linux-headers-4.4.0-148 linux-headers-4.4.0-148-generic
linux-headers-4.4.0-150 linux-headers-4.4.0-150-generic linux-headers-4.4.0-151 linux-headers-4.4.0-151-generic
linux-headers-4.4.0-154 linux-headers-4.4.0-154-generic linux-headers-4.4.0-157 linux-headers-4.4.0-157-generic
linux-headers-4.4.0-159 linux-headers-4.4.0-159-generic linux-headers-4.4.0-161 linux-headers-4.4.0-161-generic
linux-headers-4.4.0-164 linux-headers-4.4.0-164-generic linux-headers-4.4.0-165 linux-headers-4.4.0-165-generic
linux-headers-4.4.0-166 linux-headers-4.4.0-166-generic linux-headers-4.4.0-168 linux-headers-4.4.0-168-generic
linux-headers-4.4.0-169 linux-headers-4.4.0-169-generic linux-headers-4.4.0-170 linux-headers-4.4.0-170-generic
linux-headers-4.4.0-171 linux-headers-4.4.0-171-generic linux-headers-4.4.0-173 linux-headers-4.4.0-173-generic
linux-image-4.4.0-138-generic linux-image-4.4.0-139-generic linux-image-4.4.0-141-generic
linux-image-4.4.0-143-generic linux-image-4.4.0-145-generic linux-image-4.4.0-148-generic
linux-image-4.4.0-150-generic linux-image-4.4.0-151-generic linux-image-4.4.0-154-generic
linux-image-4.4.0-157-generic linux-image-4.4.0-159-generic linux-image-4.4.0-161-generic
linux-image-4.4.0-164-generic linux-image-4.4.0-165-generic linux-image-4.4.0-166-generic
linux-image-4.4.0-168-generic linux-image-4.4.0-169-generic linux-image-4.4.0-170-generic
linux-image-4.4.0-171-generic linux-image-4.4.0-173-generic linux-modules-4.4.0-143-generic
linux-modules-4.4.0-145-generic linux-modules-4.4.0-148-generic linux-modules-4.4.0-150-generic
linux-modules-4.4.0-151-generic linux-modules-4.4.0-154-generic linux-modules-4.4.0-157-generic
linux-modules-4.4.0-159-generic linux-modules-4.4.0-161-generic linux-modules-4.4.0-164-generic
linux-modules-4.4.0-165-generic linux-modules-4.4.0-166-generic linux-modules-4.4.0-168-generic
linux-modules-4.4.0-169-generic linux-modules-4.4.0-170-generic linux-modules-4.4.0-171-generic
linux-modules-4.4.0-173-generic
Use ‘apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 104 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up nginx-core (1.10.3-0ubuntu0.16.04.5) …
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
invoke-rc.d: initscript nginx, action “start” failed.
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-03-19 13:12:40 UTC; 11ms ago
Process: 21611 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 21606 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Mar 19 13:12:39 automation nginx[21611]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address alr… use)
Mar 19 13:12:39 automation nginx[21611]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address … use)
Mar 19 13:12:39 automation nginx[21611]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address alr… use)
Mar 19 13:12:40 automation nginx[21611]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address … use)
Mar 19 13:12:40 automation nginx[21611]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address alr… use)
Mar 19 13:12:40 automation nginx[21611]: nginx: [emerg] still could not bind()
Mar 19 13:12:40 automation systemd[1]: nginx.service: Control process exited, code=exited status=1
Mar 19 13:12:40 automation systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Mar 19 13:12:40 automation systemd[1]: nginx.service: Unit entered failed state.
Mar 19 13:12:40 automation systemd[1]: nginx.service: Failed with result ‘exit-code’.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package nginx-core (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-core (>= 1.10.3-0ubuntu0.16.04.5) | nginx-full (>= 1.10.3-0ubuntu0.16.04.5) | nginx-light (>= 1.10.3-0ubuntu0.16.04.5) | nginx-extras (>= 1.10.3-0ubuntu0.16.04.5); however:
Package nginx-core is not configured yet.
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not installed.
nginx depends on nginx-core (<< 1.10.3-0ubuntu0.16.04.5.1~) | nginx-full (<< 1.10.3-0ubuntu0.16.04.5.1~) | nginx-light (<< 1.10.3-0ubuntu0.16.04.5.1~) | nginx-extras (<< 1.10.3-0ubuntu0.16.04.5.1~); however:
Package nginx-core is not configured yet.
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not installed.

dpkg: error processing package nginx (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-certbot-nginx:
python3-certbot-nginx depends on nginx; however:
Package nginx is not configured yet.
Package ngNo apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
inx-core which provides nginx is not configured yet.

dpkg: error processing package python3-certbot-nginx (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-certbot-nginx:
python-certbot-nginx depends on python3-certbot-nginx; however:
Package python3-certbot-nginx is not configured yet.

dpkg: error processing package python-certbot-nginx (–configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
nginx-core
nginx
python3-certbot-nginx
python-certbot-nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@automation:~# $sudo add-apt-repository universe
‘universe’ distribution component is already enabled for all sources.
root@automation:~# $sudo add-apt-repository ppa:certbot/certbot
This is the PPA for packages prepared by Debian Let’s Encrypt Team and backported for Ubuntu.

Note: Packages are only provided for currently supported Ubuntu releases.
More info: https://launchpad.net/~certbot/+archive/ubuntu/certbot
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring /tmp/tmpd44n0i1a/secring.gpg' created gpg: keyring /tmp/tmpd44n0i1a/pubring.gpg’ created
gpg: requesting key 75BCA694 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpd44n0i1a/trustdb.gpg: trustdb created
gpg: key 75BCA694: public key “Launchpad PPA for certbot” imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
root@automation:~# $sudo apt-get update
Hit:1 http://ppa.launchpad.net/certbot/certbot/ubuntu xenial InRelease
Hit:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu xenial InRelease
Ign:4 http://download.opensuse.org/repositories/home:/hairmare:/silan/Ubuntu_14.10_standard ./ InRelease
Hit:5 http://download.opensuse.org/repositories/home:/hairmare:/silan/Ubuntu_14.10_standard ./ Release
Hit:6 http://mirrors.digitalocean.com/ubuntu xenial InRelease
Hit:7 http://mirrors.digitalocean.com/ubuntu xenial-updates InRelease
Hit:8 http://mirrors.digitalocean.com/ubuntu xenial-backports InRelease
Err:9 http://download.opensuse.org/repositories/home:/hairmare:/silan/Ubuntu_14.10_standard ./ Release.gpg
The following signatures were invalid: KEYEXPIRED 1563022714
Reading package lists… Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.opensuse.org/repositories/home:/hairmare:/silan/Ubuntu_14.10_standard ./ Release: The following signatures were invalid: KEYEXPIRED 1563022714
W: Failed to fetch http://download.opensuse.org/repositories/home:/hairmare:/silan/Ubuntu_14.10_standard/./Release.gpg The following signatures were invalid: KEYEXPIRED 1563022714
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@automation:~# $sudo apt-get install certbot python-certbot-nginx
Reading package lists… Done
Building dependency tree
Reading state information… Done
certbot is already the newest version (0.31.0-1+ubuntu16.04.1+certbot+1).
python-certbot-nginx is already the newest version (0.31.0-1+ubuntu16.04.1+certbot+1).
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-138 linux-headers-4.4.0-138-generic linux-headers-4.4.0-139 linux-headers-4.4.0-139-generic
linux-headers-4.4.0-141 linux-headers-4.4.0-141-generic linux-headers-4.4.0-143 linux-headers-4.4.0-143-generic
linux-headers-4.4.0-145 linux-headers-4.4.0-145-generic linux-headers-4.4.0-148 linux-headers-4.4.0-148-generic
linux-headers-4.4.0-150 linux-headers-4.4.0-150-generic linux-headers-4.4.0-151 linux-headers-4.4.0-151-generic
linux-headers-4.4.0-154 linux-headers-4.4.0-154-generic linux-headers-4.4.0-157 linux-headers-4.4.0-157-generic
linux-headers-4.4.0-159 linux-headers-4.4.0-159-generic linux-headers-4.4.0-161 linux-headers-4.4.0-161-generic
linux-headers-4.4.0-164 linux-headers-4.4.0-164-generic linux-headers-4.4.0-165 linux-headers-4.4.0-165-generic
linux-headers-4.4.0-166 linux-headers-4.4.0-166-generic linux-headers-4.4.0-168 linux-headers-4.4.0-168-generic
linux-headers-4.4.0-169 linux-headers-4.4.0-169-generic linux-headers-4.4.0-170 linux-headers-4.4.0-170-generic
linux-headers-4.4.0-171 linux-headers-4.4.0-171-generic linux-headers-4.4.0-173 linux-headers-4.4.0-173-generic
linux-image-4.4.0-138-generic linux-image-4.4.0-139-generic linux-image-4.4.0-141-generic
linux-image-4.4.0-143-generic linux-image-4.4.0-145-generic linux-image-4.4.0-148-generic
linux-image-4.4.0-150-generic linux-image-4.4.0-151-generic linux-image-4.4.0-154-generic
linux-image-4.4.0-157-generic linux-image-4.4.0-159-generic linux-image-4.4.0-161-generic
linux-image-4.4.0-164-generic linux-image-4.4.0-165-generic linux-image-4.4.0-166-generic
linux-image-4.4.0-168-generic linux-image-4.4.0-169-generic linux-image-4.4.0-170-generic
linux-image-4.4.0-171-generic linux-image-4.4.0-173-generic linux-modules-4.4.0-143-generic
linux-modules-4.4.0-145-generic linux-modules-4.4.0-148-generic linux-modules-4.4.0-150-generic
linux-modules-4.4.0-151-generic linux-modules-4.4.0-154-generic linux-modules-4.4.0-157-generic
linux-modules-4.4.0-159-generic linux-modules-4.4.0-161-generic linux-modules-4.4.0-164-generic
linux-modules-4.4.0-165-generic linux-modules-4.4.0-166-generic linux-modules-4.4.0-168-generic
linux-modules-4.4.0-169-generic linux-modules-4.4.0-170-generic linux-modules-4.4.0-171-generic
linux-modules-4.4.0-173-generic
Use ‘apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 104 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up nginx-core (1.10.3-0ubuntu0.16.04.5) …
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
invoke-rc.d: initscript nginx, action “start” failed.
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-03-19 13:13:49 UTC; 9ms ago
Process: 22144 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 22138 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Mar 19 13:13:48 automation nginx[22144]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address alr… use)
Mar 19 13:13:48 automation nginx[22144]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address … use)
Mar 19 13:13:48 automation nginx[22144]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address alr… use)
Mar 19 13:13:49 automation nginx[22144]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address … use)
Mar 19 13:13:49 automation nginx[22144]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address alr… use)
Mar 19 13:13:49 automation nginx[22144]: nginx: [emerg] still could not bind()
Mar 19 13:13:49 automation systemd[1]: nginx.service: Control process exited, code=exited status=1
Mar 19 13:13:49 automation systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Mar 19 13:13:49 automation systemd[1]: nginx.service: Unit entered failed state.
Mar 19 13:13:49 automation systemd[1]: nginx.service: Failed with result ‘exit-code’.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package nginx-core (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-core (>= 1.10.3-0ubuntu0.16.04.5) | nginx-full (>= 1.10.3-0ubuntu0.16.04.5) | nginx-light (>= 1.10.3-0ubuntu0.16.04.5) | nginx-extras (>= 1.10.3-0ubuntu0.16.04.5); however:
Package nginx-core is not configured yet.
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not installed.
nginx depends on nginx-core (<< 1.10.3-0ubuntu0.16.04.5.1~) | nginx-full (<< 1.10.3-0ubuntu0.16.04.5.1~) | nginx-light (<< 1.10.3-0ubuntu0.16.04.5.1~) | nginx-extras (<< 1.10.3-0ubuntu0.16.04.5.1~); however:
Package nginx-core is not configured yet.
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not installed.

dpkg: error processing package nginx (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-certbot-nginx:
python3-certbot-nginx depends on nginx; however:
Package nginx is not configured yet.
Package ngNo apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
inx-core which provides nginx is not configured yet.

dpkg: error processing package python3-certbot-nginx (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-certbot-nginx:
python-certbot-nginx depends on python3-certbot-nginx; however:
Package python3-certbot-nginx is not configured yet.

dpkg: error processing package python-certbot-nginx (–configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
nginx-core
nginx
python3-certbot-nginx
python-certbot-nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@automation:~# $sudo certbot --nginx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated) (Enter ‘c’ to cancel): subtleradio.live , 46.101.14.60


One or more of the entered domain names was not valid:

46.101.14.60: Requested name 46.101.14.60 is an IP address. The Let’s Encrypt
certificate authority will not issue certificates for a bare IP address.

Would you like to re-enter the names?


(Y)es/(N)o: Y
Please enter in your domain name(s) (comma and/or space separated) (Enter ‘c’
to cancel): subtleradio.live
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for subtleradio.live
nginx: [error] invalid PID number “” in “/run/nginx.pid”
Cleaning up challenges
nginx: [error] invalid PID number “” in “/run/nginx.pid”
Encountered exception during recovery:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 75, in handle_authorizations
resp = self._solve_challenges(aauthzrs)
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 139, in _solve_challenges
resp = self.auth.perform(all_achalls)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1071, in perform
self.restart()
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 881, in restart
nginx_restart(self.conf(‘ctl’), self.nginx_conf)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1141, in nginx_restart
“nginx restart failed:\n%s\n%s” % (out.read(), err.read()))
certbot.errors.MisconfigurationError: nginx restart failed:
b’’
b’’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot/error_handler.py”, line 108, in _call_registered
self.funcs-1
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 323, in _cleanup_challenges
self.auth.cleanup(achalls)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1090, in cleanup
self.restart()
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 881, in restart
nginx_restart(self.conf(‘ctl’), self.nginx_conf)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1141, in nginx_restart
“nginx restart failed:\n%s\n%s” % (out.read(), err.read()))
certbot.errors.MisconfigurationError: nginx restart failed:
b’’
b’’
nginx restart failed:
b’’
b’’
root@automation:~# /usr/bin/certbot renew
Saving debug log to /var/log/letsencrypt/letsencrypt.log


No renewals were attempted.


root@automation:~# $sudo certbot --nginx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated) (Enter ‘c’ to cancel): subtleradio.live
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for subtleradio.live
nginx: [error] invalid PID number “” in “/run/nginx.pid”
Cleaning up challenges
nginx: [error] invalid PID number “” in “/run/nginx.pid”
Encountered exception during recovery:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 75, in handle_authorizations
resp = self._solve_challenges(aauthzrs)
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 139, in _solve_challenges
resp = self.auth.perform(all_achalls)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1071, in perform
self.restart()
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 881, in restart
nginx_restart(self.conf(‘ctl’), self.nginx_conf)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1141, in nginx_restart
“nginx restart failed:\n%s\n%s” % (out.read(), err.read()))
certbot.errors.MisconfigurationError: nginx restart failed:
b’’
b’’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot/error_handler.py”, line 108, in _call_registered
self.funcs-1
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 323, in _cleanup_challenges
self.auth.cleanup(achalls)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1090, in cleanup
self.restart()
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 881, in restart
nginx_restart(self.conf(‘ctl’), self.nginx_conf)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1141, in nginx_restart
“nginx restart failed:\n%s\n%s” % (out.read(), err.read()))
certbot.errors.MisconfigurationError: nginx restart failed:
b’’
b’’
nginx restart failed:
b’’
b’’
root@automation:~# $sudo certbot certonly --nginx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated) (Enter ‘c’ to cancel): subtleradio.live
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for subtleradio.live
nginx: [error] invalid PID number “” in “/run/nginx.pid”
Cleaning up challenges
nginx: [error] invalid PID number “” in “/run/nginx.pid”
Encountered exception during recovery:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 75, in handle_authorizations
resp = self._solve_challenges(aauthzrs)
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 139, in _solve_challenges
resp = self.auth.perform(all_achalls)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1071, in perform
self.restart()
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 881, in restart
nginx_restart(self.conf(‘ctl’), self.nginx_conf)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1141, in nginx_restart
“nginx restart failed:\n%s\n%s” % (out.read(), err.read()))
certbot.errors.MisconfigurationError: nginx restart failed:
b’’
b’’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot/error_handler.py”, line 108, in _call_registered
self.funcs-1
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 323, in _cleanup_challenges
self.auth.cleanup(achalls)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1090, in cleanup
self.restart()
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 881, in restart
nginx_restart(self.conf(‘ctl’), self.nginx_conf)
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 1141, in nginx_restart
“nginx restart failed:\n%s\n%s” % (out.read(), err.read()))
certbot.errors.MisconfigurationError: nginx restart failed:
b’’
b’’
nginx restart failed:
b’’
b’’
root@automation:~#

My web server is (include version): Ubuntu 16.04.4 x64

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is: digital ocean

I can login to a root shell on my machine (yes or no, or I don’t know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): terminal

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):

your server has a lot more issues you should take care of, before thinking about certbot.

for example, you should tell dpkg to reconfigure nginx.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.