{"record":{"id":"36d815f9f719c27d","repo":"kubernetes/kops","slug":"failed-to-find-instance-type-details-on-s-error","errorCode":null,"errorMessage":"failed to find instance type details on: %s, error: %s","messagePattern":"failed to find instance type details on: (.+?), error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/helper.go","lineNumber":34,"sourceCode":"\npackage awstasks\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\tec2types \"github.com/aws/aws-sdk-go-v2/service/ec2/types\"\n\t\"k8s.io/kops/upup/pkg/fi/cloudup/awsup\"\n)\n\n// buildEphemeralDevices looks up the machine type and discovery any ephemeral device mappings\nfunc buildEphemeralDevices(cloud awsup.AWSCloud, machineType ec2types.InstanceType) (map[string]*BlockDeviceMapping, error) {\n\tif machineType == \"\" {\n\t\treturn nil, nil\n\t}\n\tmt, err := awsup.GetMachineTypeInfo(cloud, machineType)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to find instance type details on: %s, error: %s\", machineType, err)\n\t}\n\n\tblockDeviceMappings := make(map[string]*BlockDeviceMapping)\n\n\tfor _, ed := range mt.EphemeralDevices() {\n\t\tblockDeviceMappings[ed.DeviceName] = &BlockDeviceMapping{VirtualName: new(ed.VirtualName)}\n\t}\n\n\treturn blockDeviceMappings, nil\n}\n\n// buildAdditionalDevices is responsible for creating additional volumes in this lc\nfunc buildAdditionalDevices(volumes []*BlockDeviceMapping) (map[string]*BlockDeviceMapping, error) {\n\tdevices := make(map[string]*BlockDeviceMapping)\n\n\t// @step: iterate the volumes and create devices from them\n\tfor _, x := range volumes {\n\t\tif x.DeviceName == nil {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/helper.go#L16-L52","documentation":"buildEphemeralDevices resolves instance-type metadata (via awsup.GetMachineTypeInfo) to map ephemeral device names to block device mappings; when the machine type cannot be found in the instance-type metadata it returns this error. It means kOps has no topology data for the given ec2 InstanceType.","triggerScenarios":"GetMachineTypeInfo errors because the instance type string is unknown/unsupported in the bundled metadata (e.g. typo, new generation not yet in kOps' instance type data, or wrong region family).","commonSituations":"Typo in the machineType in the InstanceGroup spec; using a brand-new instance family on an older kOps release; custom fork with outdated aws-instance-types data.","solutions":["Fix the instance type name in the cluster/instance-group spec (check spelling and generation, e.g. m5.large).","Upgrade kOps to a release whose instance type metadata includes the new family.","If the type genuinely has no instance-store volumes, avoid relying on ephemeral device mappings (use EBS-backed storage)."],"exampleFix":"// before\nmachineType: m6a.larg\n// after\nmachineType: m6a.large","handlingStrategy":"validation","validationCode":"// Pre-check instance type against kops supported types\nkops get instancegroups --name <cluster> -o yaml | grep machineType\n# or validate locally before apply:\nmachineType=$(yq '.spec.machineType' ig.yaml)\naws ec2 describe-instance-types --instance-types \"$machineType\" >/dev/null || echo \"unknown instance type\"","typeGuard":"func validInstanceType(mt ec2types.InstanceType) bool {\n    return mt != \"\" && strings.Contains(string(mt), \".\") && len(strings.Split(string(mt), \".\")) == 2\n}","tryCatchPattern":null,"preventionTips":["Copy instance type names from AWS docs, never by hand","Upgrade kOps before adopting new EC2 instance families","Use EBS-backed instance groups to avoid ephemeral device mapping requirements"],"tags":["aws","ec2","instance-types","configuration"],"backgroundTag":"unknown-instance-type","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"}