Lets Encrypt failed to issue certificate - The client lacks sufficient authorization

I’ve created a second virtualserver with root login and enabled SSL website option. The domain is pointed to the server and website is working fine on http. Now when I go to Server Configuration > Manage SSL Certificate and choose Lets Encrypt option, I get the following error:

Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator webroot, Installer None Obtaining a new certificate Performing the following challenges: http-01 challenge for gurgaonvivah.com http-01 challenge for www.gurgaonvivah.com Using the webroot path /home/gurgaonvivah/public_html for all unmatched domains. Waiting for verification... Cleaning up challenges Unable to clean up challenge directory /home/gurgaonvivah/public_html/.well-known/acme-challenge Failed authorization procedure. www.gurgaonvivah.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.gurgaonvivah.com/.well-known/acme-challenge/ITAirT1fZtKOdFBzHBSjr87o3Epr3OwTGj4v8R6eNgs: " 404 Not Found

Not Found

<p", gurgaonvivah.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://gurgaonvivah.com/.well-known/acme-challenge/X6MCR-jx5JQrDDrNCc5zPXhvViLQ13HAl_viRNchZc0: " 404 Not Found

Not Found

<p" IMPORTANT NOTES: - The following errors were reported by the server:

Domain: www.gurgaonvivah.com
Type: unauthorized
Detail: Invalid response from
http://www.gurgaonvivah.com/.well-known/acme-challenge/ITAirT1fZtKOdFBzHBSjr87o3Epr3OwTGj4v8R6eNgs:
"

404 Not Found

Not Found

<p"

Domain: gurgaonvivah.com
Type: unauthorized
Detail: Invalid response from
http://gurgaonvivah.com/.well-known/acme-challenge/X6MCR-jx5JQrDDrNCc5zPXhvViLQ13HAl_viRNchZc0:
"

404 Not Found

Not Found

<p"

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.

When I look at the file manager I see the directories have been created but there’s no file in acme-challenge/ directory. What can I do to fix this problem?

It tells you the possible solution to this at the end of the error message: If you just registered a domain and also setup the vps in virtualmin this can happen, since it takes it time to connect a new domain to the internet. Depending on your registrar, your nameservers and your tld it can take up several hours, in some cases even 24 hrs.

Make sure, you entered the correct IP address for your domain and the domainname both in the DNS and your VPS are correct. If that is ok, then just wait a while and retry later.

Best