kubernetes/kops · error

error listing ElasticIPs: %v

Error message

error listing ElasticIPs: %v

What it means

During ElasticIP.find(), kOps calls EC2 DescribeAddresses (filtered by allocation ID or public-ip) to reconcile the task's declared ElasticIP with actual AWS state. If that DescribeAddresses call returns an AWS error (auth failure, malformed allocation ID, throttling, network failure), the call is wrapped as 'error listing ElasticIPs: %v'. It means the EIP lookup itself failed at the AWS API level, not that the EIP is absent.

Source

Thrown at upup/pkg/fi/cloudup/awstasks/elastic_ip.go:136

		if len(response.Tags) != 1 {
			return nil, fmt.Errorf("found multiple tags for: %v", e)
		}
		t := response.Tags[0]
		publicIP = t.Value
		klog.V(2).Infof("Found public IP via tag: %v", *publicIP)
	}

	if publicIP != nil || allocationID != nil {
		request := &ec2.DescribeAddressesInput{}
		if allocationID != nil {
			request.AllocationIds = []string{fi.ValueOf(allocationID)}
		} else if publicIP != nil {
			request.Filters = []ec2types.Filter{awsup.NewEC2Filter("public-ip", *publicIP)}
		}

		response, err := cloud.EC2().DescribeAddresses(ctx, request)
		if err != nil {
			return nil, fmt.Errorf("error listing ElasticIPs: %v", err)
		}

		if response == nil || len(response.Addresses) == 0 {
			return nil, fmt.Errorf("found no ElasticIPs for: %v", e)
		}

		if len(response.Addresses) != 1 {
			return nil, fmt.Errorf("found multiple ElasticIPs for: %v", e)
		}
		a := response.Addresses[0]
		actual := &ElasticIP{
			ID:       a.AllocationId,
			PublicIP: a.PublicIp,
		}
		actual.TagOnSubnet = e.TagOnSubnet
		actual.AssociatedNatGatewayRouteTable = e.AssociatedNatGatewayRouteTable

		{

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify AWS credentials and region (aws sts get-caller-identity, check --region) and retry kops update
  2. Check that the eipalloc-* ID / public IP in the cluster spec is well-formed and exists in the target region (aws ec2 describe-addresses)
  3. Run `kops toolbox dump` / enable klog -v=4 to see the underlying AWS SDK error detail
  4. If throttled, retry later or request an EC2 API rate-limit increase

Example fix

// before: stale ID in spec
ID: fi.String("eipalloc-deadbeef")
// after: correct current allocation ID from the target region
aws ec2 describe-addresses --region us-east-1 --filters Name=public-ip,Values=52.1.2.3
ID: fi.String("eipalloc-0abc123def4567890")
Defensive patterns

Strategy: retry

Validate before calling

id := os.Getenv("EIP_ALLOCATION_ID")
if id != "" && !strings.HasPrefix(id, "eipalloc-") {
    return fmt.Errorf("invalid allocation ID %q", id)
}
// pre-check API reachability
_, err := client.DescribeAddresses(ctx, &ec2.DescribeAddressesInput{AllocationIds: []string{id}})

Try / catch

var ae smithy.APIError
if errors.As(err, &ae) {
    if ae.ErrorCode() == "ThrottlingException" {
        time.Sleep(backoff); // retry
    }
}

Prevention

When it happens

Trigger: ec2.DescribeAddresses fails: invalid AllocationIds format (not eipalloc-*), public-ip filter with malformed IP, expired/insufficient IAM credentials, EC2 throttling, or regional endpoint unreachability during `kops update cluster` reconciliation.

Common situations: Stale cluster spec referencing a deleted/released EIP allocation ID in a different region; AWS credentials rotated/expired mid-run; hitting EC2 API rate limits in large clusters; corporate proxy blocking EC2 endpoints.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/aeb6e2c3d20e68d4. Report an issue: GitHub.