apache/flink · error · IllegalStateException

Exhausted all job IDs for job name: %s

Error message

Exhausted all job IDs for job name: %s

What it means

Error "Exhausted all job IDs for job name: %s" thrown in apache/flink.

Source

Thrown at flink-clients/src/main/java/org/apache/flink/client/program/JobNameBasedJobIdManager.java:167

        if (firstJobName == null) {
            firstJobName = jobName;
            assignedJobId = baseJobId;
        } else {
            int initialIndex = getInitialIndex(jobName);
            int step = 0;
            while (true) {
                // the calculated index may overflow and wrap around
                int candidateIndex = initialIndex + step;
                JobID candidateId = fromJobIndex(candidateIndex, baseJobId);
                if (!occupiedJobIds.contains(candidateId)) {
                    assignedJobId = candidateId;
                    break;
                }

                // the step may overflow and wrap around
                step++;
                if (step == 0) {
                    throw new IllegalStateException(
                            String.format("Exhausted all job IDs for job name: %s", jobName));
                }
            }
        }
        streamGraph.setJobId(assignedJobId);
        occupiedJobIds.add(assignedJobId);
    }

    @VisibleForTesting
    String getFirstJobName() {
        return firstJobName;
    }

    @VisibleForTesting
    int getInitialIndex(String jobName) {
        checkNotNull(firstJobName);

        return jobName.equals(firstJobName) ? 0 : jobName.hashCode();

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Address the cause reported by the error message: Exhausted all job IDs for job name: the reported value
  2. Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry.

Example fix

Correct the condition described ("Exhausted all job IDs for job name: the reported value") and rerun the job or command.

When it happens

Trigger: Triggered at runtime when the operation fails because: Exhausted all job IDs for job name: the reported value.

Common situations: Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: Exhausted all job IDs for job name: the reported value.


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