Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: failed to read DNS record entries for domain somedomain.nl: could not get token from authenticator: error requesting token: The label 'gotransip-client-1631305153' is already used in another active access token. #44

Closed
Jille opened this issue Sep 10, 2021 · 9 comments

Comments

@Jille
Copy link
Contributor

Jille commented Sep 10, 2021

I'm trying to use terraform-provider-transip to add a few DNS records to my domain, but I'm getting this error:

Error: failed to read DNS record entries for domain somedomain.nl: could not get token from authenticator: error requesting token: The label 'gotransip-client-1631305153' is already used in another active access token.

If I run it again, I get the same error with another timestamp in the label.

I'm trying to add 4 domain names at once, and I'm getting this error 3 times. None of them are added to DNS though.

Jille added a commit to Jille/gotransip that referenced this issue Sep 10, 2021
Otherwise callers that run this in parallel will get rejected. See aequitas/terraform-provider-transip#44
@aequitas
Copy link
Owner

Maybe something changes on the Transip side in how they handle concurrent requests. DNS always has been a little finicky with concurrency as you need to replace the entire DNS zone and cannot make changes to single records at a time.

I'll need to investigate this and try to replicate.

As a mitigation, could you try running Terraform with parallelism set to 1 (https://www.terraform.io/docs/cli/commands/apply.html#parallelism-n), this is a little slower but might solve the issue for now.

@Jille
Copy link
Contributor Author

Jille commented Sep 11, 2021

Did you happen to see the pull request I linked? It seems that calling the authenticator twice in the same second causes this problem.

I suppose that ideally terraform-provider-transip would create the authenticator only once and reuse that?

I wanted to try that, but Terraform Cloud doesn't support it :/

@aequitas
Copy link
Owner

You didn't mention you where running in Terraform Cloud or you where running multiple instances of apply at the same time so I had to guess what was going on. Within the same Terraform plan/apply the authenticator is only called once and reused for every action. But concurrent runs might be a problem indeed.

@Jille
Copy link
Contributor Author

Jille commented Sep 11, 2021

Apologies.

I'm running only a single apply at the same time, using Terraform cloud. My config does include multiple transip_dns_record's however.

@aequitas
Copy link
Owner

I'd have to run a test inside Terraform Cloud to replicate this. I don't know if Terraform Cloud does anything special regarding concurrency. I'll get back to you on this.

I can't find an easy way to set parallelism in Terraform Cloud so I don't have a short term workaround for now I'm afraid.

Jille added a commit to Jille/gotransip that referenced this issue Sep 13, 2021
Otherwise callers that run this in parallel will get rejected. See aequitas/terraform-provider-transip#44
skoef pushed a commit to transip/gotransip that referenced this issue Sep 13, 2021
Otherwise callers that run this in parallel will get rejected. See aequitas/terraform-provider-transip#44
Jille added a commit to Jille/terraform-provider-transip that referenced this issue Sep 13, 2021
Includes a bugfix for aequitas#44 related to parallelism
@Jille
Copy link
Contributor Author

Jille commented Sep 13, 2021

I had emailed TFC support and they pointed me at the documentation (https://www.terraform.io/docs/cloud/workspaces/variables.html#special-environment-variables). Reducing the parallelism solved the issue.

I got my bugfix upstreamed just now, so I opened PR #45 to update gotransip.

Feel free to close this once that's merged, or to keep it open if you want to investigate why the authenticator runs multiple times despite that it shouldn't.

Thanks for your help :)

aequitas pushed a commit that referenced this issue Sep 13, 2021
Includes a bugfix for #44 related to parallelism
@aequitas
Copy link
Owner

That was quick, I've merged your PR, will push an update out later this evening.

@aequitas
Copy link
Owner

@Jille
Copy link
Contributor Author

Jille commented Sep 13, 2021

Thanks for the quick responses, merge and release! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants