Closed ldez closed 2 months ago
Ping @ldez have a bit of trouble here
steps: cloned https://github.com/ldez/lego.git
cd ./lego
make build
rm -rf .lego
LIMACITY_API_KEY=yyyy \
./dist/lego -m your@email.com --dns limacity -d *.example.com -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run
and got
2024/08/27 14:17:56 No key found for account my@email.com. Generating a P256 key.
2024/08/27 14:17:56 Saved key to /home/me/Downloads/lego/.lego/accounts/acme-staging-v02.api.letsencrypt.org/my@email.com/keys/my@email.com.key
2024/08/27 14:17:57 unrecognized DNS provider: limacity
please let me know if i did something wrong because i dont see it xD
also double checked the api key and its registered as dns.admin, domain.admin
Do you check out my branch?
git switch feat/lima-city
oh wow yeah i kinda never realized that taking the clone url on github doesnt actually give you the branch youre checking out in the browser... sorry for that
idk what this error unable to unmarshal response exactly means but it looks like the json error cannot unmarshal number into go struct field is the underlying one right?
to clarify the values that i redacted
id
: some integer in the range of the 20000mode
: stringtld
: stringdomain
: stringin_subscription
: boolauto_renew
: boolstatus
: string?unicode_fqdn
: stringregistered
at: dateregistered
until: daterenew_price
: floathope that helps
I fixed the problem, can you try again?
2024/08/27 15:07:38 Could not obtain certificates:
error: one or more domains had a problem:
[*.example.com] [*.example.com] acme: error presenting token: limacity: add record: unexpected status code: [status code: 400] body: {"status":400,"error":"Bad Request"}
[example.com] [example.com] acme: error presenting token: limacity: add record: unexpected status code: [status code: 400] body: {"status":400,"error":"Bad Request"}
whats the deal with error presenting token?
I fixed the problem, can you try again?
almost got it xD
so what i checked in addition.
the entries in the provider dashboard are txt records directly registered with example.com
but as i understand should be _acme-challenge.example.com
why idk tho...
btw thank you for showing me that 3x ` creates code blocks
I think it's a propagation issue, can you try to add LIMACITY_PROPAGATION_TIMEOUT=120
(for 2 minutes)?
LIMACITY_PROPAGATION_TIMEOUT=120 LIMACITY_API_KEY=<api-key> ./dist/lego -m my@email.com --dns limacity -d *.example.com -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run
Wait there is also a type error, I will fix that.
shouldnt they be under _acme-challenge.example.com
?
FYI I wrote the implementation only based on the API doc, which contains no explanation of what exactly is an endpoint, some endpoints are missing, and the schema can be wrong.
For example, the JSONSchema inside the API documentation says that:
status
-> stringerrors
-> objectFrom your logs:
{"status":400,"error":"Bad Request"}
status
-> integererror
-> stringAnother example is the endpoint to get records:
id
-> string
From your logs:
id
-> int
I think that Lima City should improve its API and its documentation.
fully agree xD
thank you for doing all that work hope you like coffee ;)
I fixed all the ID types, let's go try again :smile:
Another example, with the endpoint to add records:
{
"required": ["nameserver_record"],
"type": "object",
"properties": {
"nameserver_record": {
"required": ["content", "name", "subdomain", "ttl", "type"],
"type": "object",
"properties": {
"name": {"type": "string", "example": "example.com"},
"type": {"type": "string", "example": "NS"},
"content": {"type": "string", "example": "ns1.lima-city.de"},
"ttl": {"type": "integer", "example": 3600},
"priority": {"type": "string", "example": "10"}
}
}
}
}
required
says "content", "name", "subdomain", "ttl", "type"
but subdomain
is not defined inside the properties...
I don't know if subdomain
really exists, and how it works.
So I'm sorry to be forced to do this try-and-fix cycle.
WTF, from your logs:
{"records":[.................,{"id":2******,"name":"example.com","subdomain":false,"type":"TXT","content":"\"w**************\"","priority":null,"ttl":3600},{"id":2*****,"name":"example.com","subdomain":false,"type":"TXT","content":"\"1*****************\"","priority":null,"ttl":3600}]}
subdomain
is a boolean???
yes it looks like its a boolean
testing didnt work rn either.
i still get entries at lima-city registered under example.com
not _acme-challenge.example.com
as should be therefore the check for the txt value fails ig?
in addition to that i tested editing the entry to _acme-challenge.example.com and kept the value the same. all while the script was in its wait interval but still no luck
I tried something to fix the subdomain, but I don't know if it's the right approach :shrug:
still no certs ...
but we have a partial success...
i now get txt-records with _acme-challenge.example.com
and the correct value as logged in terminal
logs to come
so i guess subdomain is no bool... but if empty uses false instead of something more natural like null...
This is a classic with API created with dynamic language (I guess it's PHP): the typing is random and the schema is a fairytale.
I changed the type of subdomain once again
whats confusing is the multiple records. they indicate txt not being deleted correctly? and it seems only the old ones are being found so ill try with propagation delay of 120 too
i did a followup dig to get the txt records... and theyre the old ones from the test before...
so what i just tested was
if there is multiple entries with name _acme-challenge.example.com and different txt values like
_acme-challenge.example.com "23454453" _acme-challenge.example.com "56544563" _acme-challenge.example.com "34578756"
dig will show all 3 of them lego will also get all 3 of them as part of the json response body
but will pick the first one instead of trying all 3 to find a match
dig will show all 3 of them lego will also get all 3 of them as part of the json response body
but will pick the first one instead of trying all 3 to find a match
If dig
shows the 3 entries, Let's Encrypt and lego will show the 3 entries.
The problem here is more of a DNS propagation issue: Lima city seems very slow to propagate DNS changes to all the DNS.
The NS used by LE and different than your local resolvers, so the propagation problem can be hidden.
You can use some online tools to check that:
whats confusing is the multiple records. they indicate txt not being deleted correctly?
lego creates all the TXT records before all the challenges and deletes them at the end. So it's expected to have multiple records.
Can you try to add a custom resolver:
LIMACITY_API_KEY=xxxx --dns.resolvers="1.1.1.1:53" ./dist/lego -m my@email.com --dns limacity -d *.example.com -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run
Can you try to add a custom resolver:
LIMACITY_API_KEY=xxxx --dns.resolvers="1.1.1.1:53" ./dist/lego -m my@email.com --dns limacity -d *.example.com -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run
im sorry but it tells me
--dns.resolvers=1.1.1.1:53: command not found
i checked ./dist/lego --help and found --dns.resolvers ???? what???
Sorry wrong copy-pasting:
LIMACITY_API_KEY=xxxx ./dist/lego -m my@email.com --dns.resolvers="1.1.1.1:53" --dns limacity -d *.example.com -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run
lol makes sense sorry xD
thank you for helping me getting certs via api working... been waiting for years...
its really annoying without and sadly the price i bought the domain was to good to change provider... xD
I reduced the TTL, I hope this change + the custom resolver will fix the problem.
log with the custom resolver but still old ttl
Can you try to also add LIMACITY_PROPAGATION_TIMEOUT=240
LIMACITY_PROPAGATION_TIMEOUT=240 LIMACITY_API_KEY=the-key ./dist/lego -m my@email.com --dns.resolvers="1.1.1.1:53" --dns limacity -d *.example.com -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run
We can see in your log that the propagation is very slow.
:thinking: you send me the same logs as your previous comment (with a type error about subdomain and the same TXT records) but I removed the field subdomain
.
🤔 you send me the same logs as your previous comment (with a type error about subdomain and the same TXT records)
the old txt records dont get deleted. as i tried to say earlier.
when verifying the dns challenge lego picks up all the existing records. and doesnt "search" but seemingly simply take the 1. one available. an old value by then...
idk if that really is intended behaviour as i wouldnt expect that.
get records: unable to unmarshal response: [status code: 200] body: {"records":[.................,{"id":2951592,"name":"_acme-challenge.cloud.my.example.com","subdomain":"_acme-challenge.cloud.my","type":"TXT","content":"\"sDVJve7ohh6DY3iwWlMSe_mzE6iln-mUA3-3JR9nPeo\"","priority":null,"ttl":3600},{"id":2951595,"name":"_acme-challenge.example.com","subdomain":"_acme-challenge","type":"TXT","content":"\"eoYGntbIffR0n4MNpUMT4R5tB5ZlTIwdaJXZjPsGHZo\"","priority":null,"ttl":3600},{"id":2951596,"name":"_acme-challenge.example.com","subdomain":"_acme-challenge","type":"TXT","content":"\"z4ZKAwSHRZrDcETI-PCwQNS__5pF4UBU732OhQkdqCs\"","priority":null,"ttl":3600}]} error: json: cannot unmarshal bool into Go struct field Record.records.subdomain of type string
I removed the field subdomain so the error is impossible. Have you pulled my changes and compiled them?
get records: unable to unmarshal response: [status code: 200] body: {"records":[.................,{"id":2951592,"name":"_acme-challenge.cloud.my.example.com","subdomain":"_acme-challenge.cloud.my","type":"TXT","content":"\"sDVJve7ohh6DY3iwWlMSe_mzE6iln-mUA3-3JR9nPeo\"","priority":null,"ttl":3600},{"id":2951595,"name":"_acme-challenge.example.com","subdomain":"_acme-challenge","type":"TXT","content":"\"eoYGntbIffR0n4MNpUMT4R5tB5ZlTIwdaJXZjPsGHZo\"","priority":null,"ttl":3600},{"id":2951596,"name":"_acme-challenge.example.com","subdomain":"_acme-challenge","type":"TXT","content":"\"z4ZKAwSHRZrDcETI-PCwQNS__5pF4UBU732OhQkdqCs\"","priority":null,"ttl":3600}]} error: json: cannot unmarshal bool into Go struct field Record.records.subdomain of type string
I removed the field subdomain so the error is impossible. Have you pulled my changes and compiled them?
i wouldve said so but i pulled again and tested while we were discussing this. now theyre gone. im sorry for that mistake
LIMACITY_PROPAGATION_TIMEOUT=240 LIMACITY_API_KEY=the-key ./dist/lego -m my@email.com --dns.resolvers="1.1.1.1:53" --dns limacity -d *.example.com -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run
2024/08/27 17:53:24 [INFO] [*.example.com, example.com] acme: Obtaining bundled SAN certificate
2024/08/27 17:53:25 [INFO] [*.example.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13758833383
2024/08/27 17:53:25 [INFO] [example.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13758833393
2024/08/27 17:53:25 [INFO] [*.example.com] acme: use dns-01 solver
2024/08/27 17:53:25 [INFO] [example.com] acme: Could not find solver for: tls-alpn-01
2024/08/27 17:53:25 [INFO] [example.com] acme: Could not find solver for: http-01
2024/08/27 17:53:25 [INFO] [example.com] acme: use dns-01 solver
2024/08/27 17:53:25 [INFO] [*.example.com] acme: Preparing to solve DNS-01
2024/08/27 17:53:25 [INFO] [example.com] acme: Preparing to solve DNS-01
2024/08/27 17:53:25 [INFO] [*.example.com] acme: Trying to solve DNS-01
2024/08/27 17:53:25 [INFO] [*.example.com] acme: Checking DNS record propagation. [nameservers=1.1.1.1:53]
2024/08/27 17:53:27 [INFO] Wait for propagation [timeout: 4m0s, interval: 2s]
2024/08/27 17:53:27 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
........................
2024/08/27 17:57:26 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2024/08/27 17:57:28 [INFO] [example.com] acme: Trying to solve DNS-01
2024/08/27 17:57:28 [INFO] [example.com] acme: Checking DNS record propagation. [nameservers=1.1.1.1:53]
2024/08/27 17:57:30 [INFO] Wait for propagation [timeout: 4m0s, interval: 2s]
2024/08/27 17:57:30 [INFO] [example.com] acme: Waiting for DNS record propagation.
..........................
2024/08/27 18:01:29 [INFO] [example.com] acme: Waiting for DNS record propagation.
2024/08/27 18:01:31 [INFO] [*.example.com] acme: Cleaning DNS-01 challenge
2024/08/27 18:01:31 [WARN] [*.example.com] acme: cleaning up failed: limacity: TXT record not found
2024/08/27 18:01:31 [INFO] [example.com] acme: Cleaning DNS-01 challenge
2024/08/27 18:01:32 [WARN] [example.com] acme: cleaning up failed: limacity: TXT record not found
2024/08/27 18:01:33 [INFO] Deactivating auth: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13758833383
2024/08/27 18:01:33 [INFO] Deactivating auth: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13758833393
2024/08/27 18:01:34 Could not obtain certificates:
error: one or more domains had a problem:
[*.example.com] propagation: time limit exceeded: last error: NS ns2.lima-city.de. did not return the expected TXT record [fqdn: _acme-challenge.example.com., value: zN4C1IUu7xIlVDQxUR9DlwoWUzcrpem6H0IQTgW-ZNk]: eoYGntbIffR0n4MNpUMT4R5tB5ZlTIwdaJXZjPsGHZo ,z4ZKAwSHRZrDcETI-PCwQNS__5pF4UBU732OhQkdqCs
[example.com] propagation: time limit exceeded: last error: NS ns1.lima-city.de. did not return the expected TXT record [fqdn: _acme-challenge.example.com., value: bIqi02y0IBJUHjT0ftxbXDdEcV8JwCTtK2KloGY8nxQ]: eoYGntbIffR0n4MNpUMT4R5tB5ZlTIwdaJXZjPsGHZo ,z4ZKAwSHRZrDcETI-PCwQNS__5pF4UBU732OhQkdqCs
Edit: at this point there are these txt records listed:
_acme-challenge.example.com TXT "eoYGntbIffR0n4MNpUMT4R5tB5ZlTIwdaJXZjPsGHZo" 3600
_acme-challenge.example.com TXT "z4ZKAwSHRZrDcETI-PCwQNS__5pF4UBU732OhQkdqCs" 3600
_acme-challenge.example.com TXT "_UvhbeDmxqoK7IPWNSE-PtnP3W7aw4B6ZXlgQllojiI" 60
_acme-challenge.example.com TXT "Op4Yrsf98RU_2Uh4s2OfkMEDVnvhCpCu-VKkR_hyd54" 60
_acme-challenge.example.com TXT "zN4C1IUu7xIlVDQxUR9DlwoWUzcrpem6H0IQTgW-ZNk" 60
_acme-challenge.example.com TXT "bIqi02y0IBJUHjT0ftxbXDdEcV8JwCTtK2KloGY8nxQ" 60
_acme-challenge.example.com TXT "zN4C1IUu7xIlVDQxUR9DlwoWUzcrpem6H0IQTgW-ZNk" 60
_acme-challenge.example.com TXT "bIqi02y0IBJUHjT0ftxbXDdEcV8JwCTtK2KloGY8nxQ" 60
Can you remove all the existing TXT records for _acme-challenge.example.com.
?
I fixed a problem with the TXT record cleaning.
all records deleted confirmed with dig and online dns checker pulled changes buid rm -rf ./dist/.lego and request started...
takes only about 8 mins again... xD
more than 8 minutes after your previous comment, I feel like it still doesn't work...
[x] be able to do: (and put the output of this command to a comment)
Note the wildcard domain is important.
go mod tidy
Ping @feroxib, can you run the command (with your domain, email, and credentials)?
-> https://github.com/go-acme/lego/pull/2248?notification_referrer_id=NT_kwDOAFaWm7MxMjEyOTYwOTE0Nzo1Njc0NjUx#issuecomment-2319212961
Closes #2247