kubernetes/kops · error
failed to list flavors: %v
Error message
failed to list flavors: %v
What it means
getFlavor wraps errors from flavors.ListDetail(...).AllPages — the Nova flavor-listing API call — with this message. It is called by GetFlavor when kops needs to resolve an instance type (flavor) by name.
Source
Thrown at upup/pkg/fi/cloudup/openstack/instance.go:380
if err != nil {
return instances, err
} else if done {
return instances, nil
} else {
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
- Verify credentials and endpoint: `openstack flavor list` with the same credentials/clouds.yaml
- Fix authentication (refresh token / correct project) if a 401 is wrapped
- If 403, ask the cloud admin to grant the project permission to list flavors, or resolve the flavor ID manually
- Retry if it is a transient 5xx; readBackoff already retries internally
Defensive patterns
Strategy: retry
Validate before calling
// confirm credentials and flavor visibility before resolving
flavors, err := osCLI.ComputeClient().FlavorList() // or `openstack flavor list`
if err != nil { return err } // auth/endpoint problem found early Try / catch
f, err := GetFlavor(cloud, name)
if err != nil && strings.Contains(err.Error(), "failed to list flavors") {
// transient — retry with backoff
time.Sleep(5 * time.Second)
f, err = GetFlavor(cloud, name)
} Prevention
- Validate clouds.yaml/OS_* credentials before cluster operations
- Confirm the project can list flavors (RBAC) with a manual CLI check
- Treat 5xx from Nova as transient and retry
- Cache resolved flavors to reduce API churn
When it happens
Trigger: pager.AllPages fails during flavor listing: compute endpoint unreachable, token expired/invalid, or Nova flavor-list API returning an error (403 if policy forbids flavor listing for the project).
Common situations: Expired OpenStack credentials; the project's policy disallows listing flavors (common in hardened deployments); compute service endpoint misconfigured in the catalog.
Related errors
- error listing servers %v: %v
- Could not list flavors: %v
- error building nova client: %v
- error describing Network: %v
- no decernable storage availability zone could be mapped to c
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/2b38f30c574dc32e.
Report an issue: GitHub.