{"record":{"id":"6c51af0cf721aca8","repo":"kubernetes/kubernetes","slug":"failed-to-init-resource-claim-controller-w","errorCode":null,"errorMessage":"failed to init resource claim controller: %w","messagePattern":"failed to init resource claim controller: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kube-controller-manager/app/resource.go","lineNumber":92,"sourceCode":"\t\t},\n\t}\n}\n\nfunc newResourceClaimController(ctx context.Context, controllerContext ControllerContext, controllerName string) (Controller, error) {\n\tclient, err := controllerContext.NewClient(\"resource-claim-controller\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontroller, err := resourceclaim.NewController(\n\t\tklog.FromContext(ctx),\n\t\tclient,\n\t\tcontrollerContext.InformerFactory.Core().V1().Pods(),\n\t\tcontrollerContext.InformerFactory.Scheduling().V1beta1().PodGroups(),\n\t\tcontrollerContext.InformerFactory.Resource().V1().ResourceClaims(),\n\t\tcontrollerContext.InformerFactory.Resource().V1().ResourceClaimTemplates())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to init resource claim controller: %w\", err)\n\t}\n\n\treturn newControllerLoop(func(ctx context.Context) {\n\t\tcontroller.Run(ctx, int(controllerContext.ComponentConfig.ResourceClaimController.ConcurrentSyncs))\n\t}, controllerName), nil\n}\n\nfunc newResourcePoolStatusRequestControllerDescriptor() *ControllerDescriptor {\n\treturn &ControllerDescriptor{\n\t\tname:        names.ResourcePoolStatusRequestController,\n\t\tconstructor: newResourcePoolStatusRequestController,\n\t\trequiredFeatureGates: []featuregate.Feature{\n\t\t\tfeatures.DRAResourcePoolStatus,\n\t\t},\n\t}\n}\n\nfunc newResourcePoolStatusRequestController(ctx context.Context, controllerContext ControllerContext, controllerName string) (Controller, error) {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/kubernetes/kubernetes/blob/b882c60b4023bdf09264c2d5d30a2cadebc240fb/cmd/kube-controller-manager/app/resource.go#L74-L110","documentation":"Thrown in newResourceClaimController (resource.go:92) when resourceclaim.NewController returns an error during KCM controller startup. NewController validates its inputs (client, Pods/PodGroups/ResourceClaims/ResourceClaimTemplates informers) and fails if, e.g., the PodGroup informer API group is unavailable or the DRA types are not registered. The %w preserves the underlying cause for inspection.","triggerScenarios":"Starting KCM with the resource-claim controller enabled (DynamicResourceAllocation feature gate on) in an environment where the Scheduling v1beta1 PodGroups API or Resource v1 ResourceClaims/ResourceClaimTemplates APIs are not installed/available, or where the informer factory cannot list/watch those resources.","commonSituations":"Enabling DRA on a cluster whose API server lacks the required API groups (e.g. a custom API server build, or a version mismatch); missing CRD installation for PodGroups; the informer factory was constructed without registering the resource API.","solutions":["Ensure the cluster API server serves the Scheduling v1beta1 PodGroups and Resource v1 ResourceClaims/ResourceClaimTemplates APIs.","Confirm the DynamicResourceAllocation feature gate is enabled on both API server and KCM.","Inspect the wrapped %w error for the specific list/watch or type-registration failure and address it.","If DRA is not needed, disable the controller: --controllers=-resourceclaim-controller."],"exampleFix":"// before: DRA enabled but PodGroups API absent\n// after: install/enable PodGroups API or disable the controller\n--feature-gates=DynamicResourceAllocation=false --controllers=-resourceclaim-controller","handlingStrategy":"try-catch","validationCode":"// Verify the DRA APIs are served before enabling the controller\ngroups, err := discoveryClient.ServerResourcesForGroupVersion(\"resource.k8s.io/v1\")\nif err != nil { /* DRA API missing; do not enable controller */ }","typeGuard":null,"tryCatchPattern":"controller, err := resourceclaim.NewController(logger, client, podsInf, podGroupsInf, claimsInf, templatesInf)\nif err != nil {\n    return nil, fmt.Errorf(\"failed to init resource claim controller: %w\", err)\n}","preventionTips":["Enable DynamicResourceAllocation only when the API server serves resource.k8s.io/v1 and scheduling/v1beta1 PodGroups.","Keep API server and KCM versions aligned for DRA.","Disable the controller with --controllers=-resourceclaim-controller when DRA is unused."],"tags":["kubernetes","go","kube-controller-manager","resourceclaim","dra","controller-init","informer","feature-gate"],"analyzedSha":"b882c60b4023bdf09264c2d5d30a2cadebc240fb","analyzedAt":"2026-08-07T04:07:48.144Z","schemaVersion":2},"datasetVersion":"2026-08-07T07:17:06.508Z"}