{"record":{"id":"5b20cf3e3ca14866","repo":"apache/seatunnel","slug":"cluster-name-is-required-please-specify-it-using","errorCode":null,"errorMessage":"Cluster name is required. Please specify it using -cn or --cluster option.","messagePattern":"Cluster name is required\\. Please specify it using -cn or --cluster option\\.","errorType":"exception","errorClass":"SeaTunnelEngineException","httpStatus":null,"severity":"error","filePath":"seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/command/ServerExecuteCommand.java","lineNumber":121,"sourceCode":"                if (m.matches()) {\n                    return Integer.parseInt(m.group(3)) == 0 && Integer.parseInt(m.group(4)) < 102;\n                }\n                return true;\n            } catch (Exception e) {\n                return true;\n            }\n        } else {\n            return !SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8);\n        }\n    }\n\n    @VisibleForTesting\n    public Set<Member> showClusterMembers() {\n        HazelcastClientInstanceImpl client = null;\n        try {\n            String clusterName = serverCommandArgs.getClusterName();\n            if (StringUtils.isBlank(clusterName)) {\n                throw new SeaTunnelEngineException(\n                        \"Cluster name is required. Please specify it using -cn or --cluster option.\");\n            }\n            ClientConfig clientConfig = ConfigProvider.locateAndGetClientConfig();\n            clientConfig.setClusterName(clusterName);\n            client =\n                    ((HazelcastClientProxy) HazelcastClient.newHazelcastClient(clientConfig))\n                            .client;\n            if (!client.getLifecycleService().isRunning()) {\n                throw new SeaTunnelEngineException(\n                        String.format(\n                                \"cluster: %s is not running, Please start the cluster first.\",\n                                clusterName));\n            }\n            Set<Member> members = client.getCluster().getMembers();\n            if (members.isEmpty()) {\n                System.out.println(\"No active members found in the cluster.\");\n                return members;\n            }","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/command/ServerExecuteCommand.java#L103-L139","documentation":"The `-m` / members command connects to a running SeaTunnel cluster as a Hazelcast client and needs to know which cluster to join. showClusterMembers throws SeaTunnelEngineException when no cluster name was provided via `-cn`/`--cluster`, because connecting without an explicit name could hit the wrong cluster. It fails before any network attempt is made.","triggerScenarios":"Running `seatunnel-cluster.sh -m` (members) without `-cn <name>`/`--cluster <name>` while serverCommandArgs.getClusterName() returns blank.","commonSituations":"Operators running the members command against a cluster that was started with a custom -cn value but forgetting to pass the same name to the client command; multi-cluster environments where defaults are not safe.","solutions":["Pass the cluster name: `seatunnel-cluster.sh -m -cn <clusterName>`","Use the same `-cn` value the cluster was started with (default is seatunnel-cluster if unset)","Set the cluster name in the Hazelcast client config if scripting the call","Check the running cluster's JVM args or seatunnel.yaml to confirm its cluster name"],"exampleFix":"// before\nsh bin/seatunnel-cluster.sh -m\n// after\nsh bin/seatunnel-cluster.sh -m -cn seatunnel-cluster","handlingStrategy":"validation","validationCode":"if (args.getClusterName() == null || args.getClusterName().isBlank()) {\n    throw new IllegalArgumentException(\"Pass -cn <clusterName> to the members command\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Set<Member> members = command.showClusterMembers();\n} catch (SeaTunnelEngineException e) {\n    if (e.getMessage().contains(\"Cluster name is required\")) {\n        log.error(\"Re-run with -cn <clusterName>\");\n    }\n}","preventionTips":["Always pass -cn matching the running cluster","Store the cluster name in deployment env/config","Use the same -cn for cluster start and client commands","Default name is seatunnel-cluster; confirm before relying on it"],"tags":["cli","cluster","hazelcast","missing-option"],"backgroundTag":"missing-required-flag","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}