hashicorp/nomad · error

scaling policy type "%s" is not valid

Error message

scaling policy type "%s" is not valid

What it means

Scaling policy validateType guard (community edition): the policy's type is not "horizontal", the only supported type. In structs_ce.go any other type falls through to this error; enterprise types are unavailable in CE.

Source

Thrown at nomad/structs/structs_ce.go:61

func (m *Multiregion) Validate(jobType string, jobDatacenters []string) error {
	if m != nil {
		return errors.New("Multiregion jobs are unlicensed.")
	}

	return nil
}

func (p *ScalingPolicy) validateType() multierror.Error {
	var mErr multierror.Error

	// Check policy type and target
	switch p.Type {
	case ScalingPolicyTypeHorizontal:
		targetErr := p.validateTargetHorizontal()
		mErr.Errors = append(mErr.Errors, targetErr.Errors...)
	default:
		mErr.Errors = append(mErr.Errors, fmt.Errorf(`scaling policy type "%s" is not valid`, p.Type))
	}

	return mErr
}

func (j *Job) GetEntScalingPolicies() []*ScalingPolicy {
	return nil
}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Set the scaling policy type to "horizontal"
  2. Remove the scaling block if horizontal scaling is not intended
  3. Use Nomad Enterprise if other policy types are required
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nomad/structs/structs_ce.go:61 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/40b34a431651015f. Report an issue: GitHub.