{"record":{"id":"25416f4567d8bb4e","repo":"kubernetes/kops","slug":"error-building-node-identifier-w","errorCode":null,"errorMessage":"error building node identifier: %w","messagePattern":"error building node identifier: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cmd/kops-controller/main.go","lineNumber":325,"sourceCode":"\t\t}\n\t}\n\n\treturn scheme, nil\n}\n\nfunc addNodeController(ctx context.Context, mgr manager.Manager, opt *config.Options) error {\n\tvar capiManager *capimanager.Manager\n\tif opt.CAPI.IsEnabled() {\n\t\tcapiManager = capimanager.NewManager(mgr.GetClient())\n\t}\n\n\tvar identifier nodeidentity.Identifier\n\tvar err error\n\tswitch opt.Cloud {\n\tcase \"aws\":\n\t\tidentifier, err = nodeidentityaws.New(ctx, opt.CacheNodeidentityInfo)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error building node identifier: %w\", err)\n\t\t}\n\n\tcase \"gce\":\n\t\tidentifier, err = nodeidentitygce.New(opt.ClusterName, capiManager)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error building node identifier: %w\", err)\n\t\t}\n\n\tcase \"openstack\":\n\t\tidentifier, err = nodeidentityos.New(opt.CacheNodeidentityInfo)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error building node identifier: %w\", err)\n\t\t}\n\n\tcase \"digitalocean\":\n\t\tidentifier, err = nodeidentitydo.New(opt.CacheNodeidentityInfo)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error building node identifier: %w\", err)","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops-controller/main.go#L307-L343","documentation":"addNodeController failed to construct the cloud node identifier during startup. For each configured cloud (aws, gce, ...) the New() constructor is called; its initialization error (AWS session/EC2 client setup, GCE service setup) is wrapped with this message and main exits.","triggerScenarios":"nodeidentityaws.New fails (e.g. AWS config/session creation error) or nodeidentitygce.New fails (GCE credentials/service client error) for the cloud matching opt.Cloud.","commonSituations":"Missing or invalid cloud credentials/environment (AWS_REGION unset, GCP credentials not mounted), unsupported opt.Cloud value (falls through to an error for unknown clouds), or invalid cluster name for GCE.","solutions":["Read the wrapped error from nodeidentity*.New for the root cause","Verify cloud credentials and region env (AWS_REGION / GOOGLE_APPLICATION_CREDENTIALS) are set in the controller pod","Confirm --cloud flag matches a supported value (aws, gce, ...)","For GCE, verify opt.ClusterName is set correctly"],"exampleFix":"// before: missing region\n// container env: no AWS_REGION\n// after\nenv:\n- name: AWS_REGION\n  value: us-east-1","handlingStrategy":"validation","validationCode":"switch opt.Cloud {\ncase \"aws\", \"gce\":\ndefault:\n\treturn fmt.Errorf(\"unsupported cloud %q\", opt.Cloud)\n}\n","typeGuard":null,"tryCatchPattern":"identifier, err = nodeidentityaws.New(ctx, opt.CacheNodeidentityInfo)\nif err != nil {\n\treturn fmt.Errorf(\"error building node identifier: %w\", err)\n}\n","preventionTips":["Validate cloud credentials/region env before starting the controller","Confirm --cloud matches a supported identifier (aws, gce)","For GCE, set ClusterName correctly and mount credentials","Fail fast in main with the wrapped constructor error"],"tags":["startup","cloud-provider","aws","gce","node-controller"],"backgroundTag":"node-identifier-init-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"}