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

Failing test(s): TestAccComputeNetworkPeeringRoutesConfig_networkPeeringRoutesConfigGkeExample #18661

Open
SarahFrench opened this issue Jul 4, 2024 · 2 comments

Comments

@SarahFrench
Copy link
Member

SarahFrench commented Jul 4, 2024

Impacted tests

  • TestAccComputeNetworkPeeringRoutesConfig_networkPeeringRoutesConfigGkeExample

Affected Resource(s)

  • google_compute_network_peering_routes_config

Failure rates

  • 100% since 2024-06-10

Message(s)

------- Stdout: -------
=== RUN   TestAccComputeNetworkPeeringRoutesConfig_networkPeeringRoutesConfigGkeExample
=== PAUSE TestAccComputeNetworkPeeringRoutesConfig_networkPeeringRoutesConfigGkeExample
=== CONT  TestAccComputeNetworkPeeringRoutesConfig_networkPeeringRoutesConfigGkeExample
    vcr_utils.go:152: Step 1/2 error: Error running apply: exit status 1
        Error: Error creating NetworkPeeringRoutesConfig: googleapi: Error 400: Required field '' not specified, required
          with google_compute_network_peering_routes_config.peering_gke_routes,
          on terraform_plugin_test.tf line 2, in resource "google_compute_network_peering_routes_config" "peering_gke_routes":
           2: resource "google_compute_network_peering_routes_config" "peering_gke_routes" {
--- FAIL: TestAccComputeNetworkPeeringRoutesConfig_networkPeeringRoutesConfigGkeExample (651.37s)
FAIL

Nightly build test history

b/351842933

@SarahFrench
Copy link
Member Author

The problem is triggered by a PATCH request:

---[ REQUEST ]---------------------------------------
PATCH /compute/v1/projects/PROJECT_ID/global/networks/tf-test-container-network9r1vqd63hs/updatePeering?alt=json HTTP/1.1
Host: compute.googleapis.com
User-Agent: Terraform/1.8.3 (+https://www.terraform.io) Terraform-Plugin-SDK/2.33.0 terraform-provider-google/dev
Content-Length: 73
Content-Type: application/json
Accept-Encoding: gzip

{
 "networkPeering": {
  "exportCustomRoutes": true,
  "importCustomRoutes": true
 }
}

-----------------------------------------------------
2024/07/04 10:35:22 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 400 Bad Request
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Thu, 04 Jul 2024 10:35:22 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "error": {
    "code": 400,
    "message": "Required field '' not specified",
    "errors": [
      {
        "message": "Required field '' not specified",
        "domain": "global",
        "reason": "required"
      }
    ]
  }
}


@SarahFrench
Copy link
Member Author

SarahFrench commented Jul 4, 2024

That PATCH request should contain the name field. Because the test gets the name value by referencing google_container_cluster.private_cluster.private_cluster_config[0].peering_name, the problem may be that the value it's referencing isn't always guaranteed and can be "" sometimes.

In debug logs for the test I can see that the API description of the GKE cluster, where the peering name should come from, doesn't include a peering name:

{
 "name": "tf-test-private-clusteru6xc6a47vi",
 "initialNodeCount": 1,
 "nodeConfig": { ... }
  ...
 "privateClusterConfig": {
  "enablePrivateNodes": true,
  "enablePrivateEndpoint": true,
  "masterIpv4CidrBlock": "10.42.0.0/28",
  "privateEndpoint": "10.42.0.2",
  "publicEndpoint": "35.223.193.33"
  ...
 },

Maybe this GitHub issue should represent a problem with the google_container_cluster resource instead of google_compute_network_peering_routes_config?

@BBBmau BBBmau added this to the Goals milestone Jul 8, 2024
@BBBmau BBBmau added test-failure-100 100% fail rate size/xs and removed forward/review In review; remove label to forward labels Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants