{"record":{"id":"88be16d636dfb6b8","repo":"kubernetes/kops","slug":"error-registering-coordinationv1-v","errorCode":null,"errorMessage":"error registering coordinationv1: %v","messagePattern":"error registering coordinationv1: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cmd/kops-controller/main.go","lineNumber":299,"sourceCode":"\n\tsetupLog.Info(\"starting manager\")\n\tif err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {\n\t\tsetupLog.Error(err, \"problem running manager\")\n\t\tos.Exit(1)\n\t}\n}\n\nfunc buildScheme(opt *config.Options) (*runtime.Scheme, error) {\n\tscheme := runtime.NewScheme()\n\tif err := corev1.AddToScheme(scheme); err != nil {\n\t\treturn nil, fmt.Errorf(\"error registering corev1: %v\", err)\n\t}\n\tif err := v1alpha2.AddToScheme(scheme); err != nil {\n\t\treturn nil, fmt.Errorf(\"error registering kops/v1alpha2 API: %v\", err)\n\t}\n\t// Needed so that the leader-election system can post events\n\tif err := coordinationv1.AddToScheme(scheme); err != nil {\n\t\treturn nil, fmt.Errorf(\"error registering coordinationv1: %v\", err)\n\t}\n\tif opt.CAPI.IsEnabled() {\n\t\tif err := bootstrapapi.AddToScheme(scheme); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error registering kops bootstrap cluster API: %v\", err)\n\t\t}\n\t\tif err := controlplaneapi.AddToScheme(scheme); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error registering kops control-plane cluster API: %v\", err)\n\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}","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops-controller/main.go#L281-L317","documentation":"buildScheme registers the coordination.k8s.io/v1 API (needed so leader election can post Lease events); this wraps coordinationv1.AddToScheme failing, an internal registration error unrelated to user configuration.","triggerScenarios":"coordinationv1.AddToScheme(scheme) returns an error from incompatible or duplicated k8s.io/api versions in the build.","commonSituations":"k8s.io/api version skew in go.mod causing duplicate type registration failures across the scheme build.","solutions":["Align k8s.io/* module versions with `make gomod` / `go mod tidy`","Check go.mod for multiple k8s.io/api major versions","Rebuild after clearing module cache"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if err := coordinationv1.AddToScheme(scheme); err != nil {\n\treturn nil, err\n}\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep k8s.io/api and apimachinery versions aligned","Rebuild in CI to catch duplicate registration at compile time"],"tags":["kubernetes","scheme","leader-election","dependencies"],"backgroundTag":"scheme-registration-failed","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"}