{"record":{"id":"982f87f4055653ef","repo":"alibaba/nacos","slug":"built-in-ldap-auth-plugin-is-not-available","errorCode":null,"errorMessage":"Built-in LDAP auth plugin is not available","messagePattern":"Built-in LDAP auth plugin is not available","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"plugin-default-impl/nacos-ldap-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/ldap/LdapPluginConfiguration.java","lineNumber":88,"sourceCode":"    }\n    \n    @Bean\n    public GlobalAuthenticationConfigurerAdapter authenticationConfigurer(\n        LdapAuthenticationProvider ldapAuthenticationProvider) {\n        return new GlobalAuthenticationConfigurerAdapter() {\n            \n            @Override\n            public void init(AuthenticationManagerBuilder auth) {\n                auth.authenticationProvider(ldapAuthenticationProvider);\n            }\n        };\n    }\n    \n    static LdapAuthPluginService getLdapAuthPluginService() {\n        AuthPluginService plugin = AuthPluginManager.getInstance().getAllPlugins()\n            .get(AuthConstants.LDAP_AUTH_PLUGIN_TYPE);\n        if (!(plugin instanceof LdapAuthPluginService)) {\n            throw new IllegalStateException(\"Built-in LDAP auth plugin is not available\");\n        }\n        return (LdapAuthPluginService) plugin;\n    }\n}\n","sourceCodeStart":70,"sourceCodeEnd":93,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/plugin-default-impl/nacos-ldap-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/ldap/LdapPluginConfiguration.java#L70-L93","documentation":"Thrown by LdapPluginConfiguration.getLdapAuthPluginService() when the registered AuthPluginService for the LDAP auth type is not an instance of LdapAuthPluginService. This indicates the built-in LDAP plugin failed to load or register correctly, so the type check fails and an IllegalStateException is thrown. Unlike MissingLdapAuthenticationManager (which starts the server but fails auth), this is a startup/wiring failure.","triggerScenarios":"getLdapAuthPluginService() is called during Spring configuration wiring; AuthPluginManager.getAllPlugins().get(LDAP_AUTH_PLUGIN_TYPE) returns null or a non-LdapAuthPluginService instance, failing the instanceof check at line 88.","commonSituations":"The LDAP auth plugin SPI jar is missing or corrupted so it never registered; a conflicting custom plugin claims the LDAP type name; the plugin threw during initialization and registered a broken instance; classpath shading split the LdapAuthPluginService interface from its impl.","solutions":["Verify the nacos-ldap-auth-plugin jar is present and intact in the classpath/plugins directory.","Check startup logs for an SPI load failure or exception during LDAP plugin initialization.","Ensure no other plugin is shadowing the LDAP_AUTH_PLUGIN_TYPE identifier.","Confirm the LdapAuthPluginService interface and its implementation come from the same classloader (no shaded-duplicate conflict)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    LdapAuthPluginService service = LdapPluginConfiguration.getLdapAuthPluginService();\n} catch (IllegalStateException e) {\n    // plugin failed to load; check SPI jar and startup logs\n}","preventionTips":["Verify the LDAP auth plugin jar is present and loads its SPI at startup.","Check startup logs for AuthPluginManager initialization of the LDAP type.","Ensure no classloader/shading conflict splits the plugin interface from its implementation."],"tags":["auth","ldap","plugin","spi","spring","illegal-state","wiring","java"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}