{"record":{"id":"47719f765b3eca32","repo":"kubernetes/kops","slug":"error-initializing-metal-cloud-w","errorCode":null,"errorMessage":"error initializing Metal cloud: %w","messagePattern":"error initializing Metal cloud: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/utils.go","lineNumber":207,"sourceCode":"\t\t\t\tscaleway.TagClusterName: cluster.ObjectMeta.Name,\n\t\t\t\t\"zone\":                  string(zone),\n\t\t\t\t\"region\":                string(region),\n\t\t\t}\n\t\t\tfor k, v := range cluster.Spec.CloudLabels {\n\t\t\t\tcloudTags[k] = v\n\t\t\t}\n\n\t\t\tscwCloud, err := scaleway.NewScwCloud(cloudTags)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error initializing Scaleway cloud: %w\", err)\n\t\t\t}\n\n\t\t\tcloud = scwCloud\n\t\t}\n\tcase kops.CloudProviderMetal:\n\t\tmetalCloud, err := metal.NewCloud()\n\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}","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/utils.go#L189-L225","documentation":"Thrown in BuildCloud when metal.NewCloud fails while constructing the Equinix Metal cloud interface. Construction fails primarily because Equinix Metal API credentials are missing from the environment or invalid, so no API client can be built for the provisioning run.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/utils.go:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a valid Equinix Metal API key in the environment variable the metal cloud implementation expects (e.g. METAL_API_TOKEN)","Verify the token is active for the target project","Re-run the operation after credentials are configured"],"exampleFix":null,"handlingStrategy":"try-catch","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"}