An unexpected error occurred: FileExistsError: [Errno 17] File exists: '/etc/letsencrypt/archive/(domain)/privkey2.pem'

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. |, so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command: certbot certonly

It produced this output:

Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for
Waiting for verification...
Cleaning up challenges
An unexpected error occurred:
FileExistsError: [Errno 17] File exists: '/etc/letsencrypt/archive/'

My web server is (include version): 1: Spin up a temporary webserver (standalone)

The operating system my web server runs on is (include version): 4.15.0-143-generic #147-Ubuntu

My hosting provider, if applicable, is: DigitalOcean

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


Due to messing about, I'm currently being rate limited on the domain!

When I mv /etc/letsencrypt/archive/ /etc/letsencrypt/archive/

and re-ran with --dry-run, it appears to succeed, which I find surprising, because privkey2.pem is one of dozens of similarly named files in that dir.


--dry-run doesn't actually try to save any files.
I would suggest removing any certs that you don't need and then removing any that are having trouble and replacing them with a new one [AFTER THE RATE LIMITING HAS EXPIRED].

Start with:
certbot certificates


Welcome to the Let's Encrypt Community, Ben :slightly_smiling_face:

Along with what @rg305 requested, could you please include the output of this command?

sudo ls -lRa /etc/letsencrypt

Please put three backticks above and below the output, like this:



Hi rg305 and griffin,

Thanks for your suggestions! Unfortunately I realised that I was rate-limited for a WEEK, so wouldn't be able to complete the process wirth LE this time. I ended up buying a cert because I need the server for work today. :cry:

Context here is that I was using a tool which repeatedly, and silently, failed to renew the certs. I've learned an expensive lesson to pay a lot more attention to the status of my certs!

thanks again for the help

1 Like

That's unfortunate, as there are a few other free CA's next to Let's Encrypt out there.

Indeed. I was in a rush, and decided to spend $£ instead of time and braincycles. Unfortunate but it's done now!

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