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

Error: The terraform-provider-google_v4.41.0_x5 plugin crashed! #13051

Assignees

Comments

@meniluca
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

(from Google Cloud Console)

Terraform v1.3.3
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v4.41.0

Affected Resource(s)

Terraform Configuration Files

main .tf

locals {
  env = "dev"
}

provider "google" {
  project = "${var.project}"
}

module "artifact_registry" {
  source  = "../../modules/artifact_registry"
  project = "${var.project}"
  repository_name = "${var.project}-${local.env == "dev" ? "snapshots" : "releases"}"
  version_policy = "${local.env == "dev" ? "SNAPSHOT" : "RELEASE"}"
  allow_snapshot_overwrites = "${local.env == "dev" ? true : false}"
  location = var.location
  env = local.env
}

backend.tf

terraform {
  backend "gcs" {
    bucket = "myproject-tfstate"
    prefix = "env/dev"
  }
}

from ../../modules/artifact_registry/main.tf

resource "google_artifact_registry_repository" "my-repo" {
  location      = var.location
  repository_id = "${var.repository_name}"
  description   = "My ${var.env} repository"
  format        = "Maven"
  maven_config {
    version_policy = "${var.version_policy}"
    allow_snapshot_overwrites = "${var.allow_snapshot_overwrites}"
  }
}

Debug Output

2022-11-16T10:07:01.613Z [DEBUG] Starting graph walk: walkPlan
2022-11-16T10:07:01.614Z [DEBUG] created provider logger: level=debug
2022-11-16T10:07:01.615Z [INFO]  provider: configuring client automatic mTLS
2022-11-16T10:07:01.623Z [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.41.0/linux_amd64/terraform-provider-google_v4.41.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/4.41.0/linux_amd64/terraform-provider-google_v4.41.0_x5]
2022-11-16T10:07:01.623Z [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.41.0/linux_amd64/terraform-provider-google_v4.41.0_x5 pid=4896
2022-11-16T10:07:01.623Z [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.41.0/linux_amd64/terraform-provider-google_v4.41.0_x5
2022-11-16T10:07:01.635Z [INFO]  provider.terraform-provider-google_v4.41.0_x5: configuring server automatic mTLS: timestamp=2022-11-16T10:07:01.635Z
2022-11-16T10:07:01.667Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: plugin address: address=/tmp/plugin3145820480 network=unix timestamp=2022-11-16T10:07:01.667Z
2022-11-16T10:07:01.667Z [DEBUG] provider: using plugin: version=5
2022-11-16T10:07:01.837Z [WARN]  ValidateProviderConfig from "provider[\"registry.terraform.io/hashicorp/google\"]" changed the config value, but that value is unused
2022-11-16T10:07:01.839Z [INFO]  provider.terraform-provider-google_v4.41.0_x5: 2022/11/16 10:07:01 [INFO] Authenticating using DefaultClient...: timestamp=2022-11-16T10:07:01.839Z
2022-11-16T10:07:01.839Z [INFO]  provider.terraform-provider-google_v4.41.0_x5: 2022/11/16 10:07:01 [INFO]   -- Scopes: [https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email]: timestamp=2022-11-16T10:07:01.839Z
2022-11-16T10:07:01.840Z [INFO]  provider.terraform-provider-google_v4.41.0_x5: 2022/11/16 10:07:01 [INFO] Authenticating using DefaultClient...: timestamp=2022-11-16T10:07:01.840Z
2022-11-16T10:07:01.840Z [INFO]  provider.terraform-provider-google_v4.41.0_x5: 2022/11/16 10:07:01 [INFO]   -- Scopes: [https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email]: timestamp=2022-11-16T10:07:01.840Z
2022-11-16T10:07:01.842Z [INFO]  provider.terraform-provider-google_v4.41.0_x5: 2022/11/16 10:07:01 [DEBUG] Waiting for state to become: [success]: timestamp=2022-11-16T10:07:01.841Z
2022-11-16T10:07:01.889Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: panic: interface conversion: interface {} is nil, not string
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: 
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: goroutine 24 [running]:
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: github.com/hashicorp/terraform-provider-google/google.GetCurrentUserEmail(0x3193e18?, {0xc0003c60e0?, 0x318b380?})
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         github.com/hashicorp/terraform-provider-google/google/utils.go:511 +0x125
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: github.com/hashicorp/terraform-provider-google/google.(*Config).logGoogleIdentities(0xc0004f5000)
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         github.com/hashicorp/terraform-provider-google/google/config.go:586 +0xd4
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: github.com/hashicorp/terraform-provider-google/google.(*Config).LoadAndValidate(0xc0004f5000, {0x3193e18?, 0xc0009a2500})
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         github.com/hashicorp/terraform-provider-google/google/config.go:477 +0x265
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: github.com/hashicorp/terraform-provider-google/google.providerConfigure({0x3193ec0, 0xc00107e180}, 0x2c11560?, 0x1?)
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         github.com/hashicorp/terraform-provider-google/google/provider.go:1599 +0x29a5
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: github.com/hashicorp/terraform-provider-google/google.Provider.func1({0x3193ec0?, 0xc00107e180?}, 0xc00107e180?)
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         github.com/hashicorp/terraform-provider-google/google/provider.go:895 +0x27
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).Configure(0xc0004f2480, {0x3193ec0, 0xc00107e180}, 0xd?)
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/provider.go:297 +0x1e6
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ConfigureProvider(0xc0001320f0, {0x3193ec0?, 0xc001062810?}, 0xc000ed8378)
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/grpc_provider.go:557 +0x345
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).Configure(0xc0002f0000, {0x3193ec0?, 0xc0010621e0?}, 0xc0009a2180)
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:556 +0x2ce
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_Configure_Handler({0x2bd7c40?, 0xc0002f0000}, {0x3193ec0, 0xc0010621e0}, 0xc001074000, 0x0)
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:331 +0x170
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000001e0, {0x31991a8, 0xc000924ea0}, 0xc000156120, 0xc00027e0c0, 0x42b82d8, 0x0)
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         google.golang.org/grpc@v1.48.0/server.go:1295 +0xb0b
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: google.golang.org/grpc.(*Server).handleStream(0xc0000001e0, {0x31991a8, 0xc000924ea0}, 0xc000156120, 0x0)
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         google.golang.org/grpc@v1.48.0/server.go:1636 +0xa1b
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: google.golang.org/grpc.(*Server).serveStreams.func1.2()
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         google.golang.org/grpc@v1.48.0/server.go:932 +0x98
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5: created by google.golang.org/grpc.(*Server).serveStreams.func1
2022-11-16T10:07:01.890Z [DEBUG] provider.terraform-provider-google_v4.41.0_x5:         google.golang.org/grpc@v1.48.0/server.go:930 +0x28a
2022-11-16T10:07:01.892Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-11-16T10:07:01.892Z [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.41.0/linux_amd64/terraform-provider-google_v4.41.0_x5 pid=4896 error="exit status 2"
2022-11-16T10:07:01.892Z [ERROR] plugin.(*GRPCProvider).ConfigureProvider: error="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-11-16T10:07:01.892Z [ERROR] vertex "provider[\"registry.terraform.io/hashicorp/google\"]" error: Plugin did not respond
2022-11-16T10:07:01.893Z [INFO]  backend/local: plan operation completed

Panic Output

After running terraform plan:

│ Error: Plugin did not respond
│ 
│   with provider["registry.terraform.io/hashicorp/google"],
│   on main.tf line 24, in provider "google":
│   24: provider "google" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ConfigureProvider call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-google_v4.41.0_x5 plugin:

panic: interface conversion: interface {} is nil, not string

goroutine 68 [running]:
github.com/hashicorp/terraform-provider-google/google.GetCurrentUserEmail(0x3193e18?, {0xc00007e150?, 0x318b380?})
        github.com/hashicorp/terraform-provider-google/google/utils.go:511 +0x125
github.com/hashicorp/terraform-provider-google/google.(*Config).logGoogleIdentities(0xc000961000)
        github.com/hashicorp/terraform-provider-google/google/config.go:586 +0xd4
github.com/hashicorp/terraform-provider-google/google.(*Config).LoadAndValidate(0xc000961000, {0x3193e18?, 0xc000c900c0})
        github.com/hashicorp/terraform-provider-google/google/config.go:477 +0x265
github.com/hashicorp/terraform-provider-google/google.providerConfigure({0x3193ec0, 0xc001039f80}, 0x2c11560?, 0x1?)
        github.com/hashicorp/terraform-provider-google/google/provider.go:1599 +0x29a5
github.com/hashicorp/terraform-provider-google/google.Provider.func1({0x3193ec0?, 0xc001039f80?}, 0xc001039f80?)
        github.com/hashicorp/terraform-provider-google/google/provider.go:895 +0x27
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).Configure(0xc000507e00, {0x3193ec0, 0xc001039f80}, 0xd?)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/provider.go:297 +0x1e6
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ConfigureProvider(0xc00011d188, {0x3193ec0?, 0xc001038630?}, 0xc00011d380)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/grpc_provider.go:557 +0x345
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).Configure(0xc00058e280, {0x3193ec0?, 0xc001038000?}, 0xc0000ac000)
        github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:556 +0x2ce
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_Configure_Handler({0x2bd7c40?, 0xc00058e280}, {0x3193ec0, 0xc001038000}, 0xc001036000, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:331 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000001e0, {0x31991a8, 0xc00093c000}, 0xc000160c60, 0xc0008e8000, 0x42b82d8, 0x0)
        google.golang.org/grpc@v1.48.0/server.go:1295 +0xb0b
google.golang.org/grpc.(*Server).handleStream(0xc0000001e0, {0x31991a8, 0xc00093c000}, 0xc000160c60, 0x0)
        google.golang.org/grpc@v1.48.0/server.go:1636 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.48.0/server.go:932 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.48.0/server.go:930 +0x28a

Error: The terraform-provider-google_v4.41.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Steps to Reproduce

  1. terraform init
  2. terraform apply

I am getting this error since this morning. I am running the commands from the Google Cloud Console.
Can you suggest whether the issue is related to this plugin or to the Google API?
I have the same Terraform project build by Google Cloud Build, and there is no issue.

Thanks you for your support!
Luca.

@meniluca meniluca added the bug label Nov 16, 2022
@github-actions github-actions bot added the crash label Nov 16, 2022
@MichaelHusbyn
Copy link

I have the same issue with other versions of the google provider.
Have tested different terraform versions as well.
What worked yesterday does not work today from Cloud Shell.

@leevs
Copy link

leevs commented Nov 16, 2022

Same issue, using the following versions also using the cloud shell

Terraform v1.3.4
on linux_amd64
+ provider registry.terraform.io/hashicorp/google v4.43.0
+ provider registry.terraform.io/hashicorp/kubernetes v1.10.0

Tried to run it locally (being authenticated to the same project and user) it just works without any issues.

@brano-nmh
Copy link

brano-nmh commented Nov 16, 2022

I reported the problem in the GCP issue tracking system, as it might be specific only to cloud shell environment:
https://issuetracker.google.com/issues/259385802

@meniluca
Copy link
Author

I have also reported the issue as a Case in GCP directly. I cannot post that here, I will keep you posted. 👍

@lchastel
Copy link

I have the same issue, and created a Case in GCP also.

@Tasty213
Copy link

I got this issue while trying to do one of the google cloud skills boost labs. I imagine the accounts they provide you for those labs are set up different to most user accounts so it might be related to that. For reference it's this lab that caused the issues https://www.cloudskillsboost.google/course_sessions/1935586/labs/343170

@c2thorn
Copy link
Collaborator

c2thorn commented Nov 16, 2022

Have a pending PR to log the error instead of crashing. Looking to release it as v4.43.1 as soon as possible.

c2thorn added a commit to GoogleCloudPlatform/magic-modules that referenced this issue Nov 16, 2022
modular-magician added a commit to modular-magician/terraform-provider-google-beta that referenced this issue Nov 16, 2022
modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Nov 16, 2022
Fixes hashicorp#13051

Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit to hashicorp/terraform-provider-google-beta that referenced this issue Nov 16, 2022
Fixes hashicorp/terraform-provider-google#13051

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit that referenced this issue Nov 16, 2022
Fixes #13051

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit to modular-magician/terraform-validator that referenced this issue Nov 16, 2022
Fixes hashicorp/terraform-provider-google#13051

Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit to GoogleCloudPlatform/terraform-validator that referenced this issue Nov 16, 2022
Fixes hashicorp/terraform-provider-google#13051

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
c2thorn pushed a commit to hashicorp/terraform-provider-google-beta that referenced this issue Nov 16, 2022
Fixes hashicorp/terraform-provider-google#13051

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
@c2thorn
Copy link
Collaborator

c2thorn commented Nov 16, 2022

v4.43.1 for the google provider has been released. I've confirmed in my previous reproduction of the crash that upgrading to v4.43.1 no longer produces the crash.

google-beta to follow soon.

@MichaelHusbyn
Copy link

I can confirm it works now.
A coworker of mine discovered difference in this command running from Cloud Shell or on local machine:
curl -H "Authorization: Bearer "$(gcloud auth application-default print-access-token)"" https://openidconnect.googleapis.com/v1/userinfo

On Cloud Shell this did not return email/email_verified/hd.

Now it seems that the Cloud Shell is returning those variables again

@meniluca
Copy link
Author

I can also confirm, the issue is gone. Thanks!

@brano-nmh
Copy link

v4.43.1 for the google provider has been released. I've confirmed in my previous reproduction of the crash that upgrading to v4.43.1 no longer produces the crash.

google-beta to follow soon.

Thanks, the upgrade to 4.43.1 fixed the problem!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.