hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
41.76k stars 9.42k forks source link

Crash with artifactory provider "transport is closing" #27653

Closed spuder closed 3 years ago

spuder commented 3 years ago

Terraform Version

Terraform v0.14.4
+ provider registry.terraform.io/hashicorp/external v2.0.0
+ provider registry.terraform.io/jfrog/artifactory v2.2.4

Crash Output

https://gist.github.com/spuder/a8b4a51ca8f54c5e9cf46e4b4242fa1a

Running terraform apply --parallelism=1 because of a known race condition in artifactory

Crashed with error "transport is closing"

Steps to reproduce

Manually deleted the artifactory resource debian-remote_erlang-solutions, then tried to let artfactory recreate it.

2021/02/01 12:40:23 [TRACE] EvalMaybeTainted: artifactory_remote_repository.debian-remote_erlang-solutions encountered an error during creation, so it is now marked as tainted

Resource

resource "artifactory_remote_repository" "debian-remote_erlang-solutions" {
  key              = "debian-remote.erlang-solutions"
  package_type     = "debian"
  repo_layout_ref  = "simple-default"
  url              = "http://packages.erlang-solutions.com/ubuntu"
  notes            = "managed by terraform"
  property_sets    = ["artifactory"]
  includes_pattern = "**/*"
  content_synchronisation {
    enabled = null
  }
}
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # artifactory_remote_repository.debian-remote_erlang-solutions will be created
  + resource "artifactory_remote_repository" "debian-remote_erlang-solutions" {
      + allow_any_host_auth                   = (known after apply)
      + blacked_out                           = (known after apply)
      + block_mismatching_mime_types          = (known after apply)
      + bower_registry_url                    = (known after apply)
      + bypass_head_requests                  = (known after apply)
      + client_tls_certificate                = (known after apply)
      + enable_cookie_management              = (known after apply)
      + enable_token_authentication           = (known after apply)
      + excludes_pattern                      = (known after apply)
      + fetch_jars_eagerly                    = (known after apply)
      + fetch_sources_eagerly                 = (known after apply)
      + force_nuget_authentication            = (known after apply)
      + handle_releases                       = (known after apply)
      + handle_snapshots                      = (known after apply)
      + hard_fail                             = (known after apply)
      + id                                    = (known after apply)
      + includes_pattern                      = "**/*"
      + key                                   = "debian-remote.erlang-solutions"
      + max_unique_snapshots                  = (known after apply)
      + missed_cache_period_seconds           = (known after apply)
      + notes                                 = "managed by terraform"
      + offline                               = (known after apply)
      + package_type                          = "debian"
      + property_sets                         = [
          + "artifactory",
        ]
      + pypi_registry_url                     = (known after apply)
      + remote_repo_checksum_policy_type      = (known after apply)
      + repo_layout_ref                       = "simple-default"
      + retrieval_cache_period_seconds        = (known after apply)
      + share_configuration                   = (known after apply)
      + socket_timeout_millis                 = (known after apply)
      + store_artifacts_locally               = (known after apply)
      + suppress_pom_consistency_checks       = (known after apply)
      + synchronize_properties                = (known after apply)
      + unused_artifacts_cleanup_period_hours = (known after apply)
      + url                                   = "http://packages.erlang-solutions.com/ubuntu"
      + vcs_git_download_url                  = (known after apply)
      + vcs_git_provider                      = (known after apply)
      + vcs_type                              = (known after apply)
      + xray_index                            = (known after apply)

      + content_synchronisation {}
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

artifactory_remote_repository.debian-remote_erlang-solutions: Creating...

Error: rpc error: code = Unavailable desc = transport is closing

panic: interface conversion: interface {} is nil, not map[string]interface {}
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: 
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: goroutine 99 [running]:
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: github.com/atlassian/terraform-provider-artifactory/pkg/artifactory.unpackRemoteRepo(0xc0002caee0, 0x3)
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4:      github.com/atlassian/terraform-provider-artifactory/pkg/artifactory/resource_artifactory_remote_repository.go:356 +0x1591
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: github.com/atlassian/terraform-provider-artifactory/pkg/artifactory.resourceRemoteRepositoryCreate(0xc0002caee0, 0x1cc45c0, 0xc00024e0c0, 0x2, 0x2ba5540)
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4:      github.com/atlassian/terraform-provider-artifactory/pkg/artifactory/resource_artifactory_remote_repository.go:456 +0x54
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc000182200, 0xc0004c0280, 0xc000338660, 0x1cc45c0, 0xc00024e0c0, 0x1d87601, 0xc000899188, 0xc0008aa450)
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4:      github.com/hashicorp/terraform@v0.12.29/helper/schema/resource.go:305 +0x365
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc000182f80, 0xc000673a00, 0xc0004c0280, 0xc000338660, 0xc00088caa8, 0xc0008ac128, 0x1d89ea0)
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4:      github.com/hashicorp/terraform@v0.12.29/helper/schema/provider.go:289 +0x99
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: github.com/hashicorp/terraform/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc0000ae300, 0x2278960, 0xc000274f00, 0xc00065d140, 0xc0000ae300, 0xc000274f00, 0xc0001a9b78)
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4:      github.com/hashicorp/terraform@v0.12.29/helper/plugin/grpc_provider.go:885 +0x8c4
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: github.com/hashicorp/terraform/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1eea480, 0xc0000ae300, 0x2278960, 0xc000274f00, 0xc00065d0e0, 0x0, 0x2278960, 0xc000274f00, 0xc000881200, 0x8d8)
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4:      github.com/hashicorp/terraform@v0.12.29/internal/tfplugin5/tfplugin5.pb.go:3189 +0x217
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: google.golang.org/grpc.(*Server).processUnaryRPC(0xc000093380, 0x2286160, 0xc000782d80, 0xc000816d00, 0xc000180ed0, 0x2b69b60, 0x0, 0x0, 0x0)
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4:      google.golang.org/grpc@v1.27.1/server.go:1024 +0x501
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: google.golang.org/grpc.(*Server).handleStream(0xc000093380, 0x2286160, 0xc000782d80, 0xc000816d00, 0x0)
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4:      google.golang.org/grpc@v1.27.1/server.go:1313 +0xd3d
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00003a1f0, 0xc000093380, 0x2286160, 0xc000782d80, 0xc000816d00)
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4:      google.golang.org/grpc@v1.27.1/server.go:722 +0xa1
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4: created by google.golang.org/grpc.(*Server).serveStreams.func1
2021-02-01T12:40:23.092-0700 [DEBUG] plugin.terraform-provider-artifactory_v2.2.4:      google.golang.org/grpc@v1.27.1/server.go:720 +0xa1
2021-02-01T12:40:23.093-0700 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021/02/01 12:40:23 [DEBUG] artifactory_remote_repository.debian-remote_erlang-solutions: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2021/02/01 12:40:23 [TRACE] EvalMaybeTainted: artifactory_remote_repository.debian-remote_erlang-solutions encountered an error during creation, so it is now marked as tainted
2021/02/01 12:40:23 [TRACE] EvalWriteState: removing state object for artifactory_remote_repository.debian-remote_erlang-solutions
2021/02/01 12:40:23 [TRACE] EvalApplyProvisioners: artifactory_remote_repository.debian-remote_erlang-solutions has no state, so skipping provisioners
2021/02/01 12:40:23 [TRACE] EvalMaybeTainted: artifactory_remote_repository.debian-remote_erlang-solutions encountered an error during creation, so it is now marked as tainted
2021/02/01 12:40:23 [TRACE] EvalWriteState: removing state object for artifactory_remote_repository.debian-remote_erlang-solutions
2021-02-01T12:40:23.093-0700 [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/jfrog/artifactory/2.2.4/darwin_amd64/terraform-provider-artifactory_v2.2.4 pid=17328 error="exit status 2"
2021/02/01 12:40:23 [TRACE] vertex "artifactory_remote_repository.debian-remote_erlang-solutions": visit complete
2021/02/01 12:40:23 [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/jfrog/artifactory\"] (close)" errored, so skipping
2021/02/01 12:40:23 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2021/02/01 12:40:23 [TRACE] dag/walk: upstream of "root" errored, so skipping
2021/02/01 12:40:23 [DEBUG] DELETE https://gitlab.mx.com/api/v4/projects/1706/terraform/state/artifactory-prod/lock
2021-02-01T12:40:23.210-0700 [DEBUG] plugin: plugin exited

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.

SECURITY WARNING: the "crash.log" file that was created may contain 
sensitive information that must be redacted before it is safe to share 
on the issue tracker.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
jbardin commented 3 years ago

Hi @spuder

This appears to be an issue with the artifactory provider. You can file issues in their GitHub repository here: https://github.com/jfrog/terraform-provider-artifactory/issues

Thanks!

ghost commented 3 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.