Error getting validation data

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: mail.jv80.se

I ran this command:
certbot certonly --webroot -w /var/www/html -d mail.jv80.se

It produced this output:
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: mail.jv80.se
Type: connection
Detail: 156.67.80.139: Fetching http://mail.jv80.se/.well-known/acme-challenge/kcJS-xWQAftZW7V6e7oWPVs9RE9mul8kMq5M3XMqF38: Error getting validation data

My web server is (include version):
nginx 1.8
The operating system my web server runs on is (include version):
Ubuntu 22.04
My hosting provider, if applicable, is:

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):
1.21.1

I have used this command without a problem many times on this mail server. I normally get certs for 7 domains using one name. But this time when I added the new domain I got this error on all domains. Error getting application data. Nothing has changed on the server and I have tested that port 80 is open

Please advise

1 Like

Let's Debug indicates that the webserver on that host does not respond to requests. I recommend starting by fixing that.

4 Likes

Well the whole string is sudo certbot certonly --webroot --agree-tos -d mail.mxmail.pro,mail.mxmail.se,webmail.mxmail.se,mail.ktimatheophanous.com.cy,mail.pissouri.org,mail.mediasafe.pro,mail.jv80.se --cert-name mail.mxmail.pro --email anders@mxmail.pro -w /var/www/html
If I take away mail.jv80.se from the string it works. All domains are on the same mail server
And if I ping it it responds

That still points to you needing to fix the webserver that needs to respond to the HTTP-01 challenge for mail.jv80.se. Do you have a virtual host configured for that name?

2 Likes

No only for jv80.se

But when I test all maildomains with lets debug I get the same error

Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: mail.jv80.se
Type: connection
Detail: 156.67.80.139: Fetching http://mail.jv80.se/.well-known/acme-challenge/vWcou9xKvxtS4oxUiKG68tDYA2gfsPaw8URamMe5wDM: Error getting validation data

Domain: mail.mediasafe.pro
Type: connection
Detail: 156.67.80.139: Fetching http://mail.mediasafe.pro/.well-known/acme-challenge/ssGbudsY3cTYmgl0DoML3I84IB28JGz7cx5EZrCKQhw: Error getting validation data

Domain: mail.mxmail.pro
Type: connection
Detail: 156.67.80.139: Fetching http://mail.mxmail.pro/.well-known/acme-challenge/FcxO4iSlpRE9EpH3eHis4zxPtOpm9TMCR0_1AkKfDug: Error getting validation data

Domain: mail.mxmail.se
Type: connection
Detail: 156.67.80.139: Fetching http://mail.mxmail.se/.well-known/acme-challenge/BdZgXMtTYmShpG-9wYX0wHVvQp9kl4qB7rZ3UqKBYHs: Error getting validation data

Domain: webmail.mxmail.se
Type: connection
Detail: 156.67.80.139: Fetching http://webmail.mxmail.se/.well-known/acme-challenge/VKjiVRA0fIYjxHoCKaaZESQ6K9E1d2h0OPI9S9ESv4Y: Error getting validation data

If you expect to obtain a certificate for mail.jv80.se using an HTTP-01 challenge you are going to need a functioning VirtualHost for that name in your nginx configuration.

Edit: Apache -> nginx

2 Likes

In my nginx config. The emailserver has been running for a year with 6 domains and renewed certs without problem. Nothing has changed. So I dont understand what has happened

Clearly something has changed or you would be obtaining a certificate instead of an error.

The symptoms don't really indicate this as the cuase, but it might be worth asking anyway. Do you employ any geo-blocking?

2 Likes

No I dont.
I am new to nginx

Does this has any value

certbot: error: unrecognized arguments: /var/www/html

Without any additional context, that message is not terribly useful. I've got nothing else for you at the moment. Hang tight and see if another volunteer has anything else for you.

1 Like

I now have a changed error
The debug is now green
But I get this on all domains

Domain: mail.mediasafe.pro
Type: unauthorized
Detail: 156.67.80.139: Invalid response from http://mail.mediasafe.pro/.well-known/acme-challenge/NcN3oPstYoe89sdV6yXbnd74czIYm8QAzj7AL25-XGg: 404

Was that the command you originally used to get the cert for that domain?

Can you show the contents of this file

/etc/letsencrypt/renewal/mail.jv80.se.conf

The 404 in the error means the webroot path you gave to Certbot does not match what nginx is using for http requests to that domain.

2 Likes

There is no such file in that folder. And this error is will all 6 domains

the webroot is /var/www/html ? This folder is empty exept a index.html

The original command
sudo certbot certonly --webroot --agree-tos -d mail.mxmail.pro,mail.mxmail.se,webmail.mxmail.se,mail.ktimatheophanous.com.cy,mail.pissouri.org,mail.mediasafe.pro,mail.jv80.se --cert-name mail.mxmail.pro --email anders@mxmail.pro -w /var/www/html

In the renewal folder is only the conf file for the cert for 6 domains

Sorry, what does this show

certbot certificates

Can you show full output of this? It will be very long

sudo nginx -T

Uppercase T is essential
Even redirect that to a file and upload file like

sudo nginx -T >config.txt
2 Likes

Would you show contents of that?

1 Like

config.txt (24.2 KB)

mail.mxmail.pro.conf.txt (597 Bytes)

You do not have a server block for mail.jv80.se listening on port 80.

So, nginx would use the default for that domain name. In your config it is the first server block for port 80 which is this one

# configuration file /etc/nginx/sites-enabled/00-default.conf:
#
# Note: This file must be loaded before other virtual host config files,
#
# HTTP
server {
    listen 80;
    server_name _;
}

Note there is no root folder specified. In which case nginx uses its default of html. Which of course is not what you told Certbot and is probably not a valid folder on your system.

So, that explains why this does not work.

Fixing it is a different problem. Your nginx config is confusing.

I am not sure what you are trying to achieve in this config. You have a config file named for mail.mediasafe.pro (and for mail.jv80.se) but the server_names in those config files are not that domain name (it is the apex name instead). The name of the file does not have to match the server_name but it looks like you intended to match them and never did.

This server block won't be used for mail.mediasafe.pro requests (your default server block above will be).

# configuration file /etc/nginx/sites-enabled/mail.mediasafe.pro.conf:

# HTTP
server {
    # Listen on ipv4
    listen 80;
    #listen [::]:80;

    server_name mediasafe.pro;

    # Redirect all insecure http:// requests to https://
    return 301 https://$host$request_uri;
}

If you do not know how to proceed I maybe could walk you through fixing it. But, I don't know that I'll have that much time. I would need to see output of this too

sudo certbot certificates
1 Like