{"record":{"id":"6ff614f8991978d4","repo":"argoproj/argo-workflows","slug":"w-6ff614","errorCode":null,"errorMessage":"%w","messagePattern":"%w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argoexec/commands/init.go","lineNumber":23,"sourceCode":"\t\"fmt\"\n\n\t\"github.com/argoproj/pkg/stats\"\n\t\"github.com/spf13/cobra\"\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 NewInitCommand() *cobra.Command {\n\tcommand := cobra.Command{\n\t\tUse:   \"init\",\n\t\tShort: \"Load artifacts\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tctx := tracing.InjectTraceContext(cmd.Context())\n\t\t\terr := loadArtifacts(ctx)\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\nfunc loadArtifacts(ctx context.Context) error {\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\terrHandler := wfExecutor.HandleError(ctx)\n\tctx, span := wfExecutor.Tracing.StartRunInitContainer(ctx, wfExecutor.WorkflowName(), wfExecutor.Namespace)\n\tdefer span.End()\n\tdefer errHandler()","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argoexec/commands/init.go#L5-L41","documentation":"The `argoexec init` cobra command (which loads input artifacts before the main container runs) wraps any error returned by loadArtifacts with fmt.Errorf(\"%w\", err). This is a pure pass-through wrapper: the message adds no text, and the wrapped cause is preserved for errors.Is/errors.As inspection. The real failure originates in artifact loading (storage backend auth, missing artifact, bad S3/GCS/Git config, etc.).","triggerScenarios":"Running `argoexec init` (legacy pod layout) where loadArtifacts fails — e.g. an input artifact cannot be downloaded because of missing credentials, an unreachable storage endpoint, or a nonexistent artifact key.","commonSituations":"Misconfigured artifact repository credentials in workflow-controller-configmap; deleted/expired S3 objects; network egress blocked from workflow pods; typo in an artifact's key/path.","solutions":["Read the wrapped cause printed after this error — it identifies the actual artifact-loading failure","Verify artifact repository credentials and endpoint configuration in the controller configmap","Confirm the input artifact's key/path exists in the storage backend","Test egress/network connectivity from the workflow pod to the artifact storage endpoint"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// the wrapper preserves the cause via %w; unwrap for specifics\nif err := loadArtifacts(ctx); err != nil {\n    return fmt.Errorf(\"%w\", err) // at call site: errors.Unwrap / errors.As to classify\n}","preventionTips":["Validate artifact repository credentials with a small test workflow before production","Lint workflows (argo lint) to catch malformed artifact specs pre-submit","Verify artifact keys exist in storage before referencing them","Grant pods network egress to artifact storage endpoints"],"tags":["go","cobra","argo-executor","artifacts","error-wrapping"],"backgroundTag":"error-wrapping-passthrough","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"}