{"record":{"id":"0d52791753692a28","repo":"kubernetes/kops","slug":"network-load-balancers-do-not-support-detaching-su","errorCode":null,"errorMessage":"network load balancers do not support detaching subnets","messagePattern":"network load balancers do not support detaching subnets","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/network_load_balancer.go","lineNumber":460,"sourceCode":"\t\t\t\t}\n\t\t\t\tif s.AllocationID != nil {\n\t\t\t\t\texpectedSubnets[subnetID] = s.AllocationID\n\t\t\t\t} else if s.PrivateIPv4Address != nil {\n\t\t\t\t\texpectedSubnets[subnetID] = s.PrivateIPv4Address\n\t\t\t\t} else {\n\t\t\t\t\texpectedSubnets[subnetID] = nil\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor _, s := range a.SubnetMappings {\n\t\t\t\tsubnetID := fi.ValueOf(s.Subnet.ID)\n\t\t\t\tif subnetID == \"\" {\n\t\t\t\t\treturn fmt.Errorf(\"Subnet ID is required for subnet name=%v\", fi.ValueOf(s.Subnet.Name))\n\t\t\t\t}\n\n\t\t\t\teIP, ok := expectedSubnets[subnetID]\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"network load balancers do not support detaching subnets\")\n\t\t\t\t}\n\t\t\t\tif fi.ValueOf(eIP) != fi.ValueOf(s.PrivateIPv4Address) || fi.ValueOf(eIP) != fi.ValueOf(s.AllocationID) {\n\t\t\t\t\treturn fmt.Errorf(\"network load balancers do not support modifying address settings\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (_ *NetworkLoadBalancer) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *NetworkLoadBalancer) error {\n\tctx := context.TODO()\n\n\tloadBalancerArn := \"\"\n\n\trevision := e.revision\n\n\ttags := maps.Clone(e.Tags)","sourceCodeStart":442,"sourceCodeEnd":478,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/network_load_balancer.go#L442-L478","documentation":"The existing NLB is attached to a subnet that is absent from the expected SubnetMappings; AWS NLBs do not support detaching subnets in place, so kOps rejects the change instead of leaving a divergent state.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/network_load_balancer.go:460 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-add the missing subnet to the cluster spec / NLB subnet mappings","Or recreate the NLB (delete and `kops update`) so it is built with only the desired subnets"],"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-12T07:17:12.445Z"}