{"record":{"id":"ecad58aa228b3768","repo":"kubernetes/kops","slug":"error-listing-instance-templates-v","errorCode":null,"errorMessage":"error listing instance templates: %v","messagePattern":"error listing instance templates: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gce/gce_cloud.go","lineNumber":384,"sourceCode":"\t\t}\n\n\t\tingresses = append(ingresses, fi.ApiIngressStatus{\n\t\t\tInternalEndpoint: internalEndpoint,\n\t\t\tIP:               forwardingRule.IPAddress,\n\t\t})\n\t}\n\n\treturn ingresses, nil\n}\n\n// FindInstanceTemplates finds all instance templates that are associated with the current cluster\n// It matches them by looking for instance metadata with key='cluster-name' and value of our cluster name\nfunc FindInstanceTemplates(c GCECloud, clusterName string) ([]*compute.InstanceTemplate, error) {\n\tfindClusterName := strings.TrimSpace(clusterName)\n\n\tts, err := c.Compute().InstanceTemplates().List(context.Background(), c.Project())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing instance templates: %v\", err)\n\t}\n\n\tvar matches []*compute.InstanceTemplate\n\tfor _, t := range ts {\n\t\tif !gcemetadata.MetadataMatchesClusterName(findClusterName, t.Properties.Metadata) {\n\t\t\tcontinue\n\t\t}\n\n\t\tmatches = append(matches, t)\n\t}\n\n\treturn matches, nil\n}\n\n// logTokenInfo returns information about the active credential\nfunc (c *gceCloudImplementation) getTokenInfo(ctx context.Context) (*oauth2.Tokeninfo, error) {\n\ttokenSource, err := google.DefaultTokenSource(ctx, compute.CloudPlatformScope)\n\tif err != nil {","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gce/gce_cloud.go#L366-L402","documentation":"Wraps the compute InstanceTemplates().List failure in FindInstanceTemplates, which locates a cluster's templates by cluster-name metadata. Fires when the list API call errors (permissions, quota, connectivity).","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gce/gce_cloud.go:384 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify compute.instanceTemplates.list permission","Check API quota and network access","Retry after transient failures"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}