apache/flink · critical · FlinkRuntimeException
Could not create the Dispatcher rpc endpoint.
Error message
Could not create the Dispatcher rpc endpoint.
What it means
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.
Source
Thrown at flink-clients/src/main/java/org/apache/flink/client/deployment/application/ApplicationDispatcherGatewayServiceFactory.java:150
try {
dispatcher =
dispatcherFactory.createDispatcher(
rpcService,
fencingToken,
recoveredJobs,
recoveredDirtyJobResults,
recoveredApplications,
recoveredDirtyApplicationResults,
(dispatcherGateway, scheduledExecutor, errorHandler) ->
new ApplicationBootstrap(bootstrapApplication),
PartialDispatcherServicesWithPersistenceComponents.from(
partialDispatcherServices,
executionPlanWriter,
jobResultStore,
applicationStore,
applicationResultStore));
} catch (Exception e) {
throw new FlinkRuntimeException("Could not create the Dispatcher rpc endpoint.", e);
}
dispatcher.start();
return DefaultDispatcherGatewayService.from(dispatcher);
}
private List<JobInfo> getRecoveredJobInfos(final Collection<ExecutionPlan> recoveredJobs) {
return recoveredJobs.stream()
.map(
executionPlan ->
new JobInfoImpl(executionPlan.getJobID(), executionPlan.getName()))
.collect(Collectors.toList());
}
private List<JobInfo> getRecoveredTerminalJobInfos(
final Collection<JobResult> recoveredDirtyJobResults) {
return recoveredDirtyJobResults.stream()View on GitHub (pinned to 2f3c205e92)
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
Defensive patterns
Strategy: try-catch
Try / catch
try {
DispatcherGatewayService service = factory.create(partialDispatcherServices, ...);
} catch (FlinkRuntimeException e) {
Throwable cause = e.getCause();
LOG.error("Dispatcher creation failed: {}", cause.getMessage(), cause);
// check for port conflicts, storage path issues, HA connectivity
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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).
Related errors
- Invalid cluster id "%s". The expected format is [0-9a-fA-F]{
- The configuration directory '{}', specified in the '{}' envi
- The configuration directory was not specified. Please specif
- No valid command-line found.
- Application Mode not supported by standalone deployments.
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/58a93297a9d6665e.
Report an issue: GitHub.