mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-13 15:13:33 +01:00
Error: Challenge is invalid #457
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ronaldtveen on GitHub (Feb 4, 2020).
Any idea what's causing this error?
I'm trying to setup DNS-01 validation (wildcard, in the future) for my domain. Wanted to try and use Dehydrated in combination with Lexicon (Python DNS management script), which is described here:
https://www.aaflalo.me/2017/02/lets-encrypt-with-dehydrated-dns-01/
When I run it though, I get an error that the challenge is invalid. I masked my personal domain to example.com.
But when I look in my DNS records when the script is running I see this popping up:
This token is completely different from the token that Dehydrated shown me in the error in the end.
Right after the script the TXT record has been deleted by lexicon.
My
configMy
hooks.shAny idea what's going wrong here?
@lukas2511 commented on GitHub (Feb 5, 2020):
I see in your hook.sh that your cleanup routine is actually commented out. Does your DNS provider maybe only support one TXT record for some reason and there just is an old one in there that never gets replaced?
Other than that you could add a few echos to the hook-script to see what values are actually given to lexicon, just to make sure that there isn't anything fundamentally broken.
@ronaldtveen commented on GitHub (Feb 5, 2020):
I commented that out on purpose to not have it remove the record before I could check if it was the same as the token in the error, forgot to uncomment it here in the example.
I'll throw some echo's in later today and tinker with it and I'll report back when I know more.
@ronaldtveen commented on GitHub (Feb 5, 2020):
@lukas2511 I just double checked and TransIP does allow multiple TXT records, so that's not the problem. Also, the clean_challenge() is actually doing its job removing the record, but I've (again) commented that out to be able to check the token in the content of my TXT record that is added.
I threw some echo's in deploy_challenge(), they seem to be what you would expect.
The TXT record is added to my DNS with the correct token.
What I don't get is this part of the log:
The record is still in my DNS zone, and that is not that record that is logged out but the actual token:
_acme-challenge.sub 3600 TXT Ma0-0d3P0y7GJaMcTQKRiezm6IcfUnNA3uRBdbazzUA@lukas2511 commented on GitHub (Feb 6, 2020):
DNS entries usually take some time to propagate and caches have to be cleared. Does lexicon wait until the entry has been propagated to all servers? Also at least Let's Encrypt caches DNS entries for up to 5 minutes iirc, so if you try to run it quickly in succession it may fail because of that.
@jahir commented on GitHub (Feb 6, 2020):
FWIW, dedyn.io provides a certboot hook script, which I modified for dehydrated, to do just that: call the dns provider API and ask their (primary) dns server until the change is spread.
@ronaldtveen commented on GitHub (Feb 6, 2020):
Ahh yes, that made sense.
Adding a
sleep 60right after lexicon added the record was long enough of a buffer that the new record could be resolved by LetsEncrypt.Awesome guys, it’s all good now.