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-provider-google_v3.66.0_x5 plugin crashed #9022

Closed
dieseldesai opened this issue Apr 29, 2021 · 12 comments · Fixed by GoogleCloudPlatform/magic-modules#4748, #9032 or hashicorp/terraform-provider-google-beta#3208
Assignees
Labels
bug forward/review In review; remove label to forward service/compute-instances

Comments

@dieseldesai
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

Terraform v0.15.1
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v3.66.0
  • provider registry.terraform.io/hashicorp/null v3.1.0

Affected Resource(s)

  • google_compute_instance

Terraform Configuration Files

terraform {
  required_providers {
    google = {
      source = "hashicorp/google"
    }
  }
  required_version = ">= 0.14.11"
}

provider "google" {
  project = var.project
  region  = var.region
  zone    = var.zone
}

variable "project" {
  type        = string
  description = "The GCP project to build the instance into"
}

variable "region" {
  type        = string
  description = "The GCP region to build the instance into"
  default = "us-central1"
}

variable "zone" {
  type        = string
  description = "The GCP zone to build the instance into"
  default = "us-central1-a"
}

variable "uid" {
  description = "Unique identifier"
  type = string
}

resource "google_compute_instance" "node" {
  name             = var.uid
  machine_type     = "n1-standard-8"
  min_cpu_platform = "Intel Haswell"

  boot_disk {
    initialize_params {
      image = "ubuntu-os-cloud/ubuntu-minimal-2004-focal-v20201211"
      type = "pd-ssd"
      size = 250
    }
  }

  network_interface {
    subnetwork="default"
    access_config {
    }
  }


  metadata = {
    enable-guest-attributes = true
  }

  tags = [var.uid]

  service_account {
    scopes = ["cloud-platform"]
  }
}

Debug Output

https://gist.github.com/dieseldesai/4f785a8da23b847165dc8eb04cab4c7c

Expected Behavior

A google compute instance should have been provisioned

Actual Behavior

the terraform google provider plugin crashed

Steps to Reproduce

  1. terraform apply
  • #0000
@jvlake
Copy link

jvlake commented Apr 29, 2021

The same issue as above but with terraform 0.12.31 (upgrading due to public key invalidation).

PANIC: interface conversion: interface {} is *schema.Set, not []interface {}

I suspect it's a regression from 9 days ago: #8953

The GetChange from the terraform-plugin-sdk returns type getResult struct as interface{}

And this change in the PR assumes that can be cast to an array

func serviceAccountDiffSuppress(k, old, new string, d *schema.ResourceData) bool { o, n := d.GetChange(strings.TrimSuffix(k, ".#")) var l []interface{} if old == "0" && new == "1" { l = n.([]interface{})

^ I could be wrong, does that sound about right? @edwardmedia

@rcaril
Copy link

rcaril commented Apr 29, 2021

Same issue on TFE .13.7 with this latest GCP 3.66 update:

2021-04-29T13:34:56.830Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-29T13:34:56.830Z [DEBUG] plugin: plugin process exited: path=.terraform/plugins/registry.terraform.io/hashicorp/google/3.66.0/linux_amd64/terraform-provider-google_v3.66.0_x5 pid=253 error="exit status 2"
2021/04/29 13:34:56 [ERROR] eval: *terraform.EvalDiff, err: rpc error: code = Unavailable desc = transport is closing
2021/04/29 13:34:56 [ERROR] eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing

@megan07 megan07 self-assigned this Apr 29, 2021
@harroguk
Copy link

Same as @rcaril but in Terraform v0.13.5
Tested and it is working in terraform-provider-google_v3.65

@rcaril
Copy link

rcaril commented Apr 29, 2021

@megan07 - this code push did not fix the problem. Same behavior.

@megan07
Copy link
Contributor

megan07 commented Apr 29, 2021

Hi @rcaril, I'm sorry you're experiencing the issue still. Would you be willing to share your configuration and your full debug logs so I can see what is happening? Thanks!

@rcaril
Copy link

rcaril commented Apr 29, 2021

@megan07 My log is attached.

run-mwzH4qRFxRLhDV4v-plan-log.txt

What kind of configuration are you looking for?

This is my initial setup:

terraform {
  required_providers {
    google = {
      source = "hashicorp/google"
      version = "3.66.0"
    }
  }
  backend "remote" {
    hostname     = "########"
    organization = "#####"
    workspaces {
      name = "######"
    }
  }
}

Please let me know if you need more details.

@aareet
Copy link
Contributor

aareet commented Apr 29, 2021

Thank you for the quick response @rcaril, I think there might be a small misunderstanding. The fix for this bug was recently merged and is still in the process of being released. From the configuration, it seems that you may still be using a version (3.66.0) that does not have this fix. The issue gets closed automatically when a fix is merged, which probably caused this confusion. Sorry about that. We are working to get this fix out in a release as soon as possible.

@rcaril
Copy link

rcaril commented Apr 29, 2021

Hi @aareet - thanks for clarifying this! I indeed did not realize that the merge would not go into your release automatically. Please keep me updated on when this has been released. Would I expect this to be version 3.67?

@aareet
Copy link
Contributor

aareet commented Apr 29, 2021

Glad we figured it out 🙂. I will certainly update this ticket once we release. We're currently expecting this to be version 3.66.1, but I will confirm once we release.

@aareet
Copy link
Contributor

aareet commented Apr 29, 2021

Hi folks, v3.66.1 with the fix for this issue is now available - please test with it and let us know if you have any feedback https://registry.terraform.io/providers/hashicorp/google/latest. Thanks for your patience.

@rcaril
Copy link

rcaril commented Apr 29, 2021

@aareet This has solved my problem, thanks!

@ghost
Copy link

ghost commented May 30, 2021

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators May 30, 2021
@github-actions github-actions bot added forward/review In review; remove label to forward service/compute-instances labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.