You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running this, there's a race condition that happens between CUSTOM-REMOTE and CUSTOM-ENV. Given that CUSTOM-ENV successfully gets created, we get the
following error:
Error: Unable to Create Resource
[...]
An unexpected error occurred while creating the resource update request.
Please report this issue to the provider developers.
Error: BAD_REQUEST - Project Admin should contain all global and project
environments. Project environments: [PROD, DEV, projkey-CUSTOM-REMOTE,
projkey-CUSTOM-ENV] but got: [PROD, DEV, projkey-CUSTOM-REMOTE]
CUSTOM-ENV then gets stuck in a tainted state. Any further operations results in:
╷
│ Error: Unable to Delete Resource
│
│ An unexpected error occurred while attempting to delete the resource.
│ Please retry the operation or report this issue to the provider developers.
│
│ Error: NOT_FOUND - Could not find environment `projkey-CUSTOM-REMOTE`
╵
Key info:
Terraform v1.8.4
on darwin_arm64
provider: 1.9.0
artifactory version: Enterprise Plus 7.90.15
The text was updated successfully, but these errors were encountered:
@richardmcsong Thanks for the report. This is caused by Terraform executing the resource creation in parallel with the use of for_each. I'll see what I can do to resolve this.
@richardmcsong I am able to reproduce this issue, although only sporadically.
A couple of things:
I find a bug in the code for error handling in create/update functions where the code doesn't return after an error and therefore the resource is stored into the state. I'll be opening a PR to fix this.
The race condition error comes from the project REST API. Unfortunately, the environment in question actually is created successfully in Artifactory (at least in my test environment). This prevents running terraform apply again to create the environment again as TF will error out with resource already exists. I've created a bug report with the Project team for investigation.
In the meantime, there isn't any good solution I can offer. You can try to use depends_on meta-argument to make the environment resource to be managed in a sequential manner. See this StackOverflow thread
Given:
Running this, there's a race condition that happens between
CUSTOM-REMOTE
andCUSTOM-ENV
. Given thatCUSTOM-ENV
successfully gets created, we get thefollowing error:
CUSTOM-ENV
then gets stuck in a tainted state. Any further operations results in:Key info:
provider: 1.9.0
artifactory version: Enterprise Plus 7.90.15
The text was updated successfully, but these errors were encountered: