{"record":{"id":"70d3ddc4d8cf6eed","repo":"kubernetes/kops","slug":"hcloud-token-is-required","errorCode":null,"errorMessage":"HCLOUD_TOKEN is required","messagePattern":"HCLOUD_TOKEN is required","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/hetzner/cloud.go","lineNumber":84,"sourceCode":"}\n\n// static compile time check to validate HetznerCloud's fi.Cloud Interface.\nvar _ fi.Cloud = (*hetznerCloudImplementation)(nil)\n\n// hetznerCloudImplementation holds the godo client object to interact with Hetzner resources.\ntype hetznerCloudImplementation struct {\n\tClient *hcloud.Client\n\n\tdns dnsprovider.Interface\n\n\tregion string\n}\n\n// NewHetznerCloud returns a Cloud, using the env var HCLOUD_TOKEN\nfunc NewHetznerCloud(region string) (HetznerCloud, error) {\n\taccessToken := os.Getenv(\"HCLOUD_TOKEN\")\n\tif accessToken == \"\" {\n\t\treturn nil, errors.New(\"HCLOUD_TOKEN is required\")\n\t}\n\n\topts := []hcloud.ClientOption{\n\t\thcloud.WithToken(accessToken),\n\t\thcloud.WithApplication(\"kops\", version.Version),\n\t}\n\tclient := hcloud.NewClient(opts...)\n\n\treturn &hetznerCloudImplementation{\n\t\tClient: client,\n\t\tdns:    nil,\n\t\tregion: region,\n\t}, nil\n}\n\n// ActionClient returns an implementation of hetzner.ActionClient\nfunc (c *hetznerCloudImplementation) ActionClient() hcloud.ActionClient {\n\treturn c.Client.Action","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/hetzner/cloud.go#L66-L102","documentation":"NewHetznerCloud builds the Hetzner Cloud client from the HCLOUD_TOKEN environment variable; this guard fires when that variable is unset or empty, so no API client can be constructed. It is a simple configuration guard, not an API failure.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/hetzner/cloud.go:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set HCLOUD_TOKEN to a valid Hetzner Cloud API token before running kops (e.g. export HCLOUD_TOKEN=...)","Verify the variable is exported in the shell or CI environment where kops runs","Create a token in the Hetzner Cloud console if none exists"],"exampleFix":null,"handlingStrategy":"validation","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"}