{"record":{"id":"d591ae6044a9b3f1","repo":"kubernetes/kops","slug":"found-multiple-utility-subnets-in-zone-q","errorCode":null,"errorMessage":"found multiple utility subnets in zone: %q","messagePattern":"found multiple utility subnets in zone: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/awsmodel/context.go","lineNumber":78,"sourceCode":"\nfunc (b *AWSModelContext) LinkToUtilitySubnetInZone(zoneName string) (*awstasks.Subnet, error) {\n\tvar matches []*kops.ClusterSubnetSpec\n\tfor i := range b.Cluster.Spec.Networking.Subnets {\n\t\ts := &b.Cluster.Spec.Networking.Subnets[i]\n\t\tif s.Zone != zoneName {\n\t\t\tcontinue\n\t\t}\n\t\tif s.Type != kops.SubnetTypeUtility {\n\t\t\tcontinue\n\t\t}\n\t\tmatches = append(matches, s)\n\t}\n\tif len(matches) == 0 {\n\t\treturn nil, fmt.Errorf(\"could not find utility subnet in zone: %q\", zoneName)\n\t}\n\tif len(matches) > 1 {\n\t\t// TODO: Support this\n\t\treturn nil, fmt.Errorf(\"found multiple utility subnets in zone: %q\", zoneName)\n\t}\n\n\treturn b.LinkToSubnet(matches[0]), nil\n}\nfunc (b *AWSModelContext) LinkToPrivateSubnetsInZone(zoneName string) ([]*awstasks.Subnet, error) {\n\tvar matches []*kops.ClusterSubnetSpec\n\tfor i := range b.Cluster.Spec.Networking.Subnets {\n\t\ts := &b.Cluster.Spec.Networking.Subnets[i]\n\t\tif s.Zone != zoneName {\n\t\t\tcontinue\n\t\t}\n\t\tif s.Type != kops.SubnetTypePrivate {\n\t\t\tcontinue\n\t\t}\n\t\tmatches = append(matches, s)\n\t}\n\tif len(matches) == 0 {\n\t\treturn nil, fmt.Errorf(\"could not find private subnet in zone: %q\", zoneName)","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/awsmodel/context.go#L60-L96","documentation":"More than one Utility subnet is defined in the same availability zone; the AWS model builder supports at most one utility subnet per zone (a noted TODO) and cannot choose between duplicates.","triggerScenarios":"Thrown at pkg/model/awsmodel/context.go:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Consolidate to a single utility subnet per zone in the cluster spec","Remove or retype the duplicate utility subnet entries","Re-run kops update"],"exampleFix":null,"handlingStrategy":"validation","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-12T12:17:11.808Z"}