{"record":{"id":"69ff785e37f04798","repo":"apache/flink","slug":"application-mode-not-supported-by-standalone-deplo","errorCode":null,"errorMessage":"Application Mode not supported by standalone deployments.","messagePattern":"Application Mode not supported by standalone deployments\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink-clients/src/main/java/org/apache/flink/client/deployment/StandaloneClusterDescriptor.java","lineNumber":67,"sourceCode":"            try {\n                return new RestClusterClient<>(config, standaloneClusterId);\n            } catch (Exception e) {\n                throw new RuntimeException(\"Couldn't retrieve standalone cluster\", e);\n            }\n        };\n    }\n\n    @Override\n    public ClusterClientProvider<StandaloneClusterId> deploySessionCluster(\n            ClusterSpecification clusterSpecification) {\n        throw new UnsupportedOperationException(\"Can't deploy a standalone cluster.\");\n    }\n\n    @Override\n    public ClusterClientProvider<StandaloneClusterId> deployApplicationCluster(\n            final ClusterSpecification clusterSpecification,\n            final ApplicationConfiguration applicationConfiguration) {\n        throw new UnsupportedOperationException(\n                \"Application Mode not supported by standalone deployments.\");\n    }\n\n    @Override\n    public void killCluster(StandaloneClusterId clusterId) throws FlinkException {\n        throw new UnsupportedOperationException(\"Cannot terminate a standalone cluster.\");\n    }\n\n    @Override\n    public void close() {\n        // nothing to do\n    }\n}\n","sourceCodeStart":49,"sourceCodeEnd":81,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-clients/src/main/java/org/apache/flink/client/deployment/StandaloneClusterDescriptor.java#L49-L81","documentation":"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.","triggerScenarios":"Configuring execution.target=remote or execution.target=standalone with application-mode deployment options; calling deployApplicationCluster programmatically on a StandaloneClusterDescriptor.","commonSituations":"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.","solutions":["Use Kubernetes or YARN as the deployment target for application mode","Switch to session mode for standalone deployments (submit jobs via StreamExecutionEnvironment.execute or the CLI)","If you need application-mode behavior, consider wrapping your job in a script that starts the cluster, submits the job, and stops the cluster"],"exampleFix":"// before\nconfig.set(DeploymentOptions.TARGET, \"remote\");\nstandaloneDescriptor.deployApplicationCluster(clusterSpec, appConfig);\n\n// after\nconfig.set(DeploymentOptions.TARGET, \"kubernetes-application\");\nk8sDescriptor.deployApplicationCluster(clusterSpec, appConfig);","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Guard against calling deployApplicationCluster on a standalone descriptor:\nif (descriptor instanceof StandaloneClusterDescriptor) {\n    throw new UnsupportedOperationException(\n        \"Application mode requires a managed deployment (YARN or Kubernetes).\");\n}","tryCatchPattern":"try {\n    descriptor.deployApplicationCluster(clusterSpec, appConfig);\n} catch (UnsupportedOperationException e) {\n    LOG.warn(\"Application mode not supported by this deployment type: {}\", e.getMessage());\n}","preventionTips":["Use Kubernetes or YARN for application mode deployments","Check the descriptor type before calling deployApplicationCluster","Document the deployment matrix: which modes each backend supports"],"tags":["deployment","standalone","application-mode","unsupported-operation"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}