{"record":{"id":"bf39bb6cb3f7cdca","repo":"argoproj/argo-workflows","slug":"expected-labels-of-the-form-name1-value2-name2-va","errorCode":null,"errorMessage":"expected labels of the form: NAME1=VALUE2,NAME2=VALUE2. Received: %s: %w","messagePattern":"expected labels of the form: NAME1=VALUE2,NAME2=VALUE2\\. Received: (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/util/util.go","lineNumber":275,"sourceCode":"\tif opts.ServiceAccount != \"\" {\n\t\twf.Spec.ServiceAccountName = opts.ServiceAccount\n\t}\n\tif opts.PodPriorityClassName != \"\" {\n\t\twf.Spec.PodPriorityClassName = opts.PodPriorityClassName\n\t}\n\n\tif opts.Priority != nil {\n\t\twf.Spec.Priority = opts.Priority\n\t}\n\n\twfLabels := wf.GetLabels()\n\tif wfLabels == nil {\n\t\twfLabels = make(map[string]string)\n\t}\n\tif opts.Labels != \"\" {\n\t\tpassedLabels, err := cmdutil.ParseLabels(opts.Labels)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"expected labels of the form: NAME1=VALUE2,NAME2=VALUE2. Received: %s: %w\", opts.Labels, err)\n\t\t}\n\t\tmaps.Copy(wfLabels, passedLabels)\n\t}\n\twf.SetLabels(wfLabels)\n\twfAnnotations := wf.GetAnnotations()\n\tif wfAnnotations == nil {\n\t\twfAnnotations = make(map[string]string)\n\t}\n\tif opts.Annotations != \"\" {\n\t\tpassedAnnotations, err := cmdutil.ParseLabels(opts.Annotations)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"expected Annotations of the form: NAME1=VALUE2,NAME2=VALUE2. Received: %s: %w\", opts.Labels, err)\n\t\t}\n\t\tmaps.Copy(wfAnnotations, passedAnnotations)\n\t}\n\twf.SetAnnotations(wfAnnotations)\n\terr := overrideParameters(wf, opts.Parameters)\n\tif err != nil {","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/util/util.go#L257-L293","documentation":"ApplySubmitOpts parses opts.Labels with the same label syntax as kubectl (NAME1=VALUE1,NAME2=VALUE2). If ParseLabels fails — malformed pairs, missing '=', invalid key/value characters — the error is wrapped with this message including the offending input.","triggerScenarios":"argo submit --labels with a malformed value, e.g. --labels foo (no =), or a key/value violating Kubernetes label validation (bad characters, too long, empty key) via CreateCronWorkflows/submitWorkflows/SubmitWorkflow.","commonSituations":"Shell quoting issues turning 'a=b,c=d' into 'a=b c=d'; commas inside values; copying labels from JSON into the flag; invalid label characters like '/' or uppercase in unexpected places.","solutions":["Format labels as comma-separated KEY=VALUE pairs: --labels foo=bar,baz=qux","Quote the argument in your shell: --labels \"app=my-app,env=prod\"","Validate keys/values against Kubernetes label rules (alphanumerics, '-', '_', '.', optional prefix)"],"exampleFix":"// before\nargo submit wf.yaml --labels app=myapp env=prod\n// after\nargo submit wf.yaml --labels \"app=myapp,env=prod\"","handlingStrategy":"validation","validationCode":"for _, pair := range strings.Split(labelsArg, \",\") {\n    if !strings.Contains(pair, \"=\") || strings.SplitN(pair, \"=\", 2)[0] == \"\" {\n        return fmt.Errorf(\"invalid label pair %q; use NAME=VALUE,NAME=VALUE\", pair)\n    }\n}","typeGuard":null,"tryCatchPattern":"err := util.ApplySubmitOpts(wf, opts)\nif err != nil && strings.Contains(err.Error(), \"expected labels of the form\") {\n    return fmt.Errorf(\"fix --labels flag: %w\", err)\n}","preventionTips":["Always quote --labels values in shell scripts","Use key=value pairs copied from a validated source (kubectl label syntax)","Add a CLI wrapper that pre-validates label syntax"],"tags":["labels","cli","validation","arguments"],"backgroundTag":"malformed-labels-argument","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"}