Closed timbrd closed 4 years ago
Hey @timbrd! Thanks for reporting.
I think that HTTP 401 means there is something wrong with the API token. Probably a copy and paste error? I could only reproduce by using an invalid token (removed the last char of the API token).
However, I agree the error message is not useful. Will change this in the next version.
I added a handler for 401 unauthorized errors. Now, you can see the message from the API why your request was rejected. I hope this helps.
Error: Error getting zone state. Error getting zone example.com: API return 401 Unauthorized with message: 'Invalid authentication credentials'. Double check your API key is still valid
on .terraform/modules/server/main.tf line 7, in data "hetznerdns_zone" "dns_zone":
7: data "hetznerdns_zone" "dns_zone" {
Hi,
I'm trying to set some dns records, which works well when being asked for my API Token by terraform, but I always get a 401 error when using the
HETZNER_DNS_API_TOKEN
environment variable.Any idea why the error occurs? How am I supposed to debug the problem?
Thanks, Tim