terraform-provider-argocd icon indicating copy to clipboard operation
terraform-provider-argocd copied to clipboard

Repository Not Re-Creating After Manual Deletion in argoproj-labs/argocd Provider

Open Arjunprase opened this issue 9 months ago • 4 comments

Terraform Version, ArgoCD Provider Version and ArgoCD Version

Terraform v1.9.4
+ provider registry.terraform.io/argoproj-labs/argocd v7.3.1
ArgoCD v2.13.3

Affected Resource(s)

argocd_repository

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.
  
  argocd = {
      source = "argoproj-labs/argocd"
      version = "7.2.0"
    }
==
resource "argocd_repository" "repo-creation" {

  repo                       = repo_url
  username                   = user_name
  password                   = password
  project                    = project
  insecure                   = true  # Ignore TLS warnings
}

Debug Output

argocd_repository" "repo-creation": resource "argocd_repository" "repo-creation" { rpc error: code = PermissionDenied desc = permission denied

Panic Output

Steps to Reproduce

  1. Run terraform apply to create the new repository in ArgoCD.
  2. Manually delete the repository from the ArgoCD UI.
  3. Execute terraform apply.

Repo can be able to add after deleting the tf state

Expected Behavior

After manually deleting the repository, running terraform apply should detect the missing resource and re-create it.### Actual Behavior

The repository is not re-created after being manually deleted and running terraform apply. rpc error: code = PermissionDenied desc = permission denied

Important Factoids

The behavior differs from the oboukili/argocd provider 6.0.3 and argocdv2.7.7 , which automatically re-created the resource.

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Arjunprase avatar Feb 20 '25 13:02 Arjunprase

Maybe that's related to #597. Will have to check once the other issue has been resolved.

the-technat avatar Mar 25 '25 10:03 the-technat

I'm still encountering the error. I tried using provider version 7.5.3 along with Argo CD v2.14.8, but the issue persists.

Arjunprase avatar Apr 23 '25 11:04 Arjunprase

│ Error: failed to read repository https:// │ │ with module.xxxx.argocd_repository.repo-creation[0], │ on .terraform/modules/xxxx/main.tf line 24, in resource "argocd_repository" "repo-creation": │ 24: resource "argocd_repository" "repo-creation" { │ │ rpc error: code = PermissionDenied desc = permission denied ╵ Operation failed: failed running terraform plan (exit 1)

Arjunprase avatar Apr 23 '25 11:04 Arjunprase

Still an issue in provider version 7.7.0, same behavior.

dlitster avatar May 14 '25 23:05 dlitster