{"record":{"id":"cb8552c1d7ffd99e","repo":"argoproj/argo-workflows","slug":"create-agent-pod-failed-with-reason-w","errorCode":null,"errorMessage":"create agent pod failed with reason:\"%w\"","messagePattern":"create agent pod failed with reason:\"%w\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/controller/taskset.go","lineNumber":108,"sourceCode":"func (woc *wfOperationCtx) getWorkflowTaskSet() (*wfv1.WorkflowTaskSet, error) {\n\ttaskSet, exists, err := woc.controller.wfTaskSetInformer.Informer().GetIndexer().GetByKey(woc.wf.Namespace + \"/\" + woc.wf.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, nil\n\t}\n\treturn taskSet.(*wfv1.WorkflowTaskSet), nil\n}\n\nfunc (woc *wfOperationCtx) taskSetReconciliation(ctx context.Context) {\n\tif err := woc.reconcileTaskSet(ctx); err != nil {\n\t\twoc.log.WithError(err).Error(ctx, \"error in workflowtaskset reconciliation\")\n\t\treturn\n\t}\n\tif err := woc.reconcileAgentPod(ctx); err != nil {\n\t\twoc.log.WithError(err).Error(ctx, \"error in agent pod reconciliation\")\n\t\twoc.markTaskSetNodesError(ctx, fmt.Errorf(`create agent pod failed with reason:\"%w\"`, err))\n\t\treturn\n\t}\n}\n\nfunc (woc *wfOperationCtx) nodeRequiresTaskSetReconciliation(ctx context.Context, nodeName string) bool {\n\tnode, err := woc.wf.GetNodeByName(nodeName)\n\tif err != nil {\n\t\treturn false\n\t}\n\t// If this node is of type HTTP, it will need an HTTP reconciliation\n\tif node.IsTaskSetNode() {\n\t\treturn true\n\t}\n\tfor _, child := range node.Children {\n\t\t// If any of the node's children need an HTTP reconciliation, the parent node will also need one\n\t\tchildNodeName, err := woc.wf.Status.Nodes.GetName(child)\n\t\tif err != nil {\n\t\t\twoc.log.WithField(\"nodeID\", child).WithFatal().Error(ctx, \"was unable to get child node name for nodeID\")","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/controller/taskset.go#L90-L126","documentation":"Wraps any error from reconcileAgentPod() during taskSet reconciliation and records it on all TaskSet-backed nodes via markTaskSetNodesError. The controller could not create or update the agent pod (the pod that runs HTTP templates and plugin executors), so dependent nodes are marked errored and the reconcile round aborts.","triggerScenarios":"reconcileAgentPod returns an error while creating/patching the agent pod: invalid pod spec, RBAC denial on pod create, quota exceeded, or the underlying mergePatch/create call failing during taskSetReconciliation triggered from executeWfLifeCycleHook or operate.","commonSituations":"HTTP/plugin templates with bad executor configuration; service account lacking pod-create permissions in the namespace; resource quotas or LimitRanges rejecting the agent pod spec; invalid template fields that only surface at pod-build time.","solutions":["Check the wrapped inner error in the controller log ('error in agent pod reconciliation') for the root cause","Verify the workflow's service account has create/patch on pods in the namespace","Inspect the agent pod events (kubectl describe pod) for scheduling/quota failures","Validate the HTTP/plugin template spec with argo lint"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// preflight: ensure SA can create pods\nkubectl auth can-i create pods --as=system:serviceaccount:<ns>:<sa> -n <ns>","typeGuard":null,"tryCatchPattern":"// controller-side (Go)\nif err := woc.reconcileAgentPod(ctx); err != nil {\n    woc.log.WithError(err).Error(ctx, \"error in agent pod reconciliation\")\n    woc.markTaskSetNodesError(ctx, fmt.Errorf(`create agent pod failed with reason:\"%w\"`, err))\n    return\n}","preventionTips":["Run argo lint on templates using HTTP/plugin executors","Grant the workflow SA pod create/patch RBAC","Watch namespace quotas and LimitRanges","Keep the WorkflowTaskSet CRD in sync with the controller version"],"tags":["kubernetes","agent-pod","taskset","controller"],"backgroundTag":"pod-create-failed","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"}