{"record":{"id":"1a0ab2a90017fc2f","repo":"apache/flink","slug":"can-t-deploy-a-standalone-cluster","errorCode":null,"errorMessage":"Can't deploy a standalone cluster.","messagePattern":"Can't deploy a standalone cluster\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink-clients/src/main/java/org/apache/flink/client/deployment/StandaloneClusterDescriptor.java","lineNumber":60,"sourceCode":"        return \"Standalone cluster at \" + host + \":\" + port;\n    }\n\n    @Override\n    public ClusterClientProvider<StandaloneClusterId> retrieve(\n            StandaloneClusterId standaloneClusterId) throws ClusterRetrieveException {\n        return () -> {\n            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","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-clients/src/main/java/org/apache/flink/client/deployment/StandaloneClusterDescriptor.java#L42-L78","documentation":"Thrown by StandaloneClusterDescriptor.deploySessionCluster as an UnsupportedOperationException. A standalone cluster by definition is an externally managed process (the user starts/stops the JobManager and TaskManager scripts directly). Flink's API cannot deploy a new session cluster into a standalone deployment because there is no orchestration layer — it can only connect to an already-running one via retrieve().","triggerScenarios":"Programmatically calling deploySessionCluster on a StandaloneClusterDescriptor instance; using the deployment API with execution.target=remote or execution.target=standalone expecting Flink to start the cluster for you.","commonSituations":"Migrating from a managed deployment (YARN/K8s) to standalone and forgetting that the cluster lifecycle must be managed externally; generic deployment code that calls deploySessionCluster on any descriptor type.","solutions":["Start the standalone cluster manually: run start-cluster.sh in FLINK_HOME/bin/, then use retrieve() instead of deploySessionCluster()","Switch to a managed deployment backend (YARN or Kubernetes) if you need Flink to manage cluster lifecycle","If using the programmatic API, branch on the descriptor type and only call deploySessionCluster for YarnClusterDescriptor or KubernetesClusterDescriptor"],"exampleFix":"// before\nstandaloneDescriptor.deploySessionCluster(clusterSpec);\n\n// after\n// start cluster externally, then retrieve\nstart-cluster.sh  // external\nstandaloneDescriptor.retrieve(StandaloneClusterId.getInstance());","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Guard against calling deploySessionCluster on a standalone descriptor:\nif (descriptor instanceof StandaloneClusterDescriptor) {\n    throw new UnsupportedOperationException(\n        \"Cannot deploy a session cluster for standalone. Use start-cluster.sh externally.\");\n}","tryCatchPattern":"try {\n    descriptor.deploySessionCluster(clusterSpec);\n} catch (UnsupportedOperationException e) {\n    LOG.warn(\"This deployment type does not support session deployment: {}\", e.getMessage());\n}","preventionTips":["Branch deployment logic on the descriptor type before calling deploy methods","Use managed deployments (YARN/K8s) if programmatic cluster lifecycle is required","Document which deployment backends support which lifecycle operations"],"tags":["deployment","standalone","unsupported-operation"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}