{"record":{"id":"51a7d3c53142f30f","repo":"kubernetes/kops","slug":"error-from-describeaddresses-v","errorCode":null,"errorMessage":"error from DescribeAddresses: %v","messagePattern":"error from DescribeAddresses: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/aws/aws.go","lineNumber":1418,"sourceCode":"\t\t\tnatGatewayId := aws.ToString(ngw.NatGatewayId)\n\n\t\t\tforceShared := !ownedNatGatewayIds.Has(natGatewayId)\n\t\t\tngwResource := buildNatGatewayResource(ngw, forceShared, clusterName)\n\t\t\tresourceTrackers = append(resourceTrackers, ngwResource)\n\n\t\t\t// Don't try to remove ElasticIPs if NatGateway is shared\n\t\t\tif ngwResource.Shared {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// If we're deleting the NatGateway, we should delete the ElasticIP also\n\t\t\tfor _, address := range ngw.NatGatewayAddresses {\n\t\t\t\tif address.AllocationId != nil {\n\t\t\t\t\trequest := &ec2.DescribeAddressesInput{}\n\t\t\t\t\trequest.AllocationIds = []string{aws.ToString(address.AllocationId)}\n\t\t\t\t\tresponse, err := c.EC2().DescribeAddresses(ctx, request)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"error from DescribeAddresses: %v\", err)\n\t\t\t\t\t}\n\n\t\t\t\t\tfor _, eip := range response.Addresses {\n\t\t\t\t\t\teipTracker := buildElasticIPResource(eip, !ownedNatGatewayIds.Has(natGatewayId), clusterName)\n\t\t\t\t\t\tresourceTrackers = append(resourceTrackers, eipTracker)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn resourceTrackers, nil\n}\n\n// DeleteAutoScalingGroupLaunchTemplate deletes\nfunc DeleteAutoScalingGroupLaunchTemplate(cloud fi.Cloud, r *resources.Resource) error {\n\tctx := context.TODO()\n\tc, ok := cloud.(awsup.AWSCloud)","sourceCodeStart":1400,"sourceCodeEnd":1436,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/aws/aws.go#L1400-L1436","documentation":"Thrown when EC2 DescribeAddresses fails while resolving the Elastic IP allocation attached to a NAT gateway address during FindNatGateways. The lookup is per allocation ID; failure aborts the entire listing including EIP discovery.","triggerScenarios":"DescribeAddresses with AllocationIds=[eipalloc-...] returns InvalidAllocationID.NotFound (EIP already released), UnauthorizedOperation, throttling, or AuthFailure.","commonSituations":"EIP was released between discovering the NAT gateway and describing addresses (race); stale NAT gateway referencing a freed EIP; IAM missing ec2:DescribeAddresses.","solutions":["Check embedded code: InvalidAllocationID.NotFound means the EIP is gone — treat as deleted and re-run enumeration.","Grant ec2:DescribeAddresses in IAM if UnauthorizedOperation.","Retry on throttling with backoff.","Verify the EIP: `aws ec2 describe-addresses --allocation-ids <id>` in the right region."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"addr, err := ec2Client.DescribeAddresses(ctx, &ec2.DescribeAddressesInput{AllocationIds: []string{allocID}}); if err != nil || len(addr.Addresses) == 0 { /* EIP gone; skip */ }","typeGuard":"func isAllocNotFound(err error) bool { return awsup.AWSErrorCode(err) == \"InvalidAllocationID.NotFound\" }","tryCatchPattern":"err := /* wrapped DescribeAddresses error */\nif isAllocNotFound(err) { continue } // EIP already released; skip this NAT gateway address\nreturn err","preventionTips":["Treat InvalidAllocationID.NotFound as already-deleted, matching kops' pattern for other resources","Keep ec2:DescribeAddresses in IAM","Re-run listing after races; released EIPs won't reappear"],"tags":["aws","ec2","elastic-ip","nat-gateway","api-error"],"backgroundTag":"aws-ec2-api-call-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}