apache/flink · error · UnsupportedOperationException

Application Mode not supported by standalone deployments.

Error message

Application Mode not supported by standalone deployments.

What it means

Thrown by StandaloneClusterDescriptor.deployApplicationCluster as an UnsupportedOperationException. Application mode runs the job's main() method directly on the JobManager, which requires the cluster lifecycle to be managed by Flink (the cluster starts, runs the single application, and exits). A standalone deployment has no mechanism for Flink to inject application-mode semantics into the externally managed JobManager process, so the operation is explicitly rejected.

Source

Thrown at flink-clients/src/main/java/org/apache/flink/client/deployment/StandaloneClusterDescriptor.java:67

            try {
                return new RestClusterClient<>(config, standaloneClusterId);
            } catch (Exception e) {
                throw new RuntimeException("Couldn't retrieve standalone cluster", e);
            }
        };
    }

    @Override
    public ClusterClientProvider<StandaloneClusterId> deploySessionCluster(
            ClusterSpecification clusterSpecification) {
        throw new UnsupportedOperationException("Can't deploy a standalone cluster.");
    }

    @Override
    public ClusterClientProvider<StandaloneClusterId> deployApplicationCluster(
            final ClusterSpecification clusterSpecification,
            final ApplicationConfiguration applicationConfiguration) {
        throw new UnsupportedOperationException(
                "Application Mode not supported by standalone deployments.");
    }

    @Override
    public void killCluster(StandaloneClusterId clusterId) throws FlinkException {
        throw new UnsupportedOperationException("Cannot terminate a standalone cluster.");
    }

    @Override
    public void close() {
        // nothing to do
    }
}

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Use Kubernetes or YARN as the deployment target for application mode
  2. Switch to session mode for standalone deployments (submit jobs via StreamExecutionEnvironment.execute or the CLI)
  3. If you need application-mode behavior, consider wrapping your job in a script that starts the cluster, submits the job, and stops the cluster

Example fix

// before
config.set(DeploymentOptions.TARGET, "remote");
standaloneDescriptor.deployApplicationCluster(clusterSpec, appConfig);

// after
config.set(DeploymentOptions.TARGET, "kubernetes-application");
k8sDescriptor.deployApplicationCluster(clusterSpec, appConfig);
Defensive patterns

Strategy: type-guard

Type guard

// Guard against calling deployApplicationCluster on a standalone descriptor:
if (descriptor instanceof StandaloneClusterDescriptor) {
    throw new UnsupportedOperationException(
        "Application mode requires a managed deployment (YARN or Kubernetes).");
}

Try / catch

try {
    descriptor.deployApplicationCluster(clusterSpec, appConfig);
} catch (UnsupportedOperationException e) {
    LOG.warn("Application mode not supported by this deployment type: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Configuring execution.target=remote or execution.target=standalone with application-mode deployment options; calling deployApplicationCluster programmatically on a StandaloneClusterDescriptor.

Common situations: Attempting to run application mode for resource efficiency or isolation but targeting a standalone cluster that doesn't support it; migration from K8s/YARN application mode to standalone without changing the execution target.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/69ff785e37f04798. Report an issue: GitHub.