{"record":{"id":"923e5846989c0db3","repo":"argoproj/argo-workflows","slug":"expected-artifact-of-the-form-name-key-received","errorCode":null,"errorMessage":"expected artifact of the form: NAME=KEY. Received: %s","messagePattern":"expected artifact of the form: NAME=KEY\\. Received: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/util/util.go","lineNumber":348,"sourceCode":"\t\t\tnewParams = append(newParams, param)\n\t\t}\n\t\twf.Spec.Arguments.Parameters = newParams\n\t\tif wf.Status.StoredWorkflowSpec != nil {\n\t\t\twf.Status.StoredWorkflowSpec.Arguments.Parameters = newParams\n\t\t}\n\t}\n\treturn nil\n}\n\n// ParseArtifactOverrides parses \"name=key\" override strings into a map, keyed by artifact name.\n// Fails fast on the first malformed entry (no \"=\", or an empty name or key). If the same name\n// appears more than once, the last occurrence wins.\nfunc ParseArtifactOverrides(overrides []string) (map[string]string, error) {\n\tresult := make(map[string]string, len(overrides))\n\tfor _, artifactStr := range overrides {\n\t\tparts := strings.SplitN(artifactStr, \"=\", 2)\n\t\tif len(parts) != 2 || parts[0] == \"\" || parts[1] == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"expected artifact of the form: NAME=KEY. Received: %s\", artifactStr)\n\t\t}\n\t\tresult[parts[0]] = parts[1]\n\t}\n\treturn result, nil\n}\n\n// ApplyOverridesToTemplateArtifacts returns a deep copy of each artifact in templateArtifacts\n// whose name has an entry in overrides, with its key set to the override value. Artifacts\n// without a matching override are omitted from the result. Every override must match a\n// template artifact; an override naming an unknown artifact is an error rather than a silent\n// no-op, so a typo'd or stale override does not run the workflow with default settings after\n// the caller was told the upload succeeded. This is a pure function: it does not resolve\n// artifact repositories or mutate its inputs.\nfunc ApplyOverridesToTemplateArtifacts(templateArtifacts []wfv1.Artifact, overrides map[string]string) ([]wfv1.Artifact, error) {\n\tapplied := make([]wfv1.Artifact, 0, len(overrides))\n\tconsumed := make(map[string]bool, len(overrides))\n\tfor _, tmplArt := range templateArtifacts {\n\t\tnewKey, ok := overrides[tmplArt.Name]","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/util/util.go#L330-L366","documentation":"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.","triggerScenarios":"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'.","commonSituations":"Typing 'artifact name=path' with a space, forgetting the '=' separator, shell quoting that swallows the '=', or passing an empty --artifact flag from a script.","solutions":["Rewrite the override as NAME=KEY with a non-empty name and non-empty key, e.g. --artifact myinput=s3://bucket/path","Quote the argument in the shell so the '=' survives (single-quote it).","Validate each entry with strings.SplitN(s, \"=\", 2) and check both halves are non-empty before invoking the CLI/SubmitWorkflow."],"exampleFix":"// before\nargo submit wf.yaml --artifact myartifact\n// after\nargo submit wf.yaml --artifact myartifact=s3://my-bucket/path/to/object","handlingStrategy":"validation","validationCode":"for _, o := range overrides {\n\tparts := strings.SplitN(o, \"=\", 2)\n\tif len(parts) != 2 || parts[0] == \"\" || parts[1] == \"\" {\n\t\treturn fmt.Errorf(\"invalid artifact override %q; want NAME=KEY\", o)\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always quote --artifact arguments in shell scripts.","Validate overrides in CI before running argo submit.","Keep NAME identical to the artifact's .name field."],"tags":["cli","argument-parsing","artifacts"],"backgroundTag":"invalid-argument-format","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"}