{"record":{"id":"a3defa0ebcc22a2b","repo":"apache/seatunnel","slug":"the-job-is-running-in-local-mode-can-not-use-asyn","errorCode":null,"errorMessage":"The job is running in local mode, can not use async mode.","messagePattern":"The job is running in local mode, can not use async mode\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/command/ClientExecuteCommand.java","lineNumber":232,"sourceCode":"                } else {\n                    jobExecutionEnv =\n                            engineClient.createExecutionContext(\n                                    configFile.toString(),\n                                    clientCommandArgs.getVariables(),\n                                    jobConfig,\n                                    seaTunnelConfig,\n                                    clientCommandArgs.getCustomJobId() != null\n                                            ? Long.parseLong(clientCommandArgs.getCustomJobId())\n                                            : null);\n                }\n\n                // get job start time\n                startTime = LocalDateTime.now();\n                // create job proxy\n                ClientJobProxy clientJobProxy = jobExecutionEnv.execute();\n                if (clientCommandArgs.isAsync()) {\n                    if (isLocalMode) {\n                        log.warn(\"The job is running in local mode, can not use async mode.\");\n                    } else {\n                        return;\n                    }\n                }\n                // register cancelJob hook\n                Runtime.getRuntime()\n                        .addShutdownHook(\n                                new Thread(\n                                        () -> {\n                                            CompletableFuture<Void> future =\n                                                    CompletableFuture.runAsync(\n                                                            () -> {\n                                                                log.info(\n                                                                        \"run shutdown hook because get close signal\");\n                                                                shutdownHook(clientJobProxy);\n                                                            });\n                                            try {\n                                                future.get(15, TimeUnit.SECONDS);","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/command/ClientExecuteCommand.java#L214-L250","documentation":"In ClientExecuteCommand, when the user passes the async flag (-m async / --async) while the job runs in local mode, the client cannot return early because there is no separate cluster to poll asynchronously. It logs a warning and falls back to synchronous waiting for job completion.","triggerScenarios":"Running `seatunnel.sh --config job.conf -e local -m run` combined with the async CLI flag, i.e. local execution mode plus `-n`/async option enabled.","commonSituations":"Copy-pasting a cluster-mode command template and adding `-e local` for a quick test while forgetting to remove the async flag.","solutions":["Remove the async flag when using `-e local` mode.","Run against a real cluster (drop `-e local`) if you want fire-and-forget async submission.","Treat this as informational: the job still runs, just synchronously."],"exampleFix":"// before\nsh bin/seatunnel.sh --config job.conf -e local -m run\n// after: drop async for local mode\nsh bin/seatunnel.sh --config job.conf -e local","handlingStrategy":"validation","validationCode":"# shell pre-check before invoking\ngrep -q -- '-e local' <<< \"$ARGS\" && grep -q -- '-m run' <<< \"$ARGS\" && echo 'async flag ignored in local mode'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never combine `-e local` with the async option in command templates.","Keep separate command templates for local vs cluster submission.","Check starter logs for this warning when jobs unexpectedly block the terminal."],"tags":["cli","local-mode","async","flag-conflict"],"backgroundTag":"conflicting-config-options","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}