{"record":{"id":"c2d2e438e1304524","repo":"hashicorp/nomad","slug":"unsupported-bind-type-q","errorCode":null,"errorMessage":"unsupported bind type: %q","messagePattern":"unsupported bind type: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/acl.go","lineNumber":2108,"sourceCode":"\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"description longer than %d\", maxACLRoleDescriptionLength))\n\t}\n\n\t// Depending on the bind type, we have some specific validation. Catching\n\t// the empty string also provides easier to understand feedback to the\n\t// user.\n\tswitch a.BindType {\n\tcase \"\":\n\t\tmErr.Errors = append(mErr.Errors, errors.New(\"bind type is missing\"))\n\tcase ACLBindingRuleBindTypeRole, ACLBindingRuleBindTypePolicy:\n\t\tif a.BindName == \"\" {\n\t\t\tmErr.Errors = append(mErr.Errors, errors.New(\"bind name is missing\"))\n\t\t}\n\tcase ACLBindingRuleBindTypeManagement:\n\t\tif a.BindName != \"\" {\n\t\t\tmErr.Errors = append(mErr.Errors, errors.New(\"bind name should be empty\"))\n\t\t}\n\tdefault:\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"unsupported bind type: %q\", a.BindType))\n\t}\n\n\t// If there is a selector configured, ensure that go-bexpr can parse this.\n\t// Otherwise, the user will get an ambiguous failure when attempting to\n\t// login.\n\tif a.Selector != \"\" {\n\t\tif _, err := bexpr.CreateEvaluator(a.Selector, nil); err != nil {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"selector is invalid: %v\", err))\n\t\t}\n\t}\n\n\treturn mErr.ErrorOrNil()\n}\n\n// Merge merges binding rule a with b. It sets all required empty fields of rule\n// a to corresponding values of rule b, except for \"ID\" which must be provided.\nfunc (a *ACLBindingRule) Merge(b *ACLBindingRule) {\n\ta.BindName = helper.Merge(a.BindName, b.BindName)","sourceCodeStart":2090,"sourceCodeEnd":2126,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/acl.go#L2090-L2126","documentation":"ACLBindingRule.Validate() only accepts known BindType values (e.g. \"field\" selector-based bind and \"management\"); anything else falls into the default branch and is rejected as an unsupported bind type. The offending value is quoted in the error to ease diagnosis.","triggerScenarios":"Submitting an ACL binding rule whose BindType is empty or set to an unknown string like \"role\", \"policy\", or a mis-cased value instead of a supported ACLBindingRuleBindType constant.","commonSituations":"Typo in bind_type; copying examples from Consul (which has different bind types); forgetting to set bind_type at all (empty string hits default); older API clients sending legacy values.","solutions":["Set bind_type to a supported value, e.g. \"management\" or the selector/field bind type used by your Nomad version.","Check spelling and casing of the value.","If bind_type is omitted, set it explicitly rather than sending an empty string."],"exampleFix":"// before\nbind_type = \"policy\"\n\n// after\nbind_type = \"management\"","handlingStrategy":"validation","validationCode":"var validBindTypes = map[string]bool{\"management\": true, \"field\": true}\nif !validBindTypes[rule.BindType] {\n    return fmt.Errorf(\"bind_type %q unsupported\", rule.BindType)\n}","typeGuard":"func isValidBindType(s string) bool {\n    return s == \"management\" || s == \"field\"\n}","tryCatchPattern":null,"preventionTips":["Always set bind_type explicitly; never rely on defaults.","Validate enum fields in CI before applying Nomad config.","Check your Nomad version's supported bind types."],"tags":["nomad","acl","binding-rule","enum-value","validation"],"backgroundTag":"invalid-enum-value","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"}