semaphoreui/semaphore · error
invalid format of the template extra arguments, must be…
Error message
invalid format of the template extra arguments, must be valid JSON
What it means
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.
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at services/tasks/local_executor.go:639 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of semaphoreui/semaphore@1774ccb71a (2026-09-07).
Data as JSON: /api/errors/085d0960c11cb079.
Report an issue: GitHub.
Appendix: source
Thrown at services/tasks/local_executor.go:639
}
if line, ok := inputMap[db.AccessKeyRoleAnsibleBecomeUser]; ok {
inputs["BECOME password"] = line
}
if line, ok := inputMap[db.AccessKeyRoleAnsibleBecomeUser]; ok {
inputs["SUDO password"] = line
}
return
}
func (t *LocalExecutor) getCLIArgs() (templateArgs []string, taskArgs []string, err error) {
if t.Template.Arguments != nil {
err = json.Unmarshal([]byte(*t.Template.Arguments), &templateArgs)
if err != nil {
err = fmt.Errorf("invalid format of the template extra arguments, must be valid JSON")
return
}
}
if t.Template.AllowOverrideArgsInTask && t.Task.Arguments != nil {
err = json.Unmarshal([]byte(*t.Task.Arguments), &taskArgs)
if err != nil {
err = fmt.Errorf("invalid format of the TaskRunner extra arguments, must be valid JSON")
return
}
}
return
}
// convertArgsJSONIfArray converts array format JSON to map format with "default" key and returns the parsed result
func convertArgsJSONIfArray(argsJSON string) (map[string][]string, error) {
if argsJSON == "" {View on GitHub (pinned to 1774ccb71a)