{"record":{"id":"40b34a431651015f","repo":"hashicorp/nomad","slug":"scaling-policy-type-s-is-not-valid","errorCode":null,"errorMessage":"scaling policy type \"%s\" is not valid","messagePattern":"scaling policy type \"(.+?)\" is not valid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs_ce.go","lineNumber":61,"sourceCode":"\nfunc (m *Multiregion) Validate(jobType string, jobDatacenters []string) error {\n\tif m != nil {\n\t\treturn errors.New(\"Multiregion jobs are unlicensed.\")\n\t}\n\n\treturn nil\n}\n\nfunc (p *ScalingPolicy) validateType() multierror.Error {\n\tvar mErr multierror.Error\n\n\t// Check policy type and target\n\tswitch p.Type {\n\tcase ScalingPolicyTypeHorizontal:\n\t\ttargetErr := p.validateTargetHorizontal()\n\t\tmErr.Errors = append(mErr.Errors, targetErr.Errors...)\n\tdefault:\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(`scaling policy type \"%s\" is not valid`, p.Type))\n\t}\n\n\treturn mErr\n}\n\nfunc (j *Job) GetEntScalingPolicies() []*ScalingPolicy {\n\treturn nil\n}\n","sourceCodeStart":43,"sourceCodeEnd":70,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs_ce.go#L43-L70","documentation":"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.","triggerScenarios":"Thrown at nomad/structs/structs_ce.go:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the scaling policy type to \"horizontal\"","Remove the scaling block if horizontal scaling is not intended","Use Nomad Enterprise if other policy types are required"],"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"}