{"record":{"id":"987d93da8d537e9a","repo":"kubernetes/kops","slug":"s-is-required-987d93","errorCode":null,"errorMessage":"%s is required","messagePattern":"(.+?) is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/linode/cloud.go","lineNumber":90,"sourceCode":"}\n\ntype Cloud struct {\n\tregion string\n\tclient LinodeClient\n}\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}","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/linode/cloud.go#L72-L108","documentation":"NewCloud reads the Linode API token from the LINODE_TOKEN environment variable. If the variable is unset or empty, construction fails with '<LINODE_TOKEN> is required' because no API calls can be authenticated.","triggerScenarios":"BuildCloud invokes NewCloud while the LINODE_TOKEN env var is absent or empty in the shell/CI environment running kops.","commonSituations":"Running `kops update cluster` or `kops toolbox` commands locally without exporting LINODE_TOKEN; CI pipelines that omit the secret; using a different env var name (e.g. AKAMAI_TOKEN) that the provider does not read.","solutions":["Export a valid Linode API v4 token: `export LINODE_TOKEN=<token>` (create one in the Akamai Cloud Manager under API Tokens).","Ensure the token is set in the CI environment as a secret mapped to LINODE_TOKEN.","Check `env | grep LINODE_TOKEN` in the same shell/step that runs kops — child processes do not inherit variables exported in a different shell."],"exampleFix":"// before\nLINODE_API_KEY=xxx kops update cluster ...\n// after\nexport LINODE_TOKEN=xxx\nkops update cluster ...","handlingStrategy":"validation","validationCode":"if os.Getenv(\"LINODE_TOKEN\") == \"\" {\n\treturn fmt.Errorf(\"LINODE_TOKEN env var must be set with a Linode API v4 token\")\n}","typeGuard":null,"tryCatchPattern":"_, err := BuildCloud(...)\nif err != nil && strings.Contains(err.Error(), \"LINODE_TOKEN is required\") {\n\t// instruct user: export LINODE_TOKEN=<api token>\n}","preventionTips":["Export LINODE_TOKEN in shell profiles or CI secrets before running kops","Create a long-lived API token with linodes read/write scopes in the Akamai Cloud Manager","Verify with `test -n \"$LINODE_TOKEN\"` in the same execution step as kops"],"tags":["linode","akamai","credentials","env-var"],"backgroundTag":"missing-env-var","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"}