hashicorp/nomad · error

must specify script path value when change mode is script

Error message

must specify script path value when change mode is script

What it means

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.

Source

Thrown at nomad/structs/structs.go:9094

		return nil
	}
	return &ChangeScript{
		Command:          cs.Command,
		Args:             slices.Clone(cs.Args),
		Timeout:          cs.Timeout,
		FailOnError:      cs.FailOnError,
		RunOnFirstRender: cs.RunOnFirstRender,
	}
}

// Validate makes sure all the required fields of ChangeScript are present
func (cs *ChangeScript) Validate() error {
	if cs == nil {
		return nil
	}

	if cs.Command == "" {
		return fmt.Errorf("must specify script path value when change mode is script")
	}

	return nil
}

// WaitConfig is the Min/Max duration used by the Consul Template Watcher. Consul
// Template relies on pointer based business logic. This struct uses pointers so
// that we tell the different between zero values and unset values.
type WaitConfig struct {
	Min *time.Duration
	Max *time.Duration
}

// Copy returns a deep copy of this configuration.
func (wc *WaitConfig) Copy() *WaitConfig {
	if wc == nil {
		return nil
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Set command in the change_script block to the script path or interpreter
  2. Use a full command line such as "/usr/local/bin/reload.sh"
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nomad/structs/structs.go:9094 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/95d9726f882a6f4b. Report an issue: GitHub.