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): TestAccComputeResizeRequest_computeMigResizeRequestExample #19917

Closed
SarahFrench opened this issue Oct 18, 2024 · 4 comments
Closed

Comments

@SarahFrench
Copy link
Member

SarahFrench commented Oct 18, 2024

Impacted tests

  • TestAccComputeResizeRequest_computeMigResizeRequestExample

Affected Resource(s)

  • google_compute_resize_request

Failure rates

  • 100% (1 failed out of last 1 runs) as of 2024-10-18

The test only fails if the test environment causes the resize to fail, but in situations where the resize fails this panic will always occur. I'll label the issue as 100% failure.

Message(s)

Panic from flattenComputeResizeRequestStatusLastAttemptErrorErrors

See builds where this happened:

panic: interface conversion: interface {} is []interface {}, not map[string]interface {}
    
    goroutine 1162 [running]:
    github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute.flattenComputeResizeRequestStatusLastAttemptErrorErrors({0x417a520?, 0xc0018cb578?}, 0x4b7a7d4?, 0x6?)
      /foo/google-beta/services/compute/resource_compute_resize_request.go:1049 +0x2f8
    github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute.flattenComputeResizeRequestStatusLastAttemptError({0x446e9c0?, 0xc001bef4a0}, 0x4b79346?, 0x5?)
      /foo/google-beta/services/compute/resource_compute_resize_request.go:1042 +0xa5
    github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute.flattenComputeResizeRequestStatusLastAttempt({0x446e9c0?, 0xc001bef470}, 0x4b87240?, 0xb?)
      /foo/google-beta/services/compute/resource_compute_resize_request.go:1029 +0xa5
    github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute.flattenComputeResizeRequestStatus({0x446e9c0?, 0xc001bef440}, 0x4b7a65a?, 0x6?)
      /foo/google-beta/services/compute/resource_compute_resize_request.go:792 +0x133
    github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute.resourceComputeResizeRequestRead(0xc00240ee00, {0x4b46640?, 0xc001b83800})
      /foo/google-beta/services/compute/resource_compute_resize_request.go:609 +0x833
    github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute.resourceComputeResizeRequestCreate(0xc00240ee00, {0x4b46640?, 0xc001b83800?})
      /foo/google-beta/services/compute/resource_compute_resize_request.go:546 +0xee5
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x55e1640?, {0x55e1640?, 0xc001bbb1a0?}, 0xd?, {0x4b46640?, 0xc001b83800?})
      /foo/go/1.21.13/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:766 +0x163
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000a72c40, {0x55e1640, 0xc001bbb1a0}, 0xc0018d92b0, 0xc002f1bf00, {0x4b46640, 0xc001b83800})
      /foo/go/1.21.13/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:909 +0xa89
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc001f82b28, {0x55e1640?, 0xc001bbb110?}, 0xc001234d70)
      /foo/go/1.21.13/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1078 +0xdbc
    github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0x55e1678?, {0x55e1640?, 0xc001bbae70?}, 0xc001234d70)
      /foo/go/1.21.13/pkg/mod/github.com/hashicorp/[email protected]/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x193
    github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00217c960, {0x55e1640?, 0xc001bba660?}, 0xc0018b8690)
      /foo/go/1.21.13/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:865 +0x3d0
    github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x4ade900?, 0xc00217c960}, {0x55e1640, 0xc001bba660}, 0xc002f1bc00, 0x0)
      /foo/go/1.21.13/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x169
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000d9c00, {0x55e1640, 0xc001bba5d0}, {0x55ed968, 0xc0001cc780}, 0xc0018c4a20, 0xc001cee8a0, 0x7964318, 0x0)
      /foo/go/1.21.13/pkg/mod/google.golang.org/[email protected]/server.go:1379 +0xe23
    google.golang.org/grpc.(*Server).handleStream(0xc0000d9c00, {0x55ed968, 0xc0001cc780}, 0xc0018c4a20)
      /foo/go/1.21.13/pkg/mod/google.golang.org/[email protected]/server.go:1790 +0x1016
    google.golang.org/grpc.(*Server).serveStreams.func2.1()
      /foo/go/1.21.13/pkg/mod/google.golang.org/[email protected]/server.go:1029 +0x8b
    created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 700
      /foo/go/1.21.13/pkg/mod/google.golang.org/[email protected]/server.go:1040 +0x135

Nightly build test history

b/374273746

@SarahFrench
Copy link
Member Author

SarahFrench commented Oct 18, 2024

From one of the builds I link above under Message(s) I can see this is the API's response that's involved in the panic:

---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Thu, 17 Oct 2024 11:28:24 GMT
Etag: FSCrXwsrOtLCc3VHT4XIoalk4Sc=/WsmFvTzbKjzpmuH1ByKk-49cc_E=
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "kind": "compute#instanceGroupManagerResizeRequest",
  "id": "9113303207974357537",
  "creationTimestamp": "2024-10-17T04:28:14.344-07:00",
  "name": "tf-test-a3-dwsgbbsro3e6z",
  "description": "Test resize request resource",
  "zone": "https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/us-central1-a",
  "resizeBy": 2,
  "requestedRunDuration": {
    "seconds": "14400",
    "nanos": 0
  },
  "state": "ACCEPTED",
  "status": {
    "lastAttempt": {
      "error": {
        "errors": [
          {
            "code": "ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS",
            "message": "Waiting for resources. Currently there are not enough resources available to fulfill the request."
          }
        ]
      }
    }
  },
  "selfLink": "https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/us-central1-a/instanceGroupManagers/a3-dws/resizeRequests/tf-test-a3-dwsgbbsro3e6z",
  "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/us-central1-a/instanceGroupManagers/a3-dws/resizeRequests/9113303207974357537"
}

It looks like the error.errors field is currently defined as a single nested object instead of a list of objects.

@SarahFrench
Copy link
Member Author

Note: the person addressing this issue might also address #19918 at the same time.

@SarahFrench SarahFrench removed the forward/review In review; remove label to forward label Oct 18, 2024
@SarahFrench SarahFrench added the test-failure-100 100% fail rate label Oct 18, 2024
@rileykarson rileykarson added this to the Goals milestone Nov 4, 2024
@melinath
Copy link
Collaborator

melinath commented Nov 8, 2024

This is now failing with the error:

        Error: Error creating RegionInstanceTemplate: googleapi: Error 409: The resource 'projects/ci-test-project-nightly-ga/regions/us-central1/instanceTemplates/a3-dws' already exists, alreadyExists

In addition to fixing the panic, the test needs to use variables properly to get a tf-test prefix and random suffix used in all resource names as described on https://googlecloudplatform.github.io/magic-modules/develop/test/test/

@melinath
Copy link
Collaborator

Resolved by GoogleCloudPlatform/magic-modules#12578

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

4 participants