atlassian / terraform-provider-artifactory

Terraform provider to manage Artifactory
Apache License 2.0
89 stars 42 forks source link

Unable to terraform apply at all. "Unavailable desc = transport is closing" #75

Open paperbag-zz opened 4 years ago

paperbag-zz commented 4 years ago

Error when running apply (full log below in the gist). Error: rpc error: code = Unavailable desc = transport is closing

Community Note

Terraform Version

Terraform v0.12.24

Affected Resource(s)

resource "artifactory_local_repository" resource "artifactory_user"

Terraform Configuration Files

resource "artifactory_local_repository" "test" {
  key          = "broker"
  package_type = "docker"
}
##########################################
# Artifactory Provider
##########################################
provider "artifactory" {
    url = ""
    username = ""
    password = ""
}

### Debug Output / Panic Output

panic: https://gist.github.com/paperbag-zz/4f271cef97344751ee554111aff5000c

debug: https://gist.github.com/paperbag-zz/bb318a1b36c74d5fb30f05028cb218ba

### Expected Behavior

Apply should have run.

### Actual Behavior

Terraform crash

### Steps to Reproduce

Tested with current and alpha releases with terraform 0.11 and 0.12.

Plan runs fine, running apply crash happens.

### Important Factoids

N/A

* #0000
ShreyasNBS commented 4 years ago

Try terraform apply -parallelism=1

TonyLovesDevOps commented 3 years ago

@paperbag-zz I too ran into issues like this, and at least in some cases it turned out to be that the provider was sending API requests to artifactory that it was rejecting. For example, attempting to create/modify permissions targets that have zero users/groups (which you can do just fine through the UI but not through the API.)

What seemed to be helpful for me was to try to apply one resource at a time, e.g. terraform apply -target artifactory_permission_target.foo which produced more helpful error messages. Also adding TF_LOG=trace to the apply to see debug logs was helpful, too.

spuder commented 3 years ago

We are frequently finding the terraform module for artifactory unusable due to this error. We have tried adding -parallelism=1 but still encounter crashes when adding new resources

Here is an example resource that seems to reproduce the issue.

resource "artifactory_remote_repository" "debian-remote_ceph_nautilus" {
  key              = "debian-remote.ceph.nautilus"
  package_type     = "debian"
  repo_layout_ref  = "simple-default"
  url              = "http://download.ceph.com/debian-nautilus"
  notes            = "managed by terraform"
  property_sets    = ["artifactory"]
  includes_pattern = "**/*"
  content_synchronisation {
    enabled = false
  }
}