{"record":{"id":"fc5e478b2dfe55a9","repo":"kubernetes/kops","slug":"error-initializing-akamai-linode-cloud-w","errorCode":null,"errorMessage":"error initializing Akamai (Linode) cloud: %w","messagePattern":"error initializing Akamai \\(Linode\\) cloud: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/utils.go","lineNumber":224,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error initializing Metal cloud: %w\", err)\n\t\t}\n\t\tcloud = metalCloud\n\n\tcase kops.CloudProviderLinode:\n\t\tfor _, subnet := range cluster.Spec.Networking.Subnets {\n\t\t\tif subnet.Region != \"\" {\n\t\t\t\tregion = subnet.Region\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif region == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"on Akamai (Linode), subnets must include Regions\")\n\t\t}\n\n\t\tlinodeCloud, err := linode.NewCloud(region)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error initializing Akamai (Linode) cloud: %w\", err)\n\t\t}\n\n\t\tcloud = linodeCloud\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown CloudProvider %q\", cluster.GetCloudProvider())\n\t}\n\treturn cloud, nil\n}\n\nfunc FindDNSHostedZone(dns dnsprovider.Interface, clusterDNSName string, dnsType kops.DNSType) (string, error) {\n\tklog.V(2).Infof(\"Querying for all DNS zones to find match for %q\", clusterDNSName)\n\n\tclusterDNSName = \".\" + strings.TrimSuffix(clusterDNSName, \".\")\n\n\tzonesProvider, ok := dns.Zones()\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"dns provider %T does not support zones\", dns)\n\t}","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/utils.go#L206-L242","documentation":"After determining the Linode region from the cluster subnets, BuildCloud calls linode.NewCloud(region) to build the API client. This error wraps any failure from that constructor — typically credential or API-endpoint problems — so the underlying cause is chained via %w.","triggerScenarios":"BuildCloud with CloudProvider linode and linode.NewCloud(region) returns an error: missing/invalid LINODE_TOKEN, malformed region, or client construction failure during kops create/update/delete commands.","commonSituations":"Environment variable LINODE_TOKEN unset or expired when running `kops create cluster` or `kops update cluster` in CI; mistyped region slug; network/proxy blocking api.linode.com; stale kops binary incompatible with current Linode API.","solutions":["Export a valid API token: `export LINODE_TOKEN=<token>` (check it with a Linode CLI/API call).","Confirm the subnet region is a valid Linode region slug (e.g. us-east, ap-south).","Check network egress to api.linode.com (proxies, firewalls) and retry; inspect the wrapped %w cause for the exact API error."],"exampleFix":"// before\nkops create cluster ... # fails: LINODE_TOKEN empty\n// after\nexport LINODE_TOKEN=xxxxxxxx\nkops create cluster ...","handlingStrategy":"validation","validationCode":"if os.Getenv(\"LINODE_TOKEN\") == \"\" {\n    return errors.New(\"LINODE_TOKEN must be set\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set LINODE_TOKEN in every environment (shell profile, CI secrets) before kops commands.","Test the token with a cheap Linode API call (list regions) before running kops.","Pin valid region slugs and verify them against Linode's region list.","Unwrap the %w cause with errors.As/Is to distinguish auth vs network failures."],"tags":["linode","akamai","cloud-provider-init","credentials"],"backgroundTag":"cloud-provider-auth-failure","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"}