Failed to obtain certificate

Hi folks, I have a couple of Hugo websites being served by Caddy already (they work properly). I am trying to create a copy of an existing Hugo website on my Caddy server, but at a different domain name (the previous version was for testing purposes). This domain name was previously pointing at a Weebly site, but I changed the nameservers to point at my webserver this afternoon.

When visiting my new website I am successfully connecting to my webserver (i.e. DNS is giving me the correct IP address), but receiving a 404 message:

404 Site www.robertmcfaddenmd.com is not served on this interface

I used “sudo journalctl -u caddy” to see what errors I can see, and here is the relevant part of the log:

Apr 19 18:02:56 caprice systemd[1]: Reloaded Caddy HTTP/2 web server.
Apr 19 18:02:56 caprice caddy[3358]: 2018/04/19 18:02:56 [INFO][robertmcfaddenmd.com] acme: Obtaining bundled SAN certificate
Apr 19 18:02:57 caprice caddy[3358]: 2018/04/19 18:02:57 [INFO][robertmcfaddenmd.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/ixuGQnHHrb8SCPqIB5tF57C2D8O5IqnSqCRyRxo4Zf8
Apr 19 18:02:57 caprice caddy[3358]: 2018/04/19 18:02:57 [INFO][robertmcfaddenmd.com] acme: Authorization already valid; skipping challenge
Apr 19 18:02:57 caprice caddy[3358]: 2018/04/19 18:02:57 [INFO][robertmcfaddenmd.com] acme: Validations succeeded; requesting certificates
Apr 19 18:02:58 caprice caddy[3358]: 2018/04/19 18:02:58 [INFO][robertmcfaddenmd.com] Server responded with a certificate.
Apr 19 18:02:58 caprice caddy[3358]: 2018/04/19 18:02:58 [ERROR] SIGUSR1: [robertmcfaddenmd.com] failed to obtain certificate: acme: Error → One or more domains had a problem:

This is driving me nuts because it says “One or more domains had a problem:” but does not say what the problem is!!! How can I see a more detailed error message?

Also, what is going wrong and how can I make my website work? :confused: Looking at the Let’s Encrypt AuthURL, it appears to be seeing the correct IP address, so I don’t think the problem is that DNS hasn’t updated to point at my webserver yet.

UPDATE: Forgot to include my Caddyfile, here it is:

robertmcfaddenmd.com, www.robertmcfaddenmd.com {
  root /srv/robertmcfaddenmd.com/public  # the folder where Hugo generates the website
  hugo /srv/robertmcfaddenmd.com /admin
  redir 301 {
    if {host} starts_with robertmcfaddenmd.com
    / https://www.robertmcfaddenmd.com{uri}
  }
  expires {
    match .png$ 1y # expires png files after one year
    match .jpg$ 1y # expires jpg files after one year
    match .html$ 5i30s # expires html files after 5 minutes 30 seconds
    match .css  1y # expires css files
  }
  gzip
  errors {
    404 404.html # Not Found
  }
}

That bug is being tracked here: https://github.com/mholt/caddy/issues/2124

2 Likes

I have updated to Caddy 0.10.14 but I am still experiencing the exact same problem. I’m running Ubuntu 16.04.4 LTS on Linode.

Please try running Caddy without systemd and tell us if the problem still exists (and show execution of the command along with all log output).

My bad, you were right. When I ran caddy on the command line, everything worked fine. (Then I ran it through systemd again, and I was rate limited. So I copied over the certificate from my home directory and then it worked fine in systemd.) Thank you for your help!

1 Like

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