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

Group Creation fails with 404 when group had been previously deleted. #776

Closed
derekscp opened this issue Aug 7, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@derekscp
Copy link

derekscp commented Aug 7, 2023

Describe the bug
When a group is first created it works fine but if that group is deleted and terraform plan or apply is run it will return that there it received a 404 when checking the state causing the command to fail. You will have to remove the state so that it will recreate the group (i.e. terraform state rm artifactory_group.derekp_some_group). This appears to be related to or has the same issue as #775 and #772.

It would receive this error:

││ Error: Unable to Refresh Resource
│ 
│   with artifactory_group.derekp_some_group,
│   on artifactory.tf line 39, in resource "artifactory_group" "derekp_some_group":
│   39: resource "artifactory_group" "derekp_some_group" {
│ 
│ An unexpected error occurred while attempting to refresh resource state.
│ Please retry the operation or report this issue to the provider developers.
│ 
│ HTTP Error: 
│ 404 GET
│ <ART_URL>/artifactory/api/security/groups/derekp_some_group?includeUsers=false
│ {
│   "errors" : [ {
│     "status" : 404,
│     "message" : "Not Found"
│   } ]
│ }
╵

Requirements for and issue

  • A 'terraform plan' or 'terraform apply' command will fail if it had previously created a group but that group was deleted on Artifactory.
    To reproduce run these steps:
  1. Run a terraform plan and apply that will create a group.
  2. Go onto Artifactory and delete that group.
  3. Re-run the terraform plan and apply commands and observe the 404.
  • Terraform snippet:
resource "artifactory_group" "derekp_some_group" {
  name             = "derekp_some_group"
  description      = "test group"
}
  • Artifactory Version - 7.64.7
  • Terraform Version - 7.0.0
  • Terraform Provider - 8.4.0

Expected behavior
The terraform provider should not fail when it gets a 404 from a group that no longer exists but recreates the group.

Additional context
n/a

@danielmkn
Copy link
Collaborator

Thanks for reporting! Fixed in v8.4.1

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

2 participants