{"record":{"id":"d9ecf926fce364f0","repo":"aeron-io/aeron","slug":"authorisation-service-cannot-be-null","errorCode":null,"errorMessage":"authorisation service cannot be null","messagePattern":"authorisation service cannot be null","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"aeron-archive/src/main/java/io/aeron/archive/ArchiveConductor.java","lineNumber":218,"sourceCode":"        connectTimeoutMs = TimeUnit.NANOSECONDS.toMillis(ctx.connectTimeoutNs());\n        sessionLivenessCheckIntervalMs = TimeUnit.NANOSECONDS.toMillis(ctx.sessionLivenessCheckIntervalNs());\n        catalog = ctx.catalog();\n        markFile = ctx.archiveMarkFile();\n        dutyCycleTracker = ctx.conductorDutyCycleTracker();\n        cachedEpochClock.update(epochClock.time());\n\n        random = ctx.secureRandom();\n\n        authenticator = ctx.authenticatorSupplier().get();\n        if (null == authenticator)\n        {\n            throw new ArchiveException(\"authenticator cannot be null\");\n        }\n\n        authorisationService = ctx.authorisationServiceSupplier().get();\n        if (null == authorisationService)\n        {\n            throw new ArchiveException(\"authorisation service cannot be null\");\n        }\n\n        unavailableCounterHandlerRegistrationId = aeron.addUnavailableCounterHandler(this);\n        closeHandlerRegistrationId = aeron.addCloseHandler(this::abort);\n\n        recordingEventsProxy = ctx.recordingEventsEnabled() ? new RecordingEventsProxy(\n            aeron.addExclusivePublication(ctx.recordingEventsChannel(), ctx.recordingEventsStreamId())) : null;\n\n        if (ctx.controlChannelEnabled())\n        {\n            final ChannelUri controlChannelUri = ChannelUri.parse(ctx.controlChannel());\n            controlChannelUri.put(CommonContext.SPARSE_PARAM_NAME, Boolean.toString(ctx.controlTermBufferSparse()));\n            controlSubscription = addSubscriptionWithRetry(\n                aeron, ctx.idleStrategy(), controlChannelUri.toString(), ctx.controlStreamId(), this);\n        }\n        else\n        {\n            controlSubscription = null;","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-archive/src/main/java/io/aeron/archive/ArchiveConductor.java#L200-L236","documentation":"ArchiveConductor obtains the AuthorisationService via ctx.authorisationServiceSupplier().get() at startup. A null service is rejected with ArchiveException because every archive request must be checked against a service; use a permissive service when authorisation is not needed.","triggerScenarios":"Launching Archive with an authorisationServiceSupplier whose get() returns null, e.g. an unconfigured DI provider or a custom lambda returning null.","commonSituations":"Applications wiring authentication but forgetting authorisation; custom supplier factories that return null when no service class is configured.","solutions":["Fix the authorisationServiceSupplier to return a non-null AuthorisationService.","Supply a permissive AuthorisationService that always returns true for isAuthorised when access control is not required.","Verify the DI/supplier wiring so the intended service bean is actually constructed."],"exampleFix":"// before\nctx.authorisationServiceSupplier(() -> null);\n// after\nctx.authorisationServiceSupplier(() -> (protocolId, actionId, ctx) -> true); // allow-all service","handlingStrategy":"validation","validationCode":"AuthorisationService s = ctx.authorisationServiceSupplier().get();\nif (s == null)\n{\n    throw new IllegalStateException(\"authorisationServiceSupplier must return a non-null service\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Supply an allow-all AuthorisationService when authorisation is not needed","Verify DI wiring resolves a concrete AuthorisationService bean"],"tags":["aeron","archive","authorisation","null"],"backgroundTag":"null-argument","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}