[Solved] No such file or directory: ..../public/

My domain is: ln.heartshine.xyz

I ran this command: sudo certbot renew

It produced this output:

Processing /etc/letsencrypt/renewal/ln.heartshine.xyz.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for ln.heartshine.xyz
Cleaning up challenges
Encountered exception during recovery:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 75, in handle_authorizations
    resp = self._solve_challenges(aauthzrs)
  File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 132, in _solve_challenges
    resp = self.auth.perform(all_achalls)
  File "/usr/lib/python3/dist-packages/certbot/plugins/webroot.py", line 83, in perform
    self._create_challenge_dirs()
  File "/usr/lib/python3/dist-packages/certbot/plugins/webroot.py", line 172, in _create_challenge_dirs
    stat_path = os.stat(path)
FileNotFoundError: [Errno 2] No such file or directory: '/var/www/ln.heartshine.xyz/pubic/'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/certbot/error_handler.py", line 108, in _call_registered
    self.funcs[-1]()
  File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 316, in _cleanup_challenges
    self.auth.cleanup(achalls)
  File "/usr/lib/python3/dist-packages/certbot/plugins/webroot.py", line 224, in cleanup
    os.remove(validation_path)
FileNotFoundError: [Errno 2] No such file or directory: '/var/www/ln.heartshine.xyz/pubic/.well-known/acme-challenge/x2F1-cOAaDjOWrf45DuQqGdZr4zoXIFitR1Bph0M7D4'
Attempting to renew cert (ln.heartshine.xyz) from /etc/letsencrypt/renewal/ln.heartshine.xyz.conf produced an unexpected error: [Errno 2] No such file or directory:'/var/www/ln.heartshine.xyz/pubic/'. Skipping.

My web server is: nginx 1.10.3

The operating system my web server runs on is: Debian 9.8 (stretch)

I can login to a root shell on my machine: yes, via sudo

I’m using a control panel to manage my site: no

The version of my client is: 0.28.0


Here’s the thing: the /public directory most definitely exists (it must, since it’s the actual root of my server). My nginx config is below.

server {
        listen 80;
        listen [::]:80;
        server_name ln.heartshine.xyz;
        return 301 https://ln.heartshine.xyz$request_uri;
}
server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name ln.heartshine.xyz;
        ssl_certificate /etc/letsencrypt/live/ln.heartshine.xyz/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/ln.heartshine.xyz/privkey.pem;
        ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
        ssl_dhparam /etc/nginx/ssl/dhparam.pem;
        ssl_protocols TLSv1.1 TLSv1.2;
        root /var/www/ln.heartshine.xyz/public;
        index index.php index.html;

        location / {
                try_files $uri $uri/ /index.php$is_args$args
;
        }
        location ~ \.php$ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass  php-handler;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root $fastcgi_script_name;
                fastcgi_param HTTP_HOST $server_name;
    }
}

I tried manually creating a file in .well-known, which you can access here: file deleted

I don’t know where else to go.

Hi @EmberHeartshine

looks like a simple typo in your config file. There is /pubic/ - not /public/.

But your configuration is wrong - https://check-your-website.server-daten.de/?q=ln.heartshine.xyz

Domainname Http-Status redirect Sec. G
http://ln.heartshine.xyz/
104.31.88.230 301 https://ln.heartshine.xyz/ 0.227 A
http://ln.heartshine.xyz/
104.31.89.230 301 https://ln.heartshine.xyz/ 0.123 A
http://ln.heartshine.xyz/
2606:4700:30::681f:58e6 301 https://ln.heartshine.xyz/ 0.233 A
http://ln.heartshine.xyz/
2606:4700:30::681f:59e6 301 https://ln.heartshine.xyz/ 0.120 A
https://ln.heartshine.xyz/
104.31.88.230 302 https://www.google.com/ 0.544 B
https://ln.heartshine.xyz/
104.31.89.230 302 https://www.google.com/ 0.220 B
https://ln.heartshine.xyz/
2606:4700:30::681f:58e6 302 https://www.google.com/ 0.533 B
https://ln.heartshine.xyz/
2606:4700:30::681f:59e6 302 https://www.google.com/ 0.516 B
https://www.google.com/ 200 0.520 B
If you can see this, you need to enable JavaScript!
104.31.88.230 301 If you can see this, you need to enable JavaScript! 0.220 A
Visible Content: 301 Moved Permanently nginx/1.10.3
If you can see this, you need to enable JavaScript!
104.31.89.230 301 If you can see this, you need to enable JavaScript! 0.230 A
Visible Content: 301 Moved Permanently nginx/1.10.3
If you can see this, you need to enable JavaScript!
2606:4700:30::681f:58e6 301 If you can see this, you need to enable JavaScript! 0.223 A
Visible Content: 301 Moved Permanently nginx/1.10.3
If you can see this, you need to enable JavaScript!
2606:4700:30::681f:59e6 301 If you can see this, you need to enable JavaScript! 0.120 A
Visible Content: 301 Moved Permanently nginx/1.10.3
If you can see this, you need to enable JavaScript! 302 https://www.google.com/ 0.520 A
Visible Content: Redirecting to https://www.google.com/ .

You have redirects to google.com, that can't work. Looks like a test or something else.

1 Like

That is the configuration for polr, the shortlink utility hosted at that address. The redirects to Google at the root are correct. If there is more information after the uri (i.e. the shortlink string), it will not redirect.

This was the fix, thanks. I have no idea how that got changed (I’ve never edited my confs before), but it worked.

2 Likes

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