{"record":{"id":"19851ae83b6cb5a4","repo":"kubernetes/kops","slug":"error-associating-subnet-cidr-block-v","errorCode":null,"errorMessage":"error associating subnet cidr block: %v","messagePattern":"error associating subnet cidr block: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/subnet.go","lineNumber":296,"sourceCode":"\t\t\trequest.Ipv6Native = aws.Bool(true)\n\t\t}\n\n\t\tresponse, err := t.Cloud.EC2().CreateSubnet(ctx, request)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating subnet: %v\", err)\n\t\t}\n\n\t\te.ID = response.Subnet.SubnetId\n\t} else {\n\t\tif changes.IPv6CIDR != nil {\n\t\t\trequest := &ec2.AssociateSubnetCidrBlockInput{\n\t\t\t\tIpv6CidrBlock: e.IPv6CIDR,\n\t\t\t\tSubnetId:      e.ID,\n\t\t\t}\n\n\t\t\t_, err := t.Cloud.EC2().AssociateSubnetCidrBlock(ctx, request)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error associating subnet cidr block: %v\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\tif a == nil || changes.AssignIPv6AddressOnCreation != nil {\n\t\trequest := &ec2.ModifySubnetAttributeInput{\n\t\t\tSubnetId:                    e.ID,\n\t\t\tAssignIpv6AddressOnCreation: &ec2types.AttributeBooleanValue{Value: e.AssignIPv6AddressOnCreation},\n\t\t}\n\t\t_, err := t.Cloud.EC2().ModifySubnetAttribute(ctx, request)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error modifying AssignIPv6AddressOnCreation: %w\", err)\n\t\t}\n\t}\n\n\tif changes.ResourceBasedNaming != nil {\n\t\thostnameType := ec2types.HostnameTypeIpName\n\t\tif *changes.ResourceBasedNaming {","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/subnet.go#L278-L314","documentation":"AssociateSubnetCidrBlock failed while adding a new IPv6 CIDR to an existing subnet; typically the requested /64 is not available from the VPC's IPv6 address pool or already assigned elsewhere.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/subnet.go:296 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the VPC's IPv6 CIDR associations and pick a free /64","Ensure an Amazon-provided IPv6 block is associated with the VPC"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}