{"record":{"id":"95d9726f882a6f4b","repo":"hashicorp/nomad","slug":"must-specify-script-path-value-when-change-mode-is","errorCode":null,"errorMessage":"must specify script path value when change mode is script","messagePattern":"must specify script path value when change mode is script","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":9094,"sourceCode":"\t\treturn nil\n\t}\n\treturn &ChangeScript{\n\t\tCommand:          cs.Command,\n\t\tArgs:             slices.Clone(cs.Args),\n\t\tTimeout:          cs.Timeout,\n\t\tFailOnError:      cs.FailOnError,\n\t\tRunOnFirstRender: cs.RunOnFirstRender,\n\t}\n}\n\n// Validate makes sure all the required fields of ChangeScript are present\nfunc (cs *ChangeScript) Validate() error {\n\tif cs == nil {\n\t\treturn nil\n\t}\n\n\tif cs.Command == \"\" {\n\t\treturn fmt.Errorf(\"must specify script path value when change mode is script\")\n\t}\n\n\treturn nil\n}\n\n// WaitConfig is the Min/Max duration used by the Consul Template Watcher. Consul\n// Template relies on pointer based business logic. This struct uses pointers so\n// that we tell the different between zero values and unset values.\ntype WaitConfig struct {\n\tMin *time.Duration\n\tMax *time.Duration\n}\n\n// Copy returns a deep copy of this configuration.\nfunc (wc *WaitConfig) Copy() *WaitConfig {\n\tif wc == nil {\n\t\treturn nil\n\t}","sourceCodeStart":9076,"sourceCodeEnd":9112,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L9076-L9112","documentation":"ChangeScript.Validate: the command field is empty in a change_script block. Since change mode \"script\" requires a command to execute on template changes, an empty path is invalid.","triggerScenarios":"Thrown at nomad/structs/structs.go:9094 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set command in the change_script block to the script path or interpreter","Use a full command line such as \"/usr/local/bin/reload.sh\""],"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"}