{"record":{"id":"299e61b89bdde857","repo":"apache/flink","slug":"failed-to-execute-job-jobname","errorCode":null,"errorMessage":"Failed to execute job '{jobName}'.","messagePattern":"Failed to execute job '(.+?)'\\.","errorType":"exception","errorClass":"FlinkException","httpStatus":null,"severity":"critical","filePath":"flink-datastream/src/main/java/org/apache/flink/datastream/impl/ExecutionEnvironmentImpl.java","lineNumber":311,"sourceCode":"            Throwable strippedException = ExceptionUtils.stripExecutionException(t);\n            ExceptionUtils.rethrowException(strippedException);\n        }\n    }\n\n    private JobClient executeAsync(StreamGraph streamGraph) throws Exception {\n        checkNotNull(streamGraph, \"StreamGraph cannot be null.\");\n        final PipelineExecutor executor = getPipelineExecutor();\n\n        CompletableFuture<JobClient> jobClientFuture =\n                executor.execute(streamGraph, configuration, getClass().getClassLoader());\n\n        try {\n            // TODO Supports job listeners.\n            return jobClientFuture.get();\n        } catch (ExecutionException executionException) {\n            final Throwable strippedException =\n                    ExceptionUtils.stripExecutionException(executionException);\n            throw new FlinkException(\n                    String.format(\"Failed to execute job '%s'.\", streamGraph.getJobName()),\n                    strippedException);\n        }\n    }\n\n    /** Get {@link StreamGraph} and clear all transformations. */\n    public StreamGraph getStreamGraph() {\n        final StreamGraph streamGraph = getStreamGraphGenerator(transformations).generate();\n        transformations.clear();\n        return streamGraph;\n    }\n\n    private StreamGraphGenerator getStreamGraphGenerator(List<Transformation<?>> transformations) {\n        if (transformations.size() <= 0) {\n            throw new IllegalStateException(\n                    \"No operators defined in streaming topology. Cannot execute.\");\n        }\n","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-datastream/src/main/java/org/apache/flink/datastream/impl/ExecutionEnvironmentImpl.java#L293-L329","documentation":"FlinkException thrown by ExecutionEnvironmentImpl.executeAsync/execute when the PipelineExecutor's returned future completes exceptionally. The original failure is stripped of its ExecutionException wrapper and attached as the cause, with the StreamGraph's job name interpolated into the message.","triggerScenarios":"env.execute() where job submission fails: missing executor factory for the configured target, cluster unreachable, invalid DeploymentOptions.TARGET, classloader issues loading the executor, or any failure inside PipelineExecutor.execute(...).","commonSituations":"Wrong execution.target configuration (e.g. no flink-kubernetes dependency for 'kubernetes-session'), JobManager not running at the configured address, missing executor JARs on the classpath, or the executor failing during StreamGraph→ExecutionGraph translation.","solutions":["Inspect the stripped cause via exception.getCause() — the real failure is never this message itself","Verify DeploymentOptions.TARGET ('local', 'remote', 'yarn', ...) matches the executor dependencies on your classpath","Check the cluster/JobManager is reachable and the deployment options (address, parallelism, jars) are valid","If the cause is a classloader/ServiceLoader error, confirm the executor service provider JAR is present"],"exampleFix":"// before\nJobClient client = env.execute(\"my-job\");\n\n// after\ntry {\n    JobClient client = env.execute(\"my-job\");\n} catch (FlinkException e) {\n    log.error(\"Submission failed, root cause: {}\", e.getCause());\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    env.execute(jobName);\n} catch (FlinkException e) {\n    Throwable root = ExceptionUtils.stripExecutionException(e.getCause() != null ? e.getCause() : e);\n    // act on root: connectivity, executor factory, config\n    throw new RuntimeException(\"submission failed: \" + root, root);\n}","preventionTips":["Validate execution.target and executor dependencies before submit","Smoke-test submission against a local mini-cluster in CI"],"tags":["datastream-v2","job-submission","executor"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}