apache/flink · error · IllegalStateException

No exception thrown although the job execution was not…

Error message

No exception thrown although the job execution was not successful.

What it means

A sentinel exception from fromJobResult used when a JobResult reports the job was not successful but carries no Throwable cause. It exists to uniformize ATTACHED/DETACHED application-mode behavior so callers always receive an UnsuccessfulExecutionException for failed jobs.

Solutions

  1. Address the cause reported by the error message: No exception thrown although the job execution was not successful.
  2. Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry.

Example fix

Correct the condition described ("No exception thrown although the job execution was not successful.") and rerun the job or command.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Triggered at runtime when the operation fails because: No exception thrown although the job execution was not successful.

Common situations: Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: No exception thrown although the job execution was not successful.


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/05ac0eaffbb2c220. Report an issue: GitHub.

Appendix: source

Thrown at flink-clients/src/main/java/org/apache/flink/client/deployment/application/UnsuccessfulExecutionException.java:65

    }

    public Optional<JobStatus> getStatus() {
        return Optional.ofNullable(status);
    }

    public static UnsuccessfulExecutionException fromJobResult(
            final JobResult result, final ClassLoader userClassLoader) {

        checkState(result != null && !result.isSuccess());
        checkNotNull(userClassLoader);

        // We do this to uniformize the behavior of the "ATTACHED" and "DETACHED"
        // in application mode, while maintaining the expected exceptions thrown in case
        // of a failed job execution.

        try {
            result.toJobExecutionResult(userClassLoader);
            throw new IllegalStateException(
                    "No exception thrown although the job execution was not successful.");

        } catch (Throwable t) {

            final JobID jobID = result.getJobId();
            final JobStatus status = result.getJobStatus().orElse(null);

            return status == JobStatus.CANCELED || status == JobStatus.FAILED
                    ? new UnsuccessfulExecutionException(
                            jobID, status, "Job Status: " + status.name(), t)
                    : new UnsuccessfulExecutionException(
                            jobID, null, "Job failed for unknown reason.", t);
        }
    }
}

View on GitHub (pinned to 2f3c205e92)