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 Crash (v0.12.18) #23744

Closed
weeco opened this issue Dec 21, 2019 · 3 comments
Closed

Terraform Crash (v0.12.18) #23744

weeco opened this issue Dec 21, 2019 · 3 comments

Comments

@weeco
Copy link

weeco commented Dec 21, 2019

Terraform Version

$ terraform -v
Terraform v0.12.18
+ provider.google v3.0.0

Terraform Configuration Files

data "google_project" "prod" {
  project_id = "redacted"
}

data "google_client_config" "current" {}

resource "google_cloud_run_service" "userpanel" {
  name     = "userpanel"
  location = var.location
  metadata {}

  template {
    spec {
      container_concurrency = 80
      service_account_name  = "[email protected]"

      containers {
        image = "redacted"

        resources {
          limits = {
            cpu    = "1000m"
            memory = "256Mi"
          }
          requests = {}
        }
      }
    }

    metadata {
      annotations = {
        "autoscaling.knative.dev/maxScale" = "10"
      }
    }
  }
}

Debug Output

Crash Output

crash.log

Expected Behavior

Terraform plan looked good (it showed one cloud run service to add) but the apply crashed.

Actual Behavior

Terraform crash after trying to apply the changes.

Steps to Reproduce

Additional Context

I tried applying this to two different Google Projects but the crash happened on both of them (I targeted them one by one by using the --target parameter).

One project already had the cloudrun service running which is why I imported the state. I saw terraform is crashing so I thought it might be because of some import / state issues. I removed the resource from my terraform module which caused the cloud run service to be deleted (as expected) and that worked. Adding the cloud run service however doesn't work because of the described crash.

References

@bflad
Copy link
Contributor

bflad commented Jan 2, 2020

Hi @weeco 👋 Thank you for submitting this and sorry you are running into trouble here. Given the relevant portion of the crash log:

2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: panic: interface conversion: interface {} is nil, not map[string]interface {}
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: goroutine 28 [running]:
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: github.com/terraform-providers/terraform-provider-google/google.resourceCloudRunServiceEncoder(0xc0005f30a0, 0x1f7ea40, 0xc0005cd400, 0xc00082d740, 0x1d83d20, 0xc000355800, 0x0)
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-google/google/resource_cloud_run_service.go:1946 +0x25a
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: github.com/terraform-providers/terraform-provider-google/google.resourceCloudRunServiceCreate(0xc0005f30a0, 0x1f7ea40, 0xc0005cd400, 0x2, 0x355d660)
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-google/google/resource_cloud_run_service.go:590 +0x36b
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc0001aad00, 0xc000553810, 0xc00013b8e0, 0x1f7ea40, 0xc0005cd400, 0xc000611001, 0xc000808c90, 0xc000611110)
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/helper/schema/resource.go:305 +0x36c
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc0003bfe00, 0xc000807918, 0xc000553810, 0xc00013b8e0, 0xc0007f7b88, 0xc000777280, 0x1eea3a0)
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/helper/schema/provider.go:294 +0xa0
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc000122838, 0x27986c0, 0xc00077aba0, 0xc00012b140, 0xc000122838, 0xc00077aba0, 0xc000375a80)
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:885 +0x889
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x22da560, 0xc000122838, 0x27986c0, 0xc00077aba0, 0xc00012b0e0, 0x0, 0x27986c0, 0xc00077aba0, 0xc000520000, 0x54f)
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3189 +0x21e
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000d6160, 0x27ca220, 0xc00054f080, 0xc000144b00, 0xc0006166f0, 0x352b760, 0x0, 0x0, 0x0)
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:995 +0x467
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: google.golang.org/grpc.(*Server).handleStream(0xc0000d6160, 0x27ca220, 0xc00054f080, 0xc000144b00, 0x0)
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:1275 +0xd9e
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000136190, 0xc0000d6160, 0x27ca220, 0xc00054f080, 0xc000144b00)
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:710 +0xc2
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: created by google.golang.org/grpc.(*Server).serveStreams.func1
2019-12-21T17:29:47.716+0100 [DEBUG] plugin.terraform-provider-google_v3.0.0_x5.exe: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:708 +0xa8

This likely is an issue within the Terraform Google Provider and not the Terraform CLI code in this repository. I'm going to tell our bot to automatically migrate this issue over to the appropriate place. 👍

@ghost
Copy link

ghost commented Jan 2, 2020

This issue has been automatically migrated to hashicorp/terraform-provider-google#5287 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-google#5287.

@ghost ghost closed this as completed Jan 2, 2020
@ghost
Copy link

ghost commented Feb 2, 2020

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.

@ghost ghost locked and limited conversation to collaborators Feb 2, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants