Got NGINX error was told to post here

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: plenti.dev

I ran this command: sudo certbot --nginx

It produced this output:

Keeping the existing certificate
Deploying Certificate to VirtualHost /etc/nginx/nginx.conf
nginx: [warn] conflicting server name "plenti.dev" on 0.0.0.0:80, ignored
nginx: [error] invalid PID number "" in "/run/nginx.pid"
Rolling back to previous server configuration...
nginx: [warn] conflicting server name "plenti.dev" on 0.0.0.0:80, ignored
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/client.py", line 526, in deploy_certificate
    self.installer.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/client.py", line 626, in _rollback_and_restart
    self.installer.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''

IMPORTANT NOTES:
 - An error occurred and we failed to restore your config and restart
   your server. Please post to
   https://community.letsencrypt.org/c/server-config with details
   about your configuration and this error you received.
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/plenti.dev/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/plenti.dev/privkey.pem
   Your cert will expire on 2019-12-06. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"

My web server is (include version): Apache Tomcat/8.5.31

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

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): no

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

1 Like

Hi,

Could you please share us the output of the below commands:
sudo nginx -t
sudo systemctl status nginx

Thank you

2 Likes

The server name “plenty.dev” appears in too many places…
Please show these outputs:

grep -ERi 'virt|server_name|root|listen|rewrite|return|cert|acme|include' /etc/nginx/
ls -l /etc/nginx/sites-enabled/

Note: For legibility, please always precede and {“postcede”|“follow”|“succeed”} text that does format properly with 3 sequential back ticks on lines of their own - like:
```
your text
```

Note on note: 3 consecutive back ticks will not show on the right pane - that is normal.

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