{"record":{"id":"085d0960c11cb079","repo":"semaphoreui/semaphore","slug":"invalid-format-of-the-template-extra-arguments-mu","errorCode":null,"errorMessage":"invalid format of the template extra arguments, must be valid JSON","messagePattern":"invalid format of the template extra arguments, must be valid JSON","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"services/tasks/local_executor.go","lineNumber":639,"sourceCode":"\t}\n\n\tif line, ok := inputMap[db.AccessKeyRoleAnsibleBecomeUser]; ok {\n\t\tinputs[\"BECOME password\"] = line\n\t}\n\n\tif line, ok := inputMap[db.AccessKeyRoleAnsibleBecomeUser]; ok {\n\t\tinputs[\"SUDO password\"] = line\n\t}\n\n\treturn\n}\n\nfunc (t *LocalExecutor) getCLIArgs() (templateArgs []string, taskArgs []string, err error) {\n\n\tif t.Template.Arguments != nil {\n\t\terr = json.Unmarshal([]byte(*t.Template.Arguments), &templateArgs)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"invalid format of the template extra arguments, must be valid JSON\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tif t.Template.AllowOverrideArgsInTask && t.Task.Arguments != nil {\n\t\terr = json.Unmarshal([]byte(*t.Task.Arguments), &taskArgs)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"invalid format of the TaskRunner extra arguments, must be valid JSON\")\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}\n\n// convertArgsJSONIfArray converts array format JSON to map format with \"default\" key and returns the parsed result\nfunc convertArgsJSONIfArray(argsJSON string) (map[string][]string, error) {\n\tif argsJSON == \"\" {","sourceCodeStart":621,"sourceCodeEnd":657,"githubUrl":"https://github.com/semaphoreui/semaphore/blob/1774ccb71a0a8b82eb74ea24c23ac9ab713de2fa/services/tasks/local_executor.go#L621-L657","documentation":"Returned by LocalExecutor.getCLIArgs in services/tasks/local_executor.go when the template's extra arguments string cannot be unmarshalled into a []string by encoding/json. The offending input is the Template.Arguments field (the extra CLI arguments configured on the task template): it must be a valid JSON array of strings such as [\"--verbose\",\"--check\"], and any other JSON shape or trailing garbage triggers this error.","triggerScenarios":"Thrown at services/tasks/local_executor.go:639 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the template in the UI (or API) and fix the Extra arguments field to a JSON array of strings, e.g. [\"--tags\",\"deploy\"]","Remove stray quotes, trailing commas, or shell-style quoting that breaks JSON parsing","Validate the arguments field with a JSON-array check when the template is saved, not at task run time","If the arguments were meant as key/value pairs, move them to the appropriate arguments-map field instead of the CLI array field"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1774ccb71a0a8b82eb74ea24c23ac9ab713de2fa","analyzedAt":"2026-09-07T11:00:33.293Z","contentChangedAt":"2026-09-07T11:00:33.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}