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. 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: budeshi.ng

I ran this command: certbot install --cert-name budeshi.ng

It produced this output: File: /etc/apache2/sites-available/le-redirect-https://budeshi.ng.conf - 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-https://budeshi.ng.conf'

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

3 Likes

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.

4 Likes

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 budeshi.ng.conf 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: budeshi.ng
Serial Number: 49588c06474c4d302171a7114ada3c6d863
Key Type: RSA
Domains: budeshi.ng
Expiry Date: 2022-12-24 15:30:47+00:00 (VALID: 89 days)
Certificate Path: /etc/letsencrypt/live/budeshi.ng/fullchain.pem
Private Key Path: /etc/letsencrypt/live/budeshi.ng/privkey.pem

1 Like

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

3 Likes

Far from it [I suspect].

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

3 Likes

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

 

3 Likes

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