{"record":{"id":"ed69373526991eba","repo":"kubernetes/kops","slug":"error-listing-akamai-linode-vpc-subnets-w","errorCode":null,"errorMessage":"error listing Akamai (Linode) VPC Subnets: %w","messagePattern":"error listing Akamai \\(Linode\\) VPC Subnets: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/linodetasks/subnet.go","lineNumber":68,"sourceCode":"func (v *Subnet) Find(c *fi.CloudupContext) (*Subnet, error) {\n\tcloud := c.T.Cloud.(linode.LinodeCloud)\n\n\tif v.VPC == nil {\n\t\treturn nil, fmt.Errorf(\"Subnet.VPC is required\")\n\t}\n\tif v.VPC.ID == nil {\n\t\tif v.VPC.Name != nil {\n\t\t\tif _, ok := c.Target.(*fi.CloudupDryRunTarget); ok {\n\t\t\t\treturn nil, nil\n\t\t\t}\n\t\t\treturn nil, fi.NewTryAgainLaterError(\"waiting for VPC ID\")\n\t\t}\n\t\treturn nil, fmt.Errorf(\"Subnet.VPC.ID is required\")\n\t}\n\n\tsubnets, err := cloud.Client().ListVPCSubnets(c.Context(), fi.ValueOf(v.VPC.ID), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing Akamai (Linode) VPC Subnets: %w\", err)\n\t}\n\n\tvar foundByName *linodego.VPCSubnet\n\tvar foundByIPv4 *linodego.VPCSubnet\n\tname := fi.ValueOf(v.Name)\n\tipv4 := fi.ValueOf(v.IPv4)\n\tfor i := range subnets {\n\t\tcandidate := &subnets[i]\n\t\tif candidate.Label == name {\n\t\t\tif foundByName != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"found multiple Akamai (Linode) VPC Subnets named %q\", name)\n\t\t\t}\n\t\t\tfoundByName = candidate\n\t\t}\n\t\tif ipv4 != \"\" && candidate.IPv4 == ipv4 {\n\t\t\tif foundByIPv4 == nil {\n\t\t\t\tfoundByIPv4 = candidate\n\t\t\t}","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/linodetasks/subnet.go#L50-L86","documentation":"Subnet.Find wraps the linodego ListVPCSubnets error when enumerating subnets of the target VPC. It fires on API failures (auth, rate limit, unknown VPC ID), preventing the task from determining the subnet's current state.","triggerScenarios":"cloud.Client().ListVPCSubnets(ctx, vpcID, nil) returns an error — auth failure, invalid VPC ID, rate limiting, or API outage.","commonSituations":"Expired Linode API token, VPC deleted out-of-band so the stored ID no longer exists, or transient network problems during kops update.","solutions":["Verify the API token is valid (LINODE_API_TOKEN) and has read access","Confirm the VPC ID still exists on the account (linode-cli vpcs list)","Re-run kops update — transient API/network errors often resolve on retry","Check the wrapped inner error for the exact HTTP status and message"],"exampleFix":"// before\nexport LINODE_API_TOKEN=bad-token\n// after\nexport LINODE_API_TOKEN=<valid-rw-token>\nkops update cluster --yes","handlingStrategy":"retry","validationCode":"vpcs, _ := client.ListVPCs(ctx, nil)\nfound := false\nfor _, v := range vpcs {\n    if fi.ValueOf(v.ID) == vpcID { found = true }\n}\nif !found { return fmt.Errorf(\"VPC %d no longer exists\", vpcID) }","typeGuard":null,"tryCatchPattern":"subnets, err := client.ListVPCSubnets(ctx, vpcID, nil)\nif err != nil {\n    var le *linodego.Error\n    if errors.As(err, &le) && (le.Code == 429 || le.Code >= 500) {\n        return retryWithBackoff()\n    }\n    return fmt.Errorf(\"error listing Akamai (Linode) VPC Subnets: %w\", err)\n}","preventionTips":["Keep LINODE_API_TOKEN valid and scoped","Don't delete VPCs out-of-band while kops manages them","Add backoff/retry for transient Linode API errors"],"tags":["linode","akamai","subnet","api-error","vpc"],"backgroundTag":"api-request-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"}