{"record":{"id":"e12b260145fc0f76","repo":"vitessio/vitess","slug":"aclfactory-for-given-default-s-is-not-found","errorCode":null,"errorMessage":"aclFactory for given default: %s is not found","messagePattern":"aclFactory for given default: (.+?) is not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/tableacl/tableacl.go","lineNumber":320,"sourceCode":"// GetCurrentACLFactory returns current table acl implementation.\nfunc GetCurrentACLFactory() (acl.Factory, error) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tif len(acls) == 0 {\n\t\treturn nil, errors.New(\"no AclFactories registered\")\n\t}\n\tif defaultACL == \"\" {\n\t\tif len(acls) == 1 {\n\t\t\tfor _, aclFactory := range acls {\n\t\t\t\treturn aclFactory, nil\n\t\t\t}\n\t\t}\n\t\treturn nil, errors.New(\"there are more than one AclFactory registered but no default has been given\")\n\t}\n\tif aclFactory, ok := acls[defaultACL]; ok {\n\t\treturn aclFactory, nil\n\t}\n\treturn nil, fmt.Errorf(\"aclFactory for given default: %s is not found\", defaultACL)\n}\n","sourceCodeStart":302,"sourceCodeEnd":322,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/tableacl/tableacl.go#L302-L322","documentation":"GetCurrentACLFactory resolves the configured default ACL factory by name from the set of registered factories. If the configured default does not match any registered factory name, lookup fails and this error is returned.","triggerScenarios":"Calling tableacl.GetCurrentACLFactory (directly or via NewQueryEngine) when --queryserver-config-acl-exempt-acl or tableacl default config names a factory that was never registered via RegisterACLFactory.","commonSituations":"Typo in the ACL default name (e.g. 'simple' vs 'Simple'), setting a default in config without importing the package that registers that factory, or an empty default while multiple factories are registered (different 'more than one' error).","solutions":["Check the configured default ACL name against registered factories (simple, json, etc.)","Fix the config flag/tableacl config value to a registered factory name","Ensure the package providing the factory is imported/registered before use","If you only want one factory registered, deregister others or set the default explicitly"],"exampleFix":"// before: default 'Ldap' never registered\ntableacl.Init(...defaultACL=\"Ldap\")\n// after: use a registered factory or register yours\ntableacl.RegisterACLFactory(\"Ldap\", myFactory) // or defaultACL=\"Simple\"","handlingStrategy":"validation","validationCode":"if tableacl.GetCurrentACLFactoryCount() > 1 && defaultACL == \"\" {\n    return errors.New(\"set a default ACL factory name\")\n}\n// confirm the name is registered before resolving\nif !tableacl.IsRegistered(defaultACL) {\n    return fmt.Errorf(\"unknown ACL factory %q\", defaultACL)\n}","typeGuard":null,"tryCatchPattern":"factory, err := tableacl.GetCurrentACLFactory()\nif err != nil {\n    return fmt.Errorf(\"check --queryserver-config-acl-exempt-acl / tableacl default: %w\", err)\n}","preventionTips":["Use exact registered factory names (case-sensitive)","Import the package registering the factory you configure","Document supported ACL factory names in your deployment config"],"tags":["tableacl","configuration","factory"],"backgroundTag":"acl-factory-not-found","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}