{"record":{"id":"175ef2ace313986f","repo":"kubernetes/kops","slug":"found-no-elasticips-for-v","errorCode":null,"errorMessage":"found no ElasticIPs for: %v","messagePattern":"found no ElasticIPs for: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/elastic_ip.go","lineNumber":140,"sourceCode":"\t\tpublicIP = t.Value\n\t\tklog.V(2).Infof(\"Found public IP via tag: %v\", *publicIP)\n\t}\n\n\tif publicIP != nil || allocationID != nil {\n\t\trequest := &ec2.DescribeAddressesInput{}\n\t\tif allocationID != nil {\n\t\t\trequest.AllocationIds = []string{fi.ValueOf(allocationID)}\n\t\t} else if publicIP != nil {\n\t\t\trequest.Filters = []ec2types.Filter{awsup.NewEC2Filter(\"public-ip\", *publicIP)}\n\t\t}\n\n\t\tresponse, err := cloud.EC2().DescribeAddresses(ctx, request)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error listing ElasticIPs: %v\", err)\n\t\t}\n\n\t\tif response == nil || len(response.Addresses) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"found no ElasticIPs for: %v\", e)\n\t\t}\n\n\t\tif len(response.Addresses) != 1 {\n\t\t\treturn nil, fmt.Errorf(\"found multiple ElasticIPs for: %v\", e)\n\t\t}\n\t\ta := response.Addresses[0]\n\t\tactual := &ElasticIP{\n\t\t\tID:       a.AllocationId,\n\t\t\tPublicIP: a.PublicIp,\n\t\t}\n\t\tactual.TagOnSubnet = e.TagOnSubnet\n\t\tactual.AssociatedNatGatewayRouteTable = e.AssociatedNatGatewayRouteTable\n\n\t\t{\n\t\t\ttags, err := cloud.EC2().DescribeTags(ctx, &ec2.DescribeTagsInput{\n\t\t\t\tFilters: []ec2types.Filter{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:   aws.String(\"resource-id\"),","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/elastic_ip.go#L122-L158","documentation":"After DescribeAddresses succeeds, if zero addresses are returned for the given allocation ID or public-ip filter, find() throws 'found no ElasticIPs for: %v'. kOps expects the EIP referenced by the task to exist; returning nil here would silently drop it, so it hard-fails reconciliation instead.","triggerScenarios":"The task has PublicIP or ID set (directly or discovered via NatGateway/TagOnSubnet), but DescribeAddresses matches no address: EIP was released, cluster spec edited to a non-existent IP, or the NGW-derived allocation ID points to a deleted NAT gateway address.","commonSituations":"Manually deleting an EIP in the AWS console while the cluster still references it; restoring a cluster spec from another account; changing regions; EIP released automatically after account/AWS service changes (e.g. EIPs of terminated NAT gateways).","solutions":["Confirm the EIP exists: aws ec2 describe-addresses --filters Name=public-ip,Values=<ip> or Name=allocation-id,Values=<eipalloc-id>","If the EIP was intentionally deleted, remove/replace the ElasticIP task in the cluster spec (kops edit cluster) and re-run kops update cluster --yes","If deleted unintentionally, allocate a new EIP and update the spec's PublicIP/ID accordingly","If discovered via TagOnSubnet, check the subnet's AssociatedElasticIp tag value with aws ec2 describe-tags"],"exampleFix":"// before: spec references released EIP\nPublicIP: fi.String(\"52.95.1.10\") // released\n// after: update to an existing allocated EIP\naws ec2 allocate-address --domain vpc\nPublicIP: fi.String(\"52.95.1.42\")","handlingStrategy":"validation","validationCode":"out, err := ec2Client.DescribeAddresses(ctx, &ec2.DescribeAddressesInput{\n    Filters: []ec2types.Filter{awsup.NewEC2Filter(\"public-ip\", declaredIP)},\n})\nif err != nil || len(out.Addresses) == 0 {\n    return fmt.Errorf(\"EIP %s does not exist; fix cluster spec before update\", declaredIP)\n}","typeGuard":null,"tryCatchPattern":"err := runKopsUpdate(ctx)\nif err != nil && strings.Contains(err.Error(), \"found no ElasticIPs\") {\n    // re-allocate EIP or update spec before retrying\n}","preventionTips":["Never delete EIPs referenced by the cluster without updating the spec first","Cross-check spec EIPs against `aws ec2 describe-addresses` before updates","Avoid manually editing PublicIP/ID across regions","Use `kops toolbox dump` to verify cloud state matches spec"],"tags":["aws","ec2","elastic-ip","not-found"],"backgroundTag":"aws-resource-not-found","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"}