apache/flink · error · InvalidProgramException
The iteration {} has no workset defined (is not closed).
Error message
The iteration {} has no workset defined (is not closed). What it means
Thrown by CollectionExecutor.executeDeltaIteration() when iteration.getNextWorkset() returns null. The next workset defines what data the next iteration step will process; a null value means the delta iteration was not fully closed — closeWith() was either not called or was called without a next workset argument. This is an InvalidProgramException.
Source
Thrown at flink-core/src/main/java/org/apache/flink/api/common/operators/CollectionExecutor.java:424
throws Exception {
Operator<?> solutionInput = iteration.getInitialSolutionSet();
Operator<?> worksetInput = iteration.getInitialWorkset();
if (solutionInput == null) {
throw new InvalidProgramException(
"The delta iteration " + iteration.getName() + " has no initial solution set.");
}
if (worksetInput == null) {
throw new InvalidProgramException(
"The delta iteration " + iteration.getName() + " has no initial workset.");
}
if (iteration.getSolutionSetDelta() == null) {
throw new InvalidProgramException(
"The iteration "
+ iteration.getName()
+ " has no solution set delta defined (is not closed).");
}
if (iteration.getNextWorkset() == null) {
throw new InvalidProgramException(
"The iteration "
+ iteration.getName()
+ " has no workset defined (is not closed).");
}
List<T> solutionInputData = (List<T>) execute(solutionInput, jobInfo);
List<T> worksetInputData = (List<T>) execute(worksetInput, jobInfo);
// get the operators that are iterative
Set<Operator<?>> dynamics = new LinkedHashSet<Operator<?>>();
DynamicPathCollector dynCollector = new DynamicPathCollector(dynamics);
iteration.getSolutionSetDelta().accept(dynCollector);
iteration.getNextWorkset().accept(dynCollector);
BinaryOperatorInformation<?, ?, ?> operatorInfo = iteration.getOperatorInfo();
TypeInformation<?> solutionType = operatorInfo.getFirstInputType();
int[] keyColumns = iteration.getSolutionSetKeyFields();View on GitHub (pinned to 2f3c205e92)
Solutions
- Use the two-argument closeWith(solutionSetDelta, nextWorkset) form for delta iterations.
- Verify that nextWorkset is a non-null DataSet produced by the step function.
- Review the delta iteration close pattern: closeWith(delta, nextWorkset) requires both arguments.
Example fix
// before — only one argument to closeWith DataSet<S> result = iter.closeWith(delta); // after — both delta and nextWorkset required DataSet<W> nextWorkset = stepResult.project(0); DataSet<S> result = iter.closeWith(delta, nextWorkset);
Defensive patterns
Strategy: validation
Validate before calling
// Ensure delta iteration has a next workset in closeWith
DeltaIteration<S,W> iter = solutionSet.iterateDelta(workset, 100, 0);
DataSet<S> delta = computeDelta(iter);
DataSet<W> nextWorkset = computeNextWorkset(iter);
if (nextWorkset == null) {
throw new IllegalStateException("Next workset for delta iteration is null");
}
DataSet<S> result = iter.closeWith(delta, nextWorkset); Prevention
- Use the two-argument closeWith(delta, nextWorkset) form, never the single-argument form for delta iterations.
- Verify nextWorkset is a non-null DataSet produced by the step body.
- Static analysis: grep for iterateDelta( followed by closeWith( with only one argument.
When it happens
Trigger: A delta iteration is created but closeWith() was not called with the second argument (nextWorkset), or closeWith() was not called at all. The solution set delta may be set (error 373 would not trigger) but the next workset is missing, indicating an incomplete closeWith() call.
Common situations: A developer calls closeWith(delta) (single-argument form) instead of closeWith(delta, nextWorkset) (two-argument form) for a delta iteration. The single-argument closeWith is valid for bulk iterations but insufficient for delta iterations which need both the delta and the next workset.
Related errors
- The iteration {} has no solution set delta defined (is not c
- The iteration {} has no next partial solution defined (is no
- The delta iteration {} has no initial solution set.
- The delta iteration {} has no initial workset.
- The iteration {} has no input (initial partial solution).
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/037eb728dfe33223.
Report an issue: GitHub.