{"record":{"id":"35aa67fc3d473dd9","repo":"kubernetes/kops","slug":"found-multiple-akamai-linode-vpc-subnets-named","errorCode":null,"errorMessage":"found multiple Akamai (Linode) VPC Subnets named %q","messagePattern":"found multiple Akamai \\(Linode\\) VPC Subnets named %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/linodetasks/subnet.go","lineNumber":79,"sourceCode":"\t\t\treturn nil, fi.NewTryAgainLaterError(\"waiting for VPC ID\")\n\t\t}\n\t\treturn nil, fmt.Errorf(\"Subnet.VPC.ID is required\")\n\t}\n\n\tsubnets, err := cloud.Client().ListVPCSubnets(c.Context(), fi.ValueOf(v.VPC.ID), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing Akamai (Linode) VPC Subnets: %w\", err)\n\t}\n\n\tvar foundByName *linodego.VPCSubnet\n\tvar foundByIPv4 *linodego.VPCSubnet\n\tname := fi.ValueOf(v.Name)\n\tipv4 := fi.ValueOf(v.IPv4)\n\tfor i := range subnets {\n\t\tcandidate := &subnets[i]\n\t\tif candidate.Label == name {\n\t\t\tif foundByName != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"found multiple Akamai (Linode) VPC Subnets named %q\", name)\n\t\t\t}\n\t\t\tfoundByName = candidate\n\t\t}\n\t\tif ipv4 != \"\" && candidate.IPv4 == ipv4 {\n\t\t\tif foundByIPv4 == nil {\n\t\t\t\tfoundByIPv4 = candidate\n\t\t\t}\n\t\t}\n\t}\n\n\tfound := foundByName\n\tif found == nil {\n\t\tfound = foundByIPv4\n\t\tif found == nil {\n\t\t\treturn nil, nil\n\t\t}\n\t}\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/linodetasks/subnet.go#L61-L97","documentation":"Find() matches subnets within the VPC by label. Linode apparently allows duplicate labels within a VPC, so if two subnets share the requested label the match is ambiguous and Find() refuses to choose.","triggerScenarios":"Two or more subnets in the same VPC have candidate.Label equal to the requested subnet name when Find() scans ListVPCSubnets results.","commonSituations":"Subnets created manually or by a previous aborted run with the same label, or operators reusing names across clusters sharing one VPC.","solutions":["Rename or delete duplicate subnets in the Linode Cloud Manager / linode-cli so only one has that label","Use unique subnet names per cluster even when sharing a VPC","Match by IPv4 instead by setting the subnet's IPv4 in the spec (Find also matches by ipv4)","Delete leftover subnets from aborted cluster creates"],"exampleFix":"// before: two subnets labeled 'subnet-1' in one VPC\n// after\n//   linode-cli vpcs-subnets list <vpc-id>\n//   linode-cli vpcs-subnets delete <vpc-id> <duplicate-subnet-id>","handlingStrategy":"validation","validationCode":"subs, _ := client.ListVPCSubnets(ctx, vpcID, nil)\nn := 0\nfor _, s := range subs {\n    if s.Label == name { n++ }\n}\nif n > 1 { return fmt.Errorf(\"%d duplicate subnet labels for %q in VPC %d\", n, name, vpcID) }","typeGuard":"func uniqueSubnet(subs []linodego.VPCSubnet, name string) *linodego.VPCSubnet {\n    var m *linodego.VPCSubnet\n    for i := range subs {\n        if subs[i].Label != name { continue }\n        if m != nil { return nil }\n        m = &subs[i]\n    }\n    return m\n}","tryCatchPattern":null,"preventionTips":["Use globally unique subnet names per VPC/cluster","Delete leftovers from aborted creates","Prefer matching by IPv4 when labels may collide"],"tags":["linode","akamai","subnet","duplicate-resource","vpc"],"backgroundTag":"duplicate-resource-name","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"}