{"record":{"id":"777ae335f19272cc","repo":"apache/rocketmq","slug":"the-authorizationmetadataprovider-is-not-configure","errorCode":null,"errorMessage":"The authorizationMetadataProvider is not configured.","messagePattern":"The authorizationMetadataProvider is not configured\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"auth/src/main/java/org/apache/rocketmq/auth/authentication/manager/AuthenticationMetadataManagerImpl.java","lineNumber":218,"sourceCode":"            throw new AuthenticationException(\"password can not be blank\");\n        }\n    }\n\n    private void handleException(Exception e, CompletableFuture<?> result) {\n        Throwable throwable = ExceptionUtils.getRealException(e);\n        result.completeExceptionally(throwable);\n    }\n\n    private AuthenticationMetadataProvider getAuthenticationMetadataProvider() {\n        if (authenticationMetadataProvider == null) {\n            throw new IllegalStateException(\"The authenticationMetadataProvider is not configured.\");\n        }\n        return authenticationMetadataProvider;\n    }\n\n    private AuthorizationMetadataProvider getAuthorizationMetadataProvider() {\n        if (authorizationMetadataProvider == null) {\n            throw new IllegalStateException(\"The authorizationMetadataProvider is not configured.\");\n        }\n        return authorizationMetadataProvider;\n    }\n}\n","sourceCodeStart":200,"sourceCodeEnd":223,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/auth/src/main/java/org/apache/rocketmq/auth/authentication/manager/AuthenticationMetadataManagerImpl.java#L200-L223","documentation":"IllegalStateException from the manager's second lazy accessor: the AuthorizationMetadataProvider is null, so operations that touch ACL data fail. It is reached by deleteUser (which cascades deleteAcl for the user) even though the class is the authentication manager - the delete path requires both providers.","triggerScenarios":"deleteUser on a manager initialized without an AuthorizationMetadataProvider; any current or future method calling getAuthorizationMetadataProvider() (currently deleteUser's deleteAcl cascade).","commonSituations":"Same wiring causes as error 18: factory/embedding setups that only supply the authentication provider; partial test doubles; config that names only one provider.","solutions":["Initialize both providers - use the standard AuthenticationFactory/broker wiring which configures authentication and authorization metadata providers together.","If embedding manually, supply a non-null AuthorizationMetadataProvider (they are usually the same underlying manager implementation backed by one store).","Add a startup self-check covering the delete path (not just reads) to catch the missing provider early."],"exampleFix":"// before\n// manager initialized with authentication provider only\nmanager.deleteUser(\"alice\"); // IllegalStateException from getAuthorizationMetadataProvider\n\n// after\n// initialize via factory so both providers are set\nAuthenticationMetadataManager manager = AuthenticationFactory.getMetadataManager(authConfig, metadataService);\nmanager.deleteUser(\"alice\");","handlingStrategy":"validation","validationCode":"// Startup self-check covering the delete path (needs BOTH providers)\nauthManager.getUser(\"__probe__\").thenApply(u -> {\n    // read path OK; now ensure ACL provider is wired by exercising a cheap authorization-side op\n    return authManager.listAcl(null);\n}).join();","typeGuard":null,"tryCatchPattern":"catch (IllegalStateException e) { if message contains \"authorizationMetadataProvider is not configured\" -> fix wiring and restart; runtime retry is pointless. }","preventionTips":["Configure authentication and authorization metadata providers together from one AuthConfig","Test deleteUser in integration CI - it is the path that needs both providers"],"tags":["rocketmq","configuration","metadata-provider","acl"],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}