{"record":{"id":"2b38f30c574dc32e","repo":"kubernetes/kops","slug":"failed-to-list-flavors-v","errorCode":null,"errorMessage":"failed to list flavors: %v","messagePattern":"failed to list flavors: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/instance.go","lineNumber":380,"sourceCode":"\tif err != nil {\n\t\treturn instances, err\n\t} else if done {\n\t\treturn instances, nil\n\t} else {\n\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":362,"sourceCodeEnd":395,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/instance.go#L362-L395","documentation":"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.","triggerScenarios":"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).","commonSituations":"Expired OpenStack credentials; the project's policy disallows listing flavors (common in hardened deployments); compute service endpoint misconfigured in the catalog.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// confirm credentials and flavor visibility before resolving\nflavors, err := osCLI.ComputeClient().FlavorList() // or `openstack flavor list`\nif err != nil { return err } // auth/endpoint problem found early","typeGuard":null,"tryCatchPattern":"f, err := GetFlavor(cloud, name)\nif err != nil && strings.Contains(err.Error(), \"failed to list flavors\") {\n    // transient — retry with backoff\n    time.Sleep(5 * time.Second)\n    f, err = GetFlavor(cloud, name)\n}","preventionTips":["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"],"tags":["openstack","nova","flavors","api"],"backgroundTag":"openstack-api-call-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"}