kubernetes/kops · error
error listing Subnets: %v
Error message
error listing Subnets: %v
What it means
DescribeSubnets failed while resolving the Subnet task by explicit ID or by kOps tags; this is a raw AWS EC2 API error (permissions, invalid ID, throttling), not a not-found result (nil,nil is returned in that case).
Source
Thrown at upup/pkg/fi/cloudup/awstasks/subnet.go:159
actual.VPCCIDRBlock = e.VPCCIDRBlock
actual.AmazonIPv6CIDR = e.AmazonIPv6CIDR
return actual, nil
}
func (e *Subnet) findEc2Subnet(c *fi.CloudupContext) (*ec2types.Subnet, error) {
cloud := awsup.GetCloud(c)
request := &ec2.DescribeSubnetsInput{}
if e.ID != nil {
request.SubnetIds = []string{fi.ValueOf(e.ID)}
} else {
request.Filters = cloud.BuildFilters(e.Name)
}
response, err := cloud.EC2().DescribeSubnets(c.Context(), request)
if err != nil {
return nil, fmt.Errorf("error listing Subnets: %v", err)
}
if response == nil || len(response.Subnets) == 0 {
return nil, nil
}
if len(response.Subnets) != 1 {
klog.Fatalf("found multiple Subnets matching tags")
}
subnet := response.Subnets[0]
return &subnet, nil
}
func (e *Subnet) Run(c *fi.CloudupContext) error {
return fi.CloudupDefaultDeltaRunMethod(e, c)
}
func (s *Subnet) CheckChanges(a, e, changes *Subnet) error {View on GitHub (pinned to 4c8573c808)
Solutions
- Check ec2:DescribeSubnets permissions for the credentials in use
- Verify the subnet id or tag filters resolve in the target region
- Retry the apply for transient API errors
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at upup/pkg/fi/cloudup/awstasks/subnet.go:159 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/a58f220ec3630890.
Report an issue: GitHub.