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

Replacing more than one repository with terraform plan -replace gives 500 error from Artifactory #191

Open
5 tasks done
anstrom opened this issue Jan 17, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@anstrom
Copy link

anstrom commented Jan 17, 2025

Describe the bug
We recreate some repositories in Artifactory this way:

terraform plan \
  -replace=module.artifactory.module.repo.artifactory_remote_go_repository.repo[\"remote-repo-1\"]  \
 -replace=module.artifactory.module.repo.artifactory_remote_go_repository.repo[\"remote-repo-2\"]
-out=$TERRAFORM_PLAN
terraform apply $TERRAFORM_PLAN

This has worked fine with the jfrog/artifactory provider, but fails to update permission targets created as platform_permission resources. The problem only occurs when the repositories are included in permission targets and there are two repos or more in the same plan.

Requirements for and issue

  • A description of the bug
  • A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that's part of the issue). If this is not supplied, this issue will likely be closed without any effort expended.
  • Your version of artifactory v7.98.10
  • Your version of terraform v1.10.3
  • Your version of terraform provider v2.2.1

Expected behavior
All repos are destroyed and created.

Actual behavior

The command fails with the following message:

Error: {
  "errors" : [ {
    "status" : 500,
    "message" : "Could not update permission permission-example with identifier permission-example_artifact"
  } ]
}
@anstrom anstrom added the bug Something isn't working label Jan 17, 2025
@alexhung
Copy link
Member

@anstrom This sounds very similar to #190.

@anstrom
Copy link
Author

anstrom commented Jan 20, 2025

@alexhung This works with -parallelism=1, but any value of >=2 breaks the apply.

@alexhung
Copy link
Member

@anstrom Thanks for the additional testing. I'll open a bug ticket internally with the Access team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants