{"record":{"id":"b896e915788e8780","repo":"kubernetes/kops","slug":"natgateway-q-has-nil-addresses","errorCode":null,"errorMessage":"NatGateway %q has nil addresses","messagePattern":"NatGateway %q has nil addresses","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/elastic_ip.go","lineNumber":91,"sourceCode":"\t// Find via RouteTable -> NatGateway -> ElasticIP\n\tif allocationID == nil && publicIP == nil && e.AssociatedNatGatewayRouteTable != nil {\n\t\tngw, err := findNatGatewayFromRouteTable(ctx, cloud, e.AssociatedNatGatewayRouteTable)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error finding AssociatedNatGatewayRouteTable: %v\", err)\n\t\t}\n\n\t\tif ngw == nil {\n\t\t\tklog.V(2).Infof(\"AssociatedNatGatewayRouteTable not found\")\n\t\t} else {\n\t\t\tif len(ngw.NatGatewayAddresses) == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"NatGateway %q has no addresses\", *ngw.NatGatewayId)\n\t\t\t}\n\t\t\tif len(ngw.NatGatewayAddresses) > 1 {\n\t\t\t\treturn nil, fmt.Errorf(\"NatGateway %q has multiple addresses\", *ngw.NatGatewayId)\n\t\t\t}\n\t\t\tallocationID = ngw.NatGatewayAddresses[0].AllocationId\n\t\t\tif allocationID == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"NatGateway %q has nil addresses\", *ngw.NatGatewayId)\n\t\t\t} else {\n\t\t\t\tklog.V(2).Infof(\"Found ElasticIP AllocationID %q via NatGateway\", *allocationID)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Find via tag on subnet\n\t// TODO: Deprecated, because doesn't round-trip with terraform\n\tif allocationID == nil && publicIP == nil && e.TagOnSubnet != nil && e.TagOnSubnet.ID != nil {\n\t\tvar filters []ec2types.Filter\n\t\tfilters = append(filters, awsup.NewEC2Filter(\"key\", \"AssociatedElasticIp\"))\n\t\tfilters = append(filters, awsup.NewEC2Filter(\"resource-id\", *e.TagOnSubnet.ID))\n\n\t\trequest := &ec2.DescribeTagsInput{\n\t\t\tFilters: filters,\n\t\t}\n\n\t\tresponse, err := cloud.EC2().DescribeTags(ctx, request)","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/elastic_ip.go#L73-L109","documentation":"A NAT Gateway was found via the associated route table, but its NatGatewayAddresses field is nil — AWS returned no address list — leaving kOps unable to select an allocation ID for the ElasticIP task.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/elastic_ip.go:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run once the NAT Gateway fully reports its addresses","Recreate the NAT Gateway if it never populates addresses"],"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"}