kubernetes/kops · error

error finding instance info for instance type %q: %w

Error message

error finding instance info for instance type %q: %w

What it means

MachineArchitecture queries the AWS EC2 API (DescribeInstanceType) to learn the CPU architecture of the requested instance type; when that call fails, this wrapped error is returned. It is an AWS API failure (throttling, permissions, invalid type name, connectivity), not a kops logic error.

Source

Thrown at upup/pkg/fi/cloudup/new_cluster.go:1750

	return "", fmt.Errorf("unable to determine default image for cloud provider %q and architecture %q", cluster.GetCloudProvider(), architecture)
}

func MachineArchitecture(cloud fi.Cloud, machineType string) (architectures.Architecture, error) {
	if machineType == "" {
		return architectures.ArchitectureAmd64, nil
	}

	// Some calls only have AWS initialised at this point and in other cases pass in nil as cloud.
	if cloud == nil {
		return architectures.ArchitectureAmd64, nil
	}

	switch cloud.ProviderID() {
	case api.CloudProviderAWS:
		info, err := cloud.(awsup.AWSCloud).DescribeInstanceType(machineType)
		if err != nil {
			return "", fmt.Errorf("error finding instance info for instance type %q: %w", machineType, err)
		}
		if info.ProcessorInfo == nil || len(info.ProcessorInfo.SupportedArchitectures) == 0 {
			return "", fmt.Errorf("unable to determine architecture info for instance type %q", machineType)
		}
		var unsupported []ec2types.ArchitectureType
		for _, arch := range info.ProcessorInfo.SupportedArchitectures {
			// Return the first found supported architecture, in order of popularity
			switch arch {
			case ec2types.ArchitectureTypeX8664:
				return architectures.ArchitectureAmd64, nil
			case ec2types.ArchitectureTypeArm64:
				return architectures.ArchitectureArm64, nil
			default:
				unsupported = append(unsupported, arch)
			}
		}
		return "", fmt.Errorf("unsupported architecture for instance type %q: %v", machineType, unsupported)
	default:

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify the instance type name is a real EC2 type (e.g. t3.medium)
  2. Ensure the credentials/role have ec2:DescribeInstanceType permission
  3. Retry on throttling — kops vfs backoff may not cover this call; add retry or reduce call rate
  4. Check EC2 endpoint connectivity/proxy settings

Example fix

// before
--instance-type=t3.meduim
// after
--instance-type=t3.medium
Defensive patterns

Strategy: retry

Validate before calling

// pre-check instance type exists via your own DescribeInstanceType call
_, err := ec2Client.DescribeInstanceTypes(&ec2.DescribeInstanceTypesInput{
    InstanceTypes: []ec2types.InstanceType{ec2types.InstanceType(machineType)},
})

Try / catch

if err != nil {
    if throttled(err) {
        time.Sleep(backoff)
        // retry
    }
    return fmt.Errorf("validate instance type %s: %w", machineType, err)
}

Prevention

When it happens

Trigger: `kops create cluster --instance-type <type>` on AWS where DescribeInstanceType returns an error: instance type name misspelled, EC2 API throttling, missing ec2:DescribeInstanceType IAM permission, or network issues.

Common situations: Typo like t3.meduim; API rate limiting during batch operations; restricted IAM policies in CI; VPC without internet egress to EC2 endpoints.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/4ac77fdb4b235105. Report an issue: GitHub.