{"record":{"id":"674306e45aaf89ea","repo":"hashicorp/nomad","slug":"bind-name-is-missing","errorCode":null,"errorMessage":"bind name is missing","messagePattern":"bind name is missing","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/acl.go","lineNumber":2101,"sourceCode":"\n\tvar mErr multierror.Error\n\n\tif a.AuthMethod == \"\" {\n\t\tmErr.Errors = append(mErr.Errors, errors.New(\"auth method is missing\"))\n\t}\n\tif len(a.Description) > maxACLBindingRuleDescriptionLength {\n\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","sourceCodeStart":2083,"sourceCodeEnd":2119,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/acl.go#L2083-L2119","documentation":"When BindType is \"role\" or \"policy\", the rule must say which role or policy to bind to via BindName. Validate() appends this error when those bind types are selected but BindName is empty. (For \"management\" the inverse applies: BindName should be empty.)","triggerScenarios":"ACLBindingRule.Validate() with BindType role or policy and BindName == \"\"; e.g. nomad acl binding-rule create -type policy without -bind-name.","commonSituations":"CLI invocations missing the bind-name flag; rename operations that cleared BindName; users assuming management-style rules (which need no name) also apply to role/policy types.","solutions":["Set BindName to the exact name of an existing ACL role or policy","If the rule should grant management, switch BindType to \"management\" and leave BindName empty","Verify the target role/policy exists to avoid follow-on reference errors"],"exampleFix":"// before\nrule := &structs.ACLBindingRule{\n  AuthMethod: \"okoidc\",\n  BindType: structs.ACLBindingRuleBindTypePolicy,\n}\n// after\nrule := &structs.ACLBindingRule{\n  AuthMethod: \"okoidc\",\n  BindType: structs.ACLBindingRuleBindTypePolicy,\n  BindName: \"eng-dev\",\n}","handlingStrategy":"validation","validationCode":"if (rule.BindType == structs.ACLBindingRuleBindTypeRole ||\n    rule.BindType == structs.ACLBindingRuleBindTypePolicy) && rule.BindName == \"\" {\n    return errors.New(\"role/policy binding rules require BindName\")\n}","typeGuard":null,"tryCatchPattern":"if err := rule.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"bind name is missing\") {\n        // set rule.BindName (or switch to management type) and resubmit\n    }\n    return err\n}","preventionTips":["Pair every role/policy bind type with an explicit BindName","Verify the bound role/policy exists in the same region/namespace","Remember management rules must NOT have a BindName"],"tags":["nomad","acl","binding-rule","config-validation"],"backgroundTag":"missing-required-argument","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"}