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

Parallel provider initialization sometimes throws error #167

Open
neinkob15 opened this issue Feb 12, 2024 · 1 comment
Open

Parallel provider initialization sometimes throws error #167

neinkob15 opened this issue Feb 12, 2024 · 1 comment

Comments

@neinkob15
Copy link

Hello,

we are currently, using this provider to update resources on multiple domains (~ 7 domains). We are distinguishing the providers using provider-aliases, f.e. like this:

provider "checkpoint" {
        alias = "domainA"
        timeout = 60
        session_file_name = "sid_domainA.json"
        server = "our-server-url.com"
        api_key = "our-api-key"
        domain = "domainA"
}
provider "checkpoint" {
        alias = "domainB"
        timeout = 60
        session_file_name = "sid_domainB.json"
        server = "our-server-url.com"
        api_key = "our-api-key"
        domain = "domainB"
}
...

The problem is, some login-requests to the Checkpoint Backend fail sporadically. Sometimes everything works as expected but sometimes we get an error for specific domains, there is no pattern:

╷
│ Error: failed to execute API call
│ Status: 400 Bad Request
│ Code: err_login_failed
│ Message: Authentication to server failed.
│ 
│   with provider["registry.terraform.io/checkpointsw/checkpoint"].domainA,
│   on main.tf.json line 58, in provider.checkpoint[4]:
│   58:          },
│ 

I think, the cause is the parallel login-requests, because when using only one provider, everything works fine.
Would it be possible, that you implement some kind of locking to have these requests send sequentially?

@chkp-royl
Copy link
Contributor

Hi @neinkob15,

We need to investigate your request and see how we can support it.
In overall, provider support one domain in every execution, we cannot guarantee expected results in the way you do it.
You need to configure single provider in your configuration files and to run terraform per domain.
Maybe you can think of wrapping your terraform execution and implement this parallelism by yourself (e.g. separate configuration files per domain in different directories)

Regards,
Roy

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

No branches or pull requests

2 participants