{"record":{"id":"a1f2929800c2d830","repo":"hashicorp/nomad","slug":"invalid-artifact-mode-q-must-be-one-of-s-s","errorCode":null,"errorMessage":"invalid artifact mode %q; must be one of: %s, %s, %s","messagePattern":"invalid artifact mode %q; must be one of: (.+?), (.+?), (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":9929,"sourceCode":"\t_, _ = h.Write([]byte(strconv.FormatBool(ta.Chown)))\n\treturn base64.RawStdEncoding.EncodeToString(h.Sum(nil))\n}\n\nfunc (ta *TaskArtifact) Validate() error {\n\t// Verify the source\n\tvar mErr multierror.Error\n\tif ta.GetterSource == \"\" {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"source must be specified\"))\n\t}\n\n\tswitch ta.GetterMode {\n\tcase \"\":\n\t\t// Default to any\n\t\tta.GetterMode = GetterModeAny\n\tcase GetterModeAny, GetterModeFile, GetterModeDir:\n\t\t// Ok\n\tdefault:\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid artifact mode %q; must be one of: %s, %s, %s\",\n\t\t\tta.GetterMode, GetterModeAny, GetterModeFile, GetterModeDir))\n\t}\n\n\tescaped, err := escapingfs.PathEscapesAllocViaRelative(\"task\", ta.RelativeDest)\n\tif err != nil {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid destination path: %v\", err))\n\t} else if escaped {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"destination escapes allocation directory\"))\n\t}\n\n\tif err := ta.validateChecksum(); err != nil {\n\t\tmErr.Errors = append(mErr.Errors, err)\n\t}\n\n\treturn mErr.ErrorOrNil()\n}\n\nfunc (ta *TaskArtifact) validateChecksum() error {","sourceCodeStart":9911,"sourceCodeEnd":9947,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L9911-L9947","documentation":"TaskArtifact.Validate: the artifact mode is not one of any/file/dir (or empty, which defaults to any). Mode controls whether go-getter expects a single file, a directory, or either.","triggerScenarios":"Thrown at nomad/structs/structs.go:9929 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set mode to \"any\", \"file\", or \"dir\" as appropriate for the source","Omit mode; it defaults to \"any\""],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}