{"record":{"id":"a58f220ec3630890","repo":"kubernetes/kops","slug":"error-listing-subnets-v-a58f22","errorCode":null,"errorMessage":"error listing Subnets: %v","messagePattern":"error listing Subnets: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/subnet.go","lineNumber":159,"sourceCode":"\tactual.VPCCIDRBlock = e.VPCCIDRBlock\n\tactual.AmazonIPv6CIDR = e.AmazonIPv6CIDR\n\n\treturn actual, nil\n}\n\nfunc (e *Subnet) findEc2Subnet(c *fi.CloudupContext) (*ec2types.Subnet, error) {\n\tcloud := awsup.GetCloud(c)\n\n\trequest := &ec2.DescribeSubnetsInput{}\n\tif e.ID != nil {\n\t\trequest.SubnetIds = []string{fi.ValueOf(e.ID)}\n\t} else {\n\t\trequest.Filters = cloud.BuildFilters(e.Name)\n\t}\n\n\tresponse, err := cloud.EC2().DescribeSubnets(c.Context(), request)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing Subnets: %v\", err)\n\t}\n\tif response == nil || len(response.Subnets) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tif len(response.Subnets) != 1 {\n\t\tklog.Fatalf(\"found multiple Subnets matching tags\")\n\t}\n\n\tsubnet := response.Subnets[0]\n\treturn &subnet, nil\n}\n\nfunc (e *Subnet) Run(c *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(e, c)\n}\n\nfunc (s *Subnet) CheckChanges(a, e, changes *Subnet) error {","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/subnet.go#L141-L177","documentation":"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).","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/subnet.go:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}