kubernetes/kops · error
error listing VPCs: %v
Error message
error listing VPCs: %v
What it means
DescribeVPC wraps ec2 DescribeVpcs failure while discovering the cluster's VPC by the cluster's filter tags. It fires when the EC2 API call errors (credentials, throttling, region mismatch); the per-filter loop aborts on the first failing query.
Source
Thrown at pkg/resources/aws/vpc.go:87
}
op.Dump.VPC = vpc
return nil
}
func DescribeVPC(cloud fi.Cloud, clusterName string) (*ec2types.Vpc, error) {
ctx := context.TODO()
c := cloud.(awsup.AWSCloud)
vpcs := make(map[string]*ec2types.Vpc)
klog.V(2).Info("Listing EC2 VPC")
for _, filters := range buildEC2FiltersForCluster(clusterName) {
request := &ec2.DescribeVpcsInput{
Filters: filters,
}
response, err := c.EC2().DescribeVpcs(ctx, request)
if err != nil {
return nil, fmt.Errorf("error listing VPCs: %v", err)
}
for _, vpc := range response.Vpcs {
vpcs[aws.ToString(vpc.VpcId)] = &vpc
}
}
switch len(vpcs) {
case 0:
return nil, nil
case 1:
return vpcs[slices.Collect(maps.Keys(vpcs))[0]], nil
default:
return nil, fmt.Errorf("found multiple VPCs for cluster %q: %v", clusterName, slices.Collect(maps.Keys(vpcs)))
}
}
func ListVPCs(cloud fi.Cloud, clusterName string) ([]*resources.Resource, error) {View on GitHub (pinned to 4c8573c808)
Solutions
- Check EC2 credentials and ec2:DescribeVpcs permission
- Retry after throttling or transient network errors
- Verify the region matches where the cluster's VPC lives
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at pkg/resources/aws/vpc.go:87 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/0e4da0004ad4b30b.
Report an issue: GitHub.