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

API error with google_cloudbuild_worker_pool #11036

Closed
Clausewitz45 opened this issue Feb 4, 2022 · 13 comments
Closed

API error with google_cloudbuild_worker_pool #11036

Clausewitz45 opened this issue Feb 4, 2022 · 13 comments
Assignees
Labels
bug forward/review In review; remove label to forward service/cloudbuild

Comments

@Clausewitz45
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.1.4
on linux_amd64
+ provider registry.terraform.io/hashicorp/external v2.2.0
+ provider registry.terraform.io/hashicorp/google v4.7.0
+ provider registry.terraform.io/hashicorp/google-beta v4.7.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/vault v3.2.1

Affected Resource(s)

  • google_cloudbuild_worker_pool

Terraform Configuration Files

resource "google_cloudbuild_worker_pool" "tools_image_provisioning_private_pool" {
  project = var.tools_name
  name = "image-provisioning-private-pool"
  location = var.default_region

  worker_config {
    disk_size_gb   = 100
    machine_type   = "e2-medium"
    no_external_ip = false
  }

  network_config {
    peered_network = google_compute_network.tools_vpc.id
  }

  depends_on = [google_service_networking_connection.tools_vpc_gcp_services_network_connection]

}

Expected Behavior

Create or update the given google_cloudbuild_worker_pool resource

Actual Behavior

After running the terraform apply during creation/modification we got the following error:

google_cloudbuild_worker_pool.tools_image_provisioning_private_pool: Modifying... [id=projects/tools/locations/europe-west1/workerPools/image-provisioning-private-pool]
╷
│ Error: Error updating WorkerPool: infeasible update: ({true <nil>}) would require recreation
│
│   with google_cloudbuild_worker_pool.tools_image_provisioning_private_pool,
│   on project_tools_cloudbuild_private-pool.tf line 17, in resource "google_cloudbuild_worker_pool" "tools_image_provisioning_private_pool":
│   17: resource "google_cloudbuild_worker_pool" "tools_image_provisioning_private_pool" {
│
╵

Steps to Reproduce

We gave a try with manually create the resource and import it, delete the resource and then re-create it but the error is always the same.

  1. terraform apply
@slevenick
Copy link
Collaborator

Huh, that's worrying. Can you provide the debug logs for the terraform apply that produces the error? I'm guessing somehow the state in the API is significantly different than that of your config. Definitely a bug that needs to be fixed, I just want to see what exactly is causing this to happen

@slevenick
Copy link
Collaborator

Also the terraform plan that is produced for the apply that causes the error would be helpful. Is this on new resource creation or modifying an existing resource?

@Clausewitz45
Copy link
Author

Sorry for the late answer. I can provide the debug file tomorrow.

We had no error during the terraform plan, only during the apply phase. We gave a try for multiple scenarios, and we got the error in each case:

  • new resource creation - we got the error but the resource was created
  • we try to modify the resource, same error but the resource was not modified - it remained the same as we created
  • then we deleted the resource, and then re-created, same behavior

@slevenick
Copy link
Collaborator

Hm, ok I'll wait for the debug logs. What does the terraform plan output in this case? Is it trying to update certain fields on the resource?

I'm unable to reproduce this with the given config file so it's a little hard for me to track down!

@Clausewitz45
Copy link
Author

During the creation of the resource, the plan output showed a new resource entry: according to our definition (I'll provide tomorrow the full definition of resources around it), during the modification, the plan output showed only the modified field (in our case the instance size changed). We had no issue during the plan phase in all scenarios, outputs were fine. Tomorrow I will provide the debug log, all resource definitions around it, and output for both plan and apply.

@Clausewitz45
Copy link
Author

Hi @slevenick - I need to ask two more days, I'm on sick leave, I don't have access right now. Sorry for the delay, I'll be back on Wednesday.

@bharathkkb
Copy link

I also ran into this

  # module.example.module.cloudbuild_private_pool.google_cloudbuild_worker_pool.pool will be updated in-place
  ~ resource "google_cloudbuild_worker_pool" "pool" {
        id          = "projects/PROJECT_ID/locations/us-central1/workerPools/private-cluster-example-workerpool"
        name        = "private-cluster-example-workerpool"
        # (7 unchanged attributes hidden)


      ~ worker_config {
          ~ no_external_ip = true -> false
            # (2 unchanged attributes hidden)
        }
        # (1 unchanged block hidden)
    }
│ Error: Error updating WorkerPool: infeasible update: ({true <nil>}) would require recreation

Will try to reproduce this standalone as its currently in a module.

@Clausewitz45
Copy link
Author

Clausewitz45 commented Mar 14, 2022

Hi @slevenick , sorry for being away a lot - this wasn't a joyride. Please see the logs attached for all three use cases:

  • create resource: plan/apply
  • modify resource: plan/apply (the error can be seen here - creation/deletion of the resource works fine)
  • delete resource: plan/apply

tflog.tar.gz

@slevenick
Copy link
Collaborator

Thanks for those. I have a suspicion that this may be resolved in 4.14.0 when that is released either today or tomorrow. It upgrades the library we are using to actuate this resource, which may fix the problem.

When that releases can you confirm that you can reproduce this on that version?

@Clausewitz45
Copy link
Author

I'm going to do the upgrade to the latest, and then I'll check and give a feedback immediately. Thank you

@slevenick
Copy link
Collaborator

4.14.0 is out, you should be able to try it now

@Clausewitz45
Copy link
Author

Hi @slevenick, I can confirm that the issue is gone with 4.14.0. Many thanks for the help, I'm closing the ticket.

@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 Apr 15, 2022
@github-actions github-actions bot added service/cloudbuild 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.
Labels
bug forward/review In review; remove label to forward service/cloudbuild
Projects
None yet
Development

No branches or pull requests

3 participants