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

Creation of platform_permission resources failed to capture changes and update the Terraform state #190

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

Comments

@anstrom
Copy link

anstrom commented Jan 17, 2025

Describe the bug
To safely migrate from artifactory_permission_target to the newly required platform_permission resources, we adopted an approach where we first create the new resources, duplicating the effective permissions but assigning different names.

Following the same logic used for artifactory_permission_target resources, we loop through YAML-based input data to create permission targets for each group and service account. Additionally, we generate permission targets that include all publicly available local and remote repositories (~250 repos in each target).

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 7.98.10
  • Your version of terraform v1.10.3
  • Your version of terraform provider v1.19.1

Expected behavior
New permission targets are created and the Terraform state is updated.

Actual behavior
Some permission targets were retried over several minutes before timing out. The actual permission targets in Artifactory were in some instances created, but Terraform did not register the result. The effect was that subsequent plan/apply cycles failed and had to be fixed by importing the resources in question or removing them from Artifactory.

Additional context
The problem persisted through all our environments. 12-15 out of 86 permission targets were left in this state in each environment. I'm not allowed to share our code in a public issue.

Follow-up
We have worked around the issue and have consistent environments now (and also upgraded providers). We wanted to create an issue in case there are underlying issues that should be fixed in order to improve the stability and reliability of the provider, as we understand that we are required to migrate several resources moving forward.

@anstrom anstrom added the bug Something isn't working label Jan 17, 2025
@alexhung
Copy link
Member

@anstrom Thanks for the report! I've added this to our plan to investigate and fix.

This looks like the Access API is not handling the request volume well. If you are able to test again, you may want to set -parallelism to lower value. Perhaps 2 or 3, and see if this help.

@anstrom
Copy link
Author

anstrom commented Jan 20, 2025

@alexhung Looks like you're correct - I have successfully tested in a blank environment with -parallelism=2

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