FileNotFoundError with Certbot and Apache

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 install --cert-name

It produced this output: File: /etc/apache2/sites-available/le-redirect- - Could not be found to be deleted

  • Certbot probably shut down unexpectedly
    An unexpected error occurred:
    FileNotFoundError: [Errno 2] No such file or directory: '/etc/apache2/sites-available/le-redirect-'

My web server is (include version): apache2

The operating system my web server runs on is (include version): Linux ubuntu-g-2vcpu-8gb-lon1-01 5.4.0-126-generic

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 1.30.0

1 Like

Hi @saslamp, and welcome to the LE community forum :slight_smile:

That is a very strange error.

Let's have a look at:
certbot certificates
ls -l /etc/apache2/sites-available/
apachectl -t -D DUMP_VHOSTS


In addition to the above, I'm also interested in the contents of any configuration file in /etc/apache2/. To me it sounds like the Apache configuration files parser from Certbot chokes on some specific part of the configuration file where it tries to include a certain file which obviously can't exist.


Thanks for the response! And thanks for the welcome!

I managed to solve this. I added a le-redirect-https:/ folder, and in it I added an empty file, and it worked!
I don't know if that's the best solution, but my server is running now.

This is the response form certbot certificates:
Certificate Name:
Serial Number: 49588c06474c4d302171a7114ada3c6d863
Key Type: RSA
Expiry Date: 2022-12-24 15:30:47+00:00 (VALID: 89 days)
Certificate Path: /etc/letsencrypt/live/
Private Key Path: /etc/letsencrypt/live/

1 Like

It's probably a good idea to check all of your Apache configuration files for an incorrect include directive.


Far from it [I suspect].

Apache will run at all cost, so it doesn't say much if things appear to be working.


Hello @Osiris , I can't find any incorrect include directive in my conf files



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