{"record":{"id":"ce88fb3c369e96f9","repo":"kubernetes/kops","slug":"natgateway-q-has-no-addresses","errorCode":null,"errorMessage":"NatGateway %q has no addresses","messagePattern":"NatGateway %q has no addresses","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/elastic_ip.go","lineNumber":84,"sourceCode":"}\n\n// find will attempt to look up the elastic IP from AWS\nfunc (e *ElasticIP) find(ctx context.Context, cloud awsup.AWSCloud) (*ElasticIP, error) {\n\tpublicIP := e.PublicIP\n\tallocationID := e.ID\n\n\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\"))","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/elastic_ip.go#L66-L102","documentation":"While resolving an ElasticIP through its AssociatedNatGatewayRouteTable, the located NAT Gateway reports zero NatGatewayAddresses, so no allocation ID can be extracted; the gateway is likely still provisioning or misconfigured.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/elastic_ip.go:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait until the NAT Gateway reaches the available state and re-run `kops update`","Recreate the NAT Gateway if it is stuck in a failed/pending state"],"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"}