argoproj/argo-workflows · error

%w

Error message

%w

What it means

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.).

Source

Thrown at cmd/argoexec/commands/init.go:23

	"fmt"

	"github.com/argoproj/pkg/stats"
	"github.com/spf13/cobra"

	"github.com/argoproj/argo-workflows/v4/cmd/argoexec/executor"
	"github.com/argoproj/argo-workflows/v4/util/logging"
	"github.com/argoproj/argo-workflows/v4/workflow/executor/tracing"
)

func NewInitCommand() *cobra.Command {
	command := cobra.Command{
		Use:   "init",
		Short: "Load artifacts",
		RunE: func(cmd *cobra.Command, args []string) error {
			ctx := tracing.InjectTraceContext(cmd.Context())
			err := loadArtifacts(ctx)
			if err != nil {
				return fmt.Errorf("%w", err)
			}
			return nil
		},
	}
	return &command
}

func loadArtifacts(ctx context.Context) error {
	wfExecutor := executor.Init(ctx, clientConfig, varRunArgo)
	defer func() {
		if err := wfExecutor.Tracing.Shutdown(context.WithoutCancel(ctx)); err != nil {
			logging.RequireLoggerFromContext(ctx).WithError(err).Error(ctx, "Failed to shutdown tracing")
		}
	}()
	errHandler := wfExecutor.HandleError(ctx)
	ctx, span := wfExecutor.Tracing.StartRunInitContainer(ctx, wfExecutor.WorkflowName(), wfExecutor.Namespace)
	defer span.End()
	defer errHandler()

View on GitHub (pinned to 35bff19146)

Solutions

  1. Read the wrapped cause printed after this error — it identifies the actual artifact-loading failure
  2. Verify artifact repository credentials and endpoint configuration in the controller configmap
  3. Confirm the input artifact's key/path exists in the storage backend
  4. Test egress/network connectivity from the workflow pod to the artifact storage endpoint
Defensive patterns

Strategy: try-catch

Try / catch

// the wrapper preserves the cause via %w; unwrap for specifics
if err := loadArtifacts(ctx); err != nil {
    return fmt.Errorf("%w", err) // at call site: errors.Unwrap / errors.As to classify
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/6ff614f8991978d4. Report an issue: GitHub.