{"record":{"id":"015ead4a3e425f56","repo":"argoproj/argo-workflows","slug":"unable-to-process-data-template-w","errorCode":null,"errorMessage":"unable to process data template: %w","messagePattern":"unable to process data template: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/executor/data.go","lineNumber":25,"sourceCode":"\n\t\"github.com/argoproj/argo-workflows/v4/workflow/data\"\n)\n\nfunc (we *WorkflowExecutor) processData(ctx context.Context) (any, error) {\n\tdataCtx, span := we.Tracing.StartProcessDataTemplate(ctx)\n\tdefer span.End()\n\tdataTemplate := we.Template.Data\n\tif dataTemplate == nil {\n\t\treturn nil, fmt.Errorf(\"no data template found\")\n\t}\n\n\treturn data.ProcessData(dataCtx, dataTemplate, newExecutorDataSourceProcessor(we))\n}\n\nfunc (we *WorkflowExecutor) Data(ctx context.Context) error {\n\ttransformedData, err := we.processData(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to process data template: %w\", err)\n\t}\n\n\tout, err := json.Marshal(transformedData)\n\tif err != nil {\n\t\treturn err\n\t}\n\twe.Template.Outputs.Result = new(string(out))\n\terr = we.ReportOutputs(ctx, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":7,"sourceCodeEnd":40,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/executor/data.go#L7-L40","documentation":"Data() wraps processData and annotates any failure — including the 'no data template found' case and any data.ProcessData error — with 'unable to process data template: %w'. The node then fails with this composite message.","triggerScenarios":"Any underlying failure during data-template execution: nil Data template, an unreadable/failing data source (artifact logs, S3 listing, etc.), or an expression error in the transformation step.","commonSituations":"Artifact-log archive not enabled so the data source finds nothing; S3/GCS credentials missing for the data source; a transformation expression that throws (e.g. referencing a missing field); nil data template from a malformed workflow.","solutions":["Read the wrapped (%w) cause in the error message to find the real failure","Enable artifact archive/logging so the data source has artifacts to process","Verify storage credentials for the data source backend","Test the transformation expression with `argo expression` or a small workflow first"],"exampleFix":"// before\ntransformation:\n  - expression: \"filter(jsonList, {#.status == 'ok'})\"\n// after (guard against missing field)\ntransformation:\n  - expression: \"filter(jsonList, {# != null && #.status != nil && #.status == 'ok'})\"","handlingStrategy":"try-catch","validationCode":"// Ensure data source prerequisites exist before running:\n// kubectl get workflow <name> -o yaml | grep -A5 'data:'\n// and confirm artifact archive logging is enabled for data sources using artifactPaths","typeGuard":null,"tryCatchPattern":"if err := we.Data(ctx); err != nil {\n\tvar cause error\n\terrors.As(err, &cause) // unwrap to find root cause (nil data, storage auth, expression error)\n\t// retry transient storage failures; fail fast on expression/config errors\n}","preventionTips":["Read the wrapped (%w) cause for the real failure","Enable artifact archive logging when the data source uses artifactPaths","Verify storage credentials for the chosen backend","Test transformation expressions on sample data first"],"tags":["executor","data-template","error-wrapping"],"backgroundTag":"data-template-processing-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"}