argoproj/argo-workflows · error

%w

Error message

%w

What it means

The `argoexec artifact-plugin load` command loads an artifact plugin by name; if loadArtifactPlugin returns an error (plugin not found, failed to start/exec, bad configuration), the RunE re-wraps it verbatim with `%w`. The wrapper adds no information — the underlying error from the plugin loader is the real signal.

Source

Thrown at cmd/argoexec/commands/artifact_plugin_init.go:49

			go func() {
				command, closer, err := startCommand(ctx, name, args, &wfv1.Template{}, containerName, includeScriptOutput)
				if err != nil {
					logger.WithError(err).Error(ctx, "failed to start command")
					return
				}
				defer closer()
				// setup signal handlers
				signals := make(chan os.Signal, 1)
				defer close(signals)
				signal.Notify(signals)
				defer signal.Reset()

				forwardSignals(ctx, signals, command.Process.Pid, false)
			}()
			err := loadArtifactPlugin(ctx, wfv1.ArtifactPluginName(artifactPlugin))
			if err != nil {
				return fmt.Errorf("%w", err)
			}
			return nil
		},
	}
	command.Flags().StringVar(&artifactPlugin, "plugin-name", "", "Artifact plugin name")
	return &command
}

func loadArtifactPlugin(ctx context.Context, pluginName wfv1.ArtifactPluginName) error {
	if err := os.MkdirAll(pluginName.SocketDir(), 0755); err != nil {
		return err
	}
	wfExecutor := executor.Init(ctx, clientConfig, varRunArgo)
	errHandler := wfExecutor.HandleError(ctx)
	defer errHandler()
	defer stats.LogStats()

	err := wfExecutor.LoadArtifactsFromPlugin(ctx, pluginName)

View on GitHub (pinned to 35bff19146)

Solutions

  1. Read the wrapped cause — it names whether the plugin was not found or failed to start.
  2. Verify the plugin name matches the installed artifact plugin (check the plugin dir / executor logs).
  3. Ensure the plugin binary is present, executable, and its configuration is valid in the pod image.
  4. Check argoexec logs (and plugin stdout/stderr) for the plugin's own startup error.

Example fix

// before
loadArtifactPlugin(ctx, "my-plugin")  // fails silently on name mismatch
// after
// confirm: ls /var/run/argo/artifact-plugins  (or configured plugin dir)
loadArtifactPlugin(ctx, wfv1.ArtifactPluginName("my-plugin"))
Defensive patterns

Strategy: try-catch

Validate before calling

plugins, _ := os.ReadDir(pluginDir)
for _, p := range plugins { if p.Name() == pluginName { found = true } }
if !found { return fmt.Errorf("artifact plugin %q not found in %s", pluginName, pluginDir) }

Try / catch

if err := loadArtifactPlugin(ctx, pluginName); err != nil {
    logger.Error(ctx, "artifact plugin load failed", "plugin", pluginName, "err", err)
    return fmt.Errorf("artifact plugin %q failed to load: %w", pluginName, err)
}

Prevention

When it happens

Trigger: Plugin name given via --plugin-name does not match any plugin in the configured plugin directory; plugin binary missing, not executable, or fails at startup; plugin directory/env var (artifact plugin location) misconfigured in the workflow pod.

Common situations: Typo in the artifact plugin name in the workflow spec; plugin image lacking the plugin binary or wrong permissions; plugin crashed during initialization (bad config file, missing dependencies).

Related errors


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