argoproj/argo-workflows · error

expected artifact of the form: NAME=KEY. Received: %s

Error message

expected artifact of the form: NAME=KEY. Received: %s

What it means

ParseArtifactOverrides parses CLI --artifact override strings of the form NAME=KEY into a map. It throws this error when an entry cannot be split into exactly two non-empty parts around the first '='. The library fails fast here because a malformed override would silently target no artifact.

Source

Thrown at workflow/util/util.go:348

			newParams = append(newParams, param)
		}
		wf.Spec.Arguments.Parameters = newParams
		if wf.Status.StoredWorkflowSpec != nil {
			wf.Status.StoredWorkflowSpec.Arguments.Parameters = newParams
		}
	}
	return nil
}

// ParseArtifactOverrides parses "name=key" override strings into a map, keyed by artifact name.
// Fails fast on the first malformed entry (no "=", or an empty name or key). If the same name
// appears more than once, the last occurrence wins.
func ParseArtifactOverrides(overrides []string) (map[string]string, error) {
	result := make(map[string]string, len(overrides))
	for _, artifactStr := range overrides {
		parts := strings.SplitN(artifactStr, "=", 2)
		if len(parts) != 2 || parts[0] == "" || parts[1] == "" {
			return nil, fmt.Errorf("expected artifact of the form: NAME=KEY. Received: %s", artifactStr)
		}
		result[parts[0]] = parts[1]
	}
	return result, nil
}

// ApplyOverridesToTemplateArtifacts returns a deep copy of each artifact in templateArtifacts
// whose name has an entry in overrides, with its key set to the override value. Artifacts
// without a matching override are omitted from the result. Every override must match a
// template artifact; an override naming an unknown artifact is an error rather than a silent
// no-op, so a typo'd or stale override does not run the workflow with default settings after
// the caller was told the upload succeeded. This is a pure function: it does not resolve
// artifact repositories or mutate its inputs.
func ApplyOverridesToTemplateArtifacts(templateArtifacts []wfv1.Artifact, overrides map[string]string) ([]wfv1.Artifact, error) {
	applied := make([]wfv1.Artifact, 0, len(overrides))
	consumed := make(map[string]bool, len(overrides))
	for _, tmplArt := range templateArtifacts {
		newKey, ok := overrides[tmplArt.Name]

View on GitHub (pinned to 35bff19146)

Solutions

  1. Rewrite the override as NAME=KEY with a non-empty name and non-empty key, e.g. --artifact myinput=s3://bucket/path
  2. Quote the argument in the shell so the '=' survives (single-quote it).
  3. Validate each entry with strings.SplitN(s, "=", 2) and check both halves are non-empty before invoking the CLI/SubmitWorkflow.

Example fix

// before
argo submit wf.yaml --artifact myartifact
// after
argo submit wf.yaml --artifact myartifact=s3://my-bucket/path/to/object
Defensive patterns

Strategy: validation

Validate before calling

for _, o := range overrides {
	parts := strings.SplitN(o, "=", 2)
	if len(parts) != 2 || parts[0] == "" || parts[1] == "" {
		return fmt.Errorf("invalid artifact override %q; want NAME=KEY", o)
	}
}

Prevention

When it happens

Trigger: Calling SubmitWorkflow (or argo submit --artifact) with an override string missing '=', missing NAME before '=', missing KEY after '=', or an empty string, e.g. --artifact 'myfile' or --artifact '=s3/key'.

Common situations: Typing 'artifact name=path' with a space, forgetting the '=' separator, shell quoting that swallows the '=', or passing an empty --artifact flag from a script.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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