Directive is duplicate

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: odysseytours.nz

I ran this command: certbot renew --cert-name odysseytours.nz --dry-run

It produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log


Processing /etc/letsencrypt/renewal/odysseytours.nz.conf


Cert is due for renewal, auto-renewing…
Plugins selected: Authenticator nginx, Installer nginx
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for odysseytours.nz
http-01 challenge for www.odysseytours.nz
nginx: [emerg] “server_names_hash_bucket_size” directive is duplicate in /etc/nginx/conf-enabled/server_names_hash_bucket_size.conf:1
Cleaning up challenges
Attempting to renew cert (odysseytours.nz) from /etc/letsencrypt/renewal/odysseytours.nz.conf produced an unexpected error: nginx restart failed:
b’’
b’’. Skipping.
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/odysseytours.nz/fullchain.pem (failure)


** DRY RUN: simulating ‘certbot renew’ close to cert expiry
** (The test certificates below have not been saved.)

All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/odysseytours.nz/fullchain.pem (failure)
** DRY RUN: simulating ‘certbot renew’ close to cert expiry
** (The test certificates above have not been saved.)


1 renew failure(s), 0 parse failure(s)

My web server is (include version):
Nginx 1.14

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

My hosting provider, if applicable, is:

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

According to grep there is no “duplicate” directive, it only appears once in my nginx files:

root@mail:~# grep -r server_names_hash_bucket_size /etc/nginx
/etc/nginx/conf-available/server_names_hash_bucket_size.conf:server_names_hash_bucket_size 64;

nginx isn’t complaining either:

root@mail:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

What is happening here?

1 Like

Have a read over https://github.com/certbot/certbot/issues/5199, it appears to be the same issue. Two workarounds are offered.

1 Like

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