{"record":{"id":"a74ce680b10e27c7","repo":"kubernetes/kops","slug":"failed-to-create-linode-client-w-a74ce6","errorCode":null,"errorMessage":"failed to create Linode client: %w","messagePattern":"failed to create Linode client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/linode/cloud.go","lineNumber":95,"sourceCode":"}\n\nvar _ LinodeCloud = &Cloud{}\n\nvar invalidLinodeLabelChars = regexp.MustCompile(`[^A-Za-z0-9_-]+`)\n\nfunc NewCloud(region string) (LinodeCloud, error) {\n\tif region == \"\" {\n\t\treturn nil, fmt.Errorf(\"region is required\")\n\t}\n\n\taccessToken := os.Getenv(\"LINODE_TOKEN\")\n\tif accessToken == \"\" {\n\t\treturn nil, fmt.Errorf(\"%s is required\", \"LINODE_TOKEN\")\n\t}\n\n\tclient, err := linodego.NewClient(nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create Linode client: %w\", err)\n\t}\n\tclient.SetUserAgent(\"kops/\" + kopsv.Version)\n\tclient.SetToken(accessToken)\n\n\treturn &Cloud{\n\t\tregion: region,\n\t\tclient: &client,\n\t}, nil\n}\n\nfunc (c *Cloud) Client() LinodeClient {\n\treturn c.client\n}\n\nfunc (c *Cloud) ProviderID() kops.CloudProviderID {\n\treturn kops.CloudProviderLinode\n}\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/linode/cloud.go#L77-L113","documentation":"After reading the token, NewCloud initializes the API client with linodego.NewClient(nil). If the client library cannot construct its default HTTP client (e.g. OAuth2 transport creation fails), the error is wrapped as 'failed to create Linode client: %w'.","triggerScenarios":"linodego.NewClient(nil) returns a non-nil error during cloud construction in BuildCloud — rare, typically from an internal OAuth2/transport failure in linodego.","commonSituations":"Incompatible or broken linodego dependency version in the build; extremely restricted runtime environments where the default HTTP transport cannot be allocated.","solutions":["Inspect the wrapped %w cause with `kops ... -v=10` to see the underlying linodego error.","Run `make gomod` / `go mod tidy` to align linodego with the version in go.mod, then rebuild kops.","Retry in a normal environment (check for tampered CA certs / proxy settings like HTTP(S)_PROXY that break client construction)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"cloud, err := BuildCloud(...)\nif err != nil {\n\tvar inner error\n\tif errors.As(err, &inner) && strings.Contains(err.Error(), \"failed to create Linode client\") {\n\t\tlog.Printf(\"linodego client init failed: %v\", inner) // then rebuild deps / retry\n\t}\n}","preventionTips":["Pin linodego to the version in kops go.mod; run `make gomod` after dependency changes","Avoid exotic proxy/CA setups that break default HTTP transport construction","Rebuild kops cleanly when upgrading Go or dependency versions"],"tags":["linode","akamai","client-init","linodego"],"backgroundTag":"client-initialization-failed","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"}