{"record":{"id":"58a93297a9d6665e","repo":"apache/flink","slug":"could-not-create-the-dispatcher-rpc-endpoint","errorCode":null,"errorMessage":"Could not create the Dispatcher rpc endpoint.","messagePattern":"Could not create the Dispatcher rpc endpoint\\.","errorType":"exception","errorClass":"FlinkRuntimeException","httpStatus":null,"severity":"critical","filePath":"flink-clients/src/main/java/org/apache/flink/client/deployment/application/ApplicationDispatcherGatewayServiceFactory.java","lineNumber":150,"sourceCode":"        try {\n            dispatcher =\n                    dispatcherFactory.createDispatcher(\n                            rpcService,\n                            fencingToken,\n                            recoveredJobs,\n                            recoveredDirtyJobResults,\n                            recoveredApplications,\n                            recoveredDirtyApplicationResults,\n                            (dispatcherGateway, scheduledExecutor, errorHandler) ->\n                                    new ApplicationBootstrap(bootstrapApplication),\n                            PartialDispatcherServicesWithPersistenceComponents.from(\n                                    partialDispatcherServices,\n                                    executionPlanWriter,\n                                    jobResultStore,\n                                    applicationStore,\n                                    applicationResultStore));\n        } catch (Exception e) {\n            throw new FlinkRuntimeException(\"Could not create the Dispatcher rpc endpoint.\", e);\n        }\n\n        dispatcher.start();\n\n        return DefaultDispatcherGatewayService.from(dispatcher);\n    }\n\n    private List<JobInfo> getRecoveredJobInfos(final Collection<ExecutionPlan> recoveredJobs) {\n        return recoveredJobs.stream()\n                .map(\n                        executionPlan ->\n                                new JobInfoImpl(executionPlan.getJobID(), executionPlan.getName()))\n                .collect(Collectors.toList());\n    }\n\n    private List<JobInfo> getRecoveredTerminalJobInfos(\n            final Collection<JobResult> recoveredDirtyJobResults) {\n        return recoveredDirtyJobResults.stream()","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-clients/src/main/java/org/apache/flink/client/deployment/application/ApplicationDispatcherGatewayServiceFactory.java#L132-L168","documentation":"Thrown by ApplicationDispatcherGatewayServiceFactory.create when the Dispatcher RPC endpoint cannot be created. The factory assembles PartialDispatcherServicesWithPersistenceComponents and constructs a Dispatcher; if any step in this assembly chain throws (RPC service initialization failure, persistence store errors, job recovery failures, configuration problems), the exception is caught and wrapped in a FlinkRuntimeException. This occurs during application-mode cluster startup.","triggerScenarios":"Dispatcher RPC service fails to bind to its configured port; the JobResultStore or ApplicationResultStore cannot be initialized (permissions, disk issues); recovered job state is corrupt or incompatible; the partial dispatcher services are missing required components.","commonSituations":"Port conflict on a shared host; persistent state directory (high-availability.storagePath) on a full or read-only filesystem; version upgrade where the old JobResultStore format is incompatible; misconfigured high-availability settings (e.g., ZooKeeper unreachable).","solutions":["Check the wrapped cause in the FlinkRuntimeException for the specific failure","Verify the RPC port (rest.port and the internal RPC port) is available","Ensure the HA storage path is writable and has sufficient disk space","Clear or migrate the JobResultStore if it's corrupt from a failed previous run","Verify ZooKeeper connectivity if high-availability is enabled"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    DispatcherGatewayService service = factory.create(partialDispatcherServices, ...);\n} catch (FlinkRuntimeException e) {\n    Throwable cause = e.getCause();\n    LOG.error(\"Dispatcher creation failed: {}\", cause.getMessage(), cause);\n    // check for port conflicts, storage path issues, HA connectivity\n    throw e;\n}","preventionTips":["Verify RPC and REST ports are available before starting the Dispatcher","Ensure the HA storage path is writable and has disk space","Validate ZooKeeper connectivity if HA is enabled","Clean stale JobResultStore files from previous failed runs"],"tags":["dispatcher","rpc","application-mode","startup","high-availability"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}