{"record":{"id":"a8a19f0c91cdd03f","repo":"kubernetes/kops","slug":"could-not-list-flavors-v","errorCode":null,"errorMessage":"Could not list flavors: %v","messagePattern":"Could not list flavors: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/utils.go","lineNumber":64,"sourceCode":"\tif s[i].VCPUs < s[j].VCPUs {\n\t\treturn true\n\t}\n\tif s[i].VCPUs > s[j].VCPUs {\n\t\treturn false\n\t}\n\treturn s[i].RAM < s[j].RAM\n}\n\nfunc (c *openstackCloud) DefaultInstanceType(cluster *kops.Cluster, ig *kops.InstanceGroup) (string, error) {\n\treturn defaultInstanceType(c, cluster, ig)\n}\n\nfunc defaultInstanceType(c OpenstackCloud, cluster *kops.Cluster, ig *kops.InstanceGroup) (string, error) {\n\tflavorPage, err := flavors.ListDetail(c.ComputeClient(), flavors.ListOpts{\n\t\tMinRAM: 1024,\n\t}).AllPages(context.TODO())\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Could not list flavors: %v\", err)\n\t}\n\tvar fList flavorList\n\tfList, err = flavors.ExtractFlavors(flavorPage)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Could not extract flavors: %v\", err)\n\t}\n\tsort.Sort(&fList)\n\n\tvar candidates flavorList\n\tswitch {\n\tcase ig.Spec.Role.HasControlPlane():\n\t\t// Requirements based on awsCloudImplementation.DefaultInstanceType\n\t\tfor _, flavor := range fList {\n\t\t\tif flavor.RAM >= 4096 && flavor.VCPUs >= 1 {\n\t\t\t\tcandidates = append(candidates, flavor)\n\t\t\t}\n\t\t}\n","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/utils.go#L46-L82","documentation":"defaultInstanceType lists Nova flavors with flavors.ListDetail (MinRAM 1024) and inspects them to pick a default instance type for an instance group. If the flavors list call fails, the error is wrapped as \"Could not list flavors: %v\". This blocks instance group creation/defaulting entirely.","triggerScenarios":"Nova compute API unreachable, auth/401 failure on the compute client, or the AllPages pagination call rejected by the server (bad ListOpts such as MinRAM).","commonSituations":"Compute service outage, wrong region/endpoint for the compute client, expired credentials, or an OpenStack deployment whose flavor listing requires admin privileges.","solutions":["Verify `openstack flavor list` succeeds with the same credentials","Check the wrapped error: 401 => re-auth, 403 => policy allows flavor listing, timeout => compute service/endpoint","Set the instance type explicitly in the instance group spec (machineType) to skip flavor discovery","Confirm the compute service endpoint in the Keystone catalog matches the region"],"exampleFix":"// before\nspec:\n  machineType: \"\"\n// after: pin the flavor to avoid discovery failure\nspec:\n  machineType: m1.xlarge","handlingStrategy":"try-catch","validationCode":"// Pre-flight: confirm nova flavor listing works\nif err := exec.Command(\"openstack\", \"flavor\", \"list\", \"--limit\", \"1\").Run(); err != nil {\n\tlog.Fatal(\"Nova compute API unreachable or flavors not listable\")\n}","typeGuard":"func isAuthErr(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"Authentication failed\")\n}","tryCatchPattern":"machineType, err := DefaultInstanceType(cloud, cluster, ig)\nif err != nil {\n\tif strings.Contains(err.Error(), \"Could not list flavors\") {\n\t\t// fall back to an explicit machineType from the spec\n\t\tmachineType = ig.Spec.MachineType\n\t}\n\treturn err\n}","preventionTips":["Set machineType explicitly in instance group specs to skip flavor discovery","Keep compute credentials and region configuration current","Monitor Nova service health","Confirm flavor-list permission for the project's service account"],"tags":["openstack","nova","flavors","instance-type"],"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"}