{"record":{"id":"c6e998b04d9f9846","repo":"argoproj/argo-workflows","slug":"failed-to-patch-taskset-w","errorCode":null,"errorMessage":"failed to patch TaskSet. %w","messagePattern":"failed to patch TaskSet\\. %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/controller/taskset.go","lineNumber":222,"sourceCode":"\twoc.log.Debug(ctx, \"creating new taskset\")\n\n\t_, err := woc.controller.wfclientset.ArgoprojV1alpha1().WorkflowTaskSets(woc.wf.Namespace).Create(ctx, &taskSet, metav1.CreateOptions{})\n\n\tif apierr.IsConflict(err) || apierr.IsAlreadyExists(err) {\n\t\twoc.log.Debug(ctx, \"patching the exiting taskset\")\n\t\tspec := map[string]any{\n\t\t\t\"metadata\": metav1.ObjectMeta{\n\t\t\t\tLabels: map[string]string{\n\t\t\t\t\tcommon.LabelKeyCompleted: strconv.FormatBool(woc.wf.Status.Fulfilled()),\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"spec\": wfv1.WorkflowTaskSetSpec{Tasks: woc.taskSet},\n\t\t}\n\t\t// patch the new templates into taskset\n\t\terr = woc.mergePatchTaskSet(ctx, spec)\n\t\tif err != nil {\n\t\t\twoc.log.WithError(err).Error(ctx, \"Failed to patch WorkflowTaskSet\")\n\t\t\treturn fmt.Errorf(\"failed to patch TaskSet. %w\", err)\n\t\t}\n\t} else if err != nil {\n\t\twoc.log.WithError(err).Error(ctx, \"Failed to create WorkflowTaskSet\")\n\t\treturn err\n\t}\n\treturn nil\n}\n","sourceCodeStart":204,"sourceCodeEnd":230,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/controller/taskset.go#L204-L230","documentation":"createTaskSet failed to patch the WorkflowTaskSet CR with the task templates via mergePatchTaskSet. The patch (merge of spec.tasks) was rejected or the API call errored, so the task set cannot carry HTTP/plugin templates for this workflow.","triggerScenarios":"mergePatchTaskSet returns an error from the Kubernetes API while patching the WorkflowTaskSet spec — e.g. the TaskSet CRD is missing/outdated, the object was modified concurrently (conflict), or the patch payload is invalid.","commonSituations":"Upgrading Argo Workflows without applying the new WorkflowTaskSet CRD; RBAC blocking patch on workflowtasksets; API server transient errors or conflicts during high reconciliation load.","solutions":["Verify the WorkflowTaskSet CRD is installed and matches your controller version (apply manifests/base/crds)","Check controller RBAC allows patch on workflowtasksets.argoproj.io","Retry; if conflict errors persist, check for multiple controllers reconciling the same workflow","Check the wrapped error in 'Failed to patch WorkflowTaskSet' log for the API server's reason"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure CRD exists and is current\nkubectl get crd workflowtasksets.argoproj.io\nkubectl auth can-i patch workflowtasksets.argoproj.io --as=system:serviceaccount:<ns>:<controller-sa>","typeGuard":null,"tryCatchPattern":"// retry with backoff on patch errors\nif err := woc.mergePatchTaskSet(ctx, spec); err != nil {\n    return fmt.Errorf(\"failed to patch TaskSet. %w\", err)\n} // requeue and retry on conflict/transient errors","preventionTips":["Apply manifests/base/crds on every upgrade","Grant controller RBAC patch on workflowtasksets","Avoid running duplicate controllers on the same cluster","Retry transient API errors with backoff"],"tags":["kubernetes","taskset","crd","patch"],"backgroundTag":"crd-missing-or-outdated","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}