Certbot fails to save files for very long domain names

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. crt.sh | 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: 3.141592653589793238462643383279502884197169399375105820974944592.307816406286208998628034825342117067982148086513282306647093844.609550582231725359408128481117450284102701938521105559644622948.954930381964428810975665933446128475648233786.783165271.xyz

I ran this command: sudo certbot --apache

It produced this output:

Requesting a certificate for 3.141592653589793238462643383279502884197169399375105820974944592.307816406286208998628034825342117067982148086513282306647093844.609550582231725359408128481117450284102701938521105559644622948.954930381964428810975665933446128475648233786.783165271.xyz
An unexpected error occurred:
OSError: [Errno 36] File name too long: '/etc/letsencrypt/renewal/3.141592653589793238462643383279502884197169399375105820974944592.307816406286208998628034825342117067982148086513282306647093844.609550582231725359408128481117450284102701938521105559644622948.954930381964428810975665933446128475648233786.783165271.xyz.conf'
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

My web server is (include version): Apache 2.4.58

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

My hosting provider, if applicable, is: N/A

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 3.0.1

Due to the Linux filename length limit of 255 bytes, and the DNS name limit of 253 bytes, some very long domain names cannot realistically be used as filenames. On one hand, this is a silly problem that should only really affect you if you're doing something inherently stupid (like I am). On the other hand, Certbot should maybe support generating certificates for any domain?

1 Like

Use --cert-name to set a valid name.

5 Likes

Fantastic, thank you!

3 Likes

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