kubernetes/kops · error
failed to extract flavors: %v
Error message
failed to extract flavors: %v
What it means
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.
Source
Thrown at upup/pkg/fi/cloudup/openstack/instance.go:385
return instances, wait.ErrWaitTimeout
}
}
func (c *openstackCloud) GetFlavor(name string) (*flavors.Flavor, error) {
return getFlavor(c, name)
}
func getFlavor(c OpenstackCloud, name string) (*flavors.Flavor, error) {
opts := flavors.ListOpts{}
pager := flavors.ListDetail(c.ComputeClient(), opts)
page, err := pager.AllPages(context.TODO())
if err != nil {
return nil, fmt.Errorf("failed to list flavors: %v", err)
}
fs, err := flavors.ExtractFlavors(page)
if err != nil {
return nil, fmt.Errorf("failed to extract flavors: %v", err)
}
for _, f := range fs {
if f.Name == name {
return &f, nil
}
}
return nil, fmt.Errorf("could not find flavor with name %v", name)
}
View on GitHub (pinned to 4c8573c808)
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
Defensive patterns
Strategy: retry
Try / catch
f, err := GetFlavor(cloud, name)
if err != nil && strings.Contains(err.Error(), "failed to extract flavors") {
log.Printf("flavor response unparseable; retrying once")
f, err = GetFlavor(cloud, name)
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Non-standard OpenStack distributions with altered flavor payloads; intermediary proxies injecting HTML error content; stale gophercloud client incompatible with the cloud's API microversion.
Related errors
- error extracting servers from pages: %v
- failed to extract storage availability zones: %v
- error building cinder client: %w
- error building neutron client: %w
- error building nova client: %w
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/1aae81595ff08fd0.
Report an issue: GitHub.