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

node_pool_defaults block count changed without having it specified during apply #12549

Assignees
Labels
bug forward/review In review; remove label to forward service/container

Comments

@davidgrundstrom
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 v1.2.9

  • provider: registry.terraform.io/hashicorp/google-beta v4.36.0
  • provider: registry.terraform.io/hashicorp/google v4.36.0
  • provider: registry.terraform.io/hashicorp/random v3.4.3

Affected Resource(s)

  • google_container_cluster

Terraform Configuration Files

terraform {
  required_version = ">= 0.13"
}

provider "google" {
  region = "europe-west1"
}

resource "google_service_account" "example_sa" {
  project      = google_project.platform_project.project_id
  account_id   = "example-sa"
  display_name = "Service Account"
}

resource "google_container_cluster" "example_cluster" {
  provider    			= google-beta
  name        			= "example"
  location    			= "europe-west1"
  remove_default_node_pool 	= true
  initial_node_count 		= 1
}

resource "google_container_node_pool" "example_node_pool" {
  name                = "example-node-pool"
  location            = "europe-west1"
  cluster             = google_container_cluster.example_cluster.name
  initial_node_count  = 1

  autoscaling {
    max_node_count = 2
    min_node_count = 1
  }

  node_config {
    preemptible     = false
    machine_type    = "n2d-standard-8"
    service_account = google_service_account.example_sa.email
    oauth_scopes = [
      "https://www.googleapis.com/auth/cloud-platform",
    ]
  }
}

Debug Output

Error: Provider produced inconsistent final plan

When expanding the plan for google_container_cluster.example to
include new values learned so far during apply, provider
"registry.terraform.io/hashicorp/google-beta" produced an invalid new value
for .node_pool_defaults: block count changed from 0 to 1.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Panic Output

Expected Behavior

Terraform Apply succeeding in creating new resources

Actual Behavior

Terraform fails due to node_pool_defaults block count changing value. This is not something we've specified on our cluster and thus I think shouldn't affect our applies.

Steps to Reproduce

This has happened a few times starting today and is always solved by simply running apply again, I'm not able to actively reproduce it.

  1. terraform apply

Important Factoids

References

  • #0000
@edwardmedia edwardmedia self-assigned this Sep 13, 2022
@edwardmedia
Copy link
Contributor

@davidgrundstrom could you share your debug log?

@philip-harvey
Copy link

Basically the same issue as #12422
The newer providers are broken and needs to be fixed.
As a work around you can manually set this with a dynamic block, which is a PITA.

@davidgrundstrom
Copy link
Author

Skipping adding a debug-log as this was reproduced by @shuyama1 and a potential fix seems to be on the way.

@philip-harvey thank you, will look into introducing this in our state until fix is deployed!

@thameezb
Copy link

Would it be possible to trigger a release to enable this fix to be pulled in by users?

@shuyama1
Copy link
Collaborator

Hi @thameezb! I think you'll be able to build the provider locally from HEAD of the repository and it will contain this fix. More instruction on how to use local providers.

@thameezb
Copy link

4.38.0 has been released, and the issue still persists on both node_pool_defaults and node_pool_auto_config. This has not been resolved

Apply output:


│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for module.cluster.google_container_cluster.cluster to include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/google-beta" produced an invalid new value for .node_pool_defaults: block count changed from 0 to 1.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for module.cluster.google_container_cluster.cluster to include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/google-beta" produced an invalid new value for .node_pool_auto_config: block count changed from 0 to 1.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

@hSATAC
Copy link

hSATAC commented Oct 3, 2022

I am also having this issue upgraded to 4.38.0

@shuyama1
Copy link
Collaborator

shuyama1 commented Oct 3, 2022

Thanks everyone for the feedback! I double checked our release plan. It looks like the fix is not released yet and it will be out in v4.39.0 later this afternoon as scheduled. Please try that after v4.39.0 is released and let me know if the error still occurs. Thanks!

@AtzeDeVries
Copy link

i still have simular issues

erraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.management-gke.google_container_cluster.gke will be updated in-place
  ~ resource "google_container_cluster" "gke" {
        id                          = "projects/management-gke-production-9ee5/locations/europe-north1/clusters/management-gke-prd"
        name                        = "management-gke-prd"
        # (28 unchanged attributes hidden)

      - node_pool_defaults {
        }

        # (24 unchanged blocks hidden)
    }

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

with 4.39

@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 Nov 13, 2022
@github-actions github-actions bot added service/container forward/review In review; remove label to forward labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.