{"record":{"id":"f5a4f4512404b538","repo":"argoproj/argo-workflows","slug":"w-f5a4f4","errorCode":null,"errorMessage":"%w","messagePattern":"%w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argoexec/commands/data.go","lineNumber":22,"sourceCode":"\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/spf13/cobra\"\n\t\"go.opentelemetry.io/otel/trace\"\n\n\t\"github.com/argoproj/argo-workflows/v4/cmd/argoexec/executor\"\n\t\"github.com/argoproj/argo-workflows/v4/util/logging\"\n\t\"github.com/argoproj/argo-workflows/v4/workflow/executor/tracing\"\n)\n\nfunc NewDataCommand() *cobra.Command {\n\tcommand := cobra.Command{\n\t\tUse:   \"data\",\n\t\tShort: \"Process data\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\terr := execData(cmd.Context())\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"%w\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\treturn &command\n}\n\n//nolint:contextcheck\nfunc execData(ctx context.Context) error {\n\tctx = tracing.InjectTraceContext(ctx)\n\twfExecutor := executor.Init(ctx, clientConfig, varRunArgo)\n\tdefer func() {\n\t\tif err := wfExecutor.Tracing.Shutdown(context.WithoutCancel(ctx)); err != nil {\n\t\t\tlogging.RequireLoggerFromContext(ctx).WithError(err).Error(ctx, \"Failed to shutdown tracing\")\n\t\t}\n\t}()\n\tspan := trace.SpanFromContext(ctx)\n","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argoexec/commands/data.go#L4-L40","documentation":"The `argoexec data` command processes data templates (data sourcing/transformation in DAG steps). If execData fails, RunE re-wraps the error with `%w`, adding no context — the inner error from the data processing pipeline (artifact loading, transformation, source failure) is the actual cause.","triggerScenarios":"`argoexec data` run inside a data-template step where the data source (e.g. artifact listing, S3/GCS/HTTP source) fails; transformation (e.g. JSON filtering) produces invalid output; executor cannot access the data source credentials.","commonSituations":"Misconfigured data source paths or URIs in a Workflow's data template; missing cloud credentials (IAM/SA) in the workflow pod; transformation expression matching zero records or producing malformed parameters.","solutions":["Read the wrapped cause — it identifies the failing source, transform, or artifact operation.","Validate the data template spec: source paths/URIs and the transform expression against the actual data.","Check that the workflow pod's service account has access to the data source (S3/GCS/etc.).","Inspect argoexec logs for the detailed stack before the re-wrap."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := execData(ctx); err != nil {\n    logger.Error(ctx, \"data processing failed\", \"err\", err)\n    return fmt.Errorf(\"data processing failed: %w\", err)\n}","preventionTips":["Validate data template sources and transform expressions against real data before production","Ensure the pod's service account has credentials for the data source (S3/GCS/HTTP)","Inspect the unwrapped error in argoexec logs to find the failing stage"],"tags":["argoexec","data-template","wrapping"],"backgroundTag":"data-source-failure","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"}