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

terraform destroy a ruby gems local repository gives an error and prevents Terraform state from being refreshed #1184

Open
5 tasks done
zamanh opened this issue Jan 31, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@zamanh
Copy link

zamanh commented Jan 31, 2025

Describe the bug
I try to destroy a local ruby-gems repo. I get error:

│ 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: Cannot invoke │ "org.artifactory.descriptor.repo.RepoDescriptor.getType()" because the return │ value of │ "org.artifactory.repo.service.InternalRepositoryService.repoDescriptorByKey(String)" │ is null

Which then doesn't let the terraform apply or destroy anything until the offender is remove from the state manually using TF

Image

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.
resource "artifactory_local_gems_repository" "terraform-local-test-gems-repo" {
  key = "terraform-local-test-gems-repo"
}
  • Your version of artifactory (you can curl it at $host/artifactory/api/system/version: 7.98.13 (self-hosted)
  • Your version of terraform: 1.9.8
  • Your version of terraform provider: 12.8.3

Expected behavior
I should be able to destroy a ruby gems repo without the above error and the Terraform state file should not be in affected state.

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

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

Can you also share the TF configuration for this ruby gems repo? Please redact/replace any sensitive information, of course.

@zamanh
Copy link
Author

zamanh commented Jan 31, 2025

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

Can you also share the TF configuration for this ruby gems repo? Please redact/replace any sensitive information, of course.

@alexhung Here's the output

# artifactory_local_gems_repository.SENSITIVE (SENSITIVE) will be created
resource "artifactory_local_gems_repository" "ruby-gems" {
  archive_browsing_enabled = false
  blacked_out              = false
  cdn_redirect             = false
  description              = "Internal repository of untrusted gems packages."
  download_direct          = false
  id                       = (known after apply)
  includes_pattern         = "**/*"
  key                      = "ruby-gems-local"
  priority_resolution      = false
  project_environments     = (known after apply)
  property_sets            = [
    "artifactory",
  ]
  repo_layout_ref          = "simple-default"
  xray_index               = false
  # (3 unchanged attributes hidden)
}

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