Certbot not working to install SSL certificate

I’m following the instructions in Rasa Masterclass 11 to install an SSL certificate. I have set up a VM instance on Google Cloud Platform, established an SSH connection to the VM on command line, stopped the docker container, installed certbot, and run sudo certbot certonly. I’m getting the following error:

Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mydomain.com
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. mydomain.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://mydomain.com/.well-known/acme-challenge/XhXLE_fFQsdgArgWW3cnMVIlSxe2rU1i8E96p0pGbPg [00.000.000.000]: "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1,max"

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

   Domain: mydomain.com
   Type:   unauthorized
   Detail: Invalid response from
   http://mydomain.com/.well-known/acme-challenge/XhXLE_fFQsdgArgWW3cnMVIlSxe2rU1i8E96p0pGbPg
   [00.000.000.000]: "<!doctype html><html lang=\"en\"><head><meta
   charset=\"utf-8\"><meta name=\"viewport\"
   content=\"width=device-width,initial-scale=1,max"

   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.

(I edited out our url and ip address)

We’ve tried with three different URLs hosted on both Google Domains and Dreamhost.

Any ideas?

I’ve had the same kind of problems earlier.

Is your port 80 open and have you double checked that the domain type is A and the right ip?

Thanks @k1m! The domain type is A and the ip is correct. The domain is working for http:// , i.e. I can go to the domain to get to our Rasa X instance but it’s not secure.

How do I check if my port 80 is open?

Okay I fixed it with a big frustrating “turn it off and turn it back on again.”

I started a new VM instance in Google Cloud following the instructions in Rasa Masterclass Episode 9 (same as I had before). I then followed the same instructions from Rasa Masterclass Episode 11 to install the SSL and it worked this time.

Oh and for anyone who’s a n00b like me and was also wondering about opening port 80… I did forget to do that at one point and then remembered I had to close docker during the install, as explained in Episode 11.