The error logs are unclear why anything went wrong.

The system also tries to copy a file that is not there if the LE generate failed. It should check if the file exists before attempting to copy it.

Here's a screenshot of the errors on a fresh install of hosting_https. Note I am running locally, so I didn't expect it to pass, but I wanted to see what it said.

error logs from hosting https letsencrypt module.

Also, we should try to avoid writing bad apache configs if the LE generate fails. Otherwise we can't restart apache at all!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jon Pugh created an issue. See original summary.

Jon Pugh’s picture

Title: Provide actionable error mesages. » Provide actionable error mesages when LetsEncrypt fails
Issue summary: View changes
Jon Pugh’s picture

After successfully enabling Hosting HTTPS lets encrypt and getting my site on https, I changed the domain aliases to ones that had no DNS setup yet, and the LE generation failed, causing the chain of errors with the missing file copy and finally a failing apache restart.

The regular logs don't say anything about why. You should output something from LE in the regular warning log so users can take action.

hosting https warning logs

colan’s picture

Status: Active » Needs review

The error logs are unclear why anything went wrong. The regular logs don't say anything about why. You should output something from LE in the regular warning log so users can take action.

This is caused by the damage from #2912540: Reduce the number of log messages shown to the user.. When I reverse it by displaying all log types, all of the LE details come back. We need to fix that one ASAP.

Also, we should try to avoid writing bad apache configs if the LE generate fails. Otherwise we can't restart apache at all!

Much of this was fixed in #2955062: Do not let nginx configuration reference missing cert files, but maybe we left out the Apache part. If so, let's rename and reopen until the Apache side is done.

Can we mark this one as a duplicate as the above two issues are / can be handled elsewhere?

Jon Pugh’s picture

You should include the "detail" from the JSON output so it would look like this:

Failed to generate Let's Encrypt certificates: Error creating new cert :: authorizations for these names not found or expired: x.thinkdrop.net

or

Failed to generate Let's Encrypt certificates: Invalid response from http://www.thinkdrop.net/.well-known/acme-challenge/fZyQ5VVTYoelRHgHqO17... \"\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\" dir=\"ltr\" prefix=\"content: http://purl.org/rss/1.0/modules/content/ dc: http://purl.org/dc/ter\"",

helmo’s picture

Status: Needs review » Needs work

The extra thing todo in this issue thats' not covered by the other two is to not to bother me that it failed to copy something when generating the cert failed in the first place.

helmo’s picture

Here's a first patch to atleast change the 'Failed to generate Let's Encrypt certificates.' message to an error and stop trying to copy.

helmo’s picture

Status: Needs work » Needs review
FileSize
1.96 KB

Changing the command output to warning level when we have a problem also help to alleviate the #2912540: Reduce the number of log messages shown to the user. issue.

  • helmo committed 8d8bf72 on 7.x-3.x
    Issue #2968497 by helmo, Jon Pugh, colan: Provide actionable error...
helmo’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.