{"record":{"id":"1aae81595ff08fd0","repo":"kubernetes/kops","slug":"failed-to-extract-flavors-v","errorCode":null,"errorMessage":"failed to extract flavors: %v","messagePattern":"failed to extract flavors: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/instance.go","lineNumber":385,"sourceCode":"\t\treturn instances, wait.ErrWaitTimeout\n\t}\n}\n\nfunc (c *openstackCloud) GetFlavor(name string) (*flavors.Flavor, error) {\n\treturn getFlavor(c, name)\n}\n\nfunc getFlavor(c OpenstackCloud, name string) (*flavors.Flavor, error) {\n\topts := flavors.ListOpts{}\n\tpager := flavors.ListDetail(c.ComputeClient(), opts)\n\tpage, err := pager.AllPages(context.TODO())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list flavors: %v\", err)\n\t}\n\n\tfs, err := flavors.ExtractFlavors(page)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to extract flavors: %v\", err)\n\t}\n\tfor _, f := range fs {\n\t\tif f.Name == name {\n\t\t\treturn &f, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"could not find flavor with name %v\", name)\n}\n","sourceCodeStart":367,"sourceCodeEnd":395,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/instance.go#L367-L395","documentation":"getFlavor returns this error when flavors.ExtractFlavors fails to decode the flavor listing pages returned by Nova. The API call succeeded, but gophercloud could not extract []flavors.Flavor from the response body.","triggerScenarios":"flavors.ExtractFlavors errors on malformed or unexpected JSON — e.g. a proxy returning non-JSON bodies, a custom OpenStack flavor response schema, or SDK version mismatch between kops' gophercloud and the cloud release.","commonSituations":"Non-standard OpenStack distributions with altered flavor payloads; intermediary proxies injecting HTML error content; stale gophercloud client incompatible with the cloud's API microversion.","solutions":["Inspect the raw flavor-list response from the compute endpoint to see the actual body","Remove/fix any proxy between the client and Nova that may corrupt the response","Update gophercloud (and kops) to a version compatible with your OpenStack release"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"f, err := GetFlavor(cloud, name)\nif err != nil && strings.Contains(err.Error(), \"failed to extract flavors\") {\n    log.Printf(\"flavor response unparseable; retrying once\")\n    f, err = GetFlavor(cloud, name)\n}","preventionTips":["Keep gophercloud/kops versions compatible with the target OpenStack release","Remove response-mutating proxies from the API path","Verify `openstack flavor list -f json` returns valid JSON from the same network","Report custom distribution schema deviations upstream"],"tags":["openstack","gophercloud","flavors","response-parsing"],"backgroundTag":"api-response-parse-failed","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"}