{"record":{"id":"ec5243636b585cb6","repo":"apache/iceberg","slug":"failed-to-process-tasks-iterable-ec5243","errorCode":null,"errorMessage":"Failed to process tasks iterable","messagePattern":"Failed to process tasks iterable","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSplitPlanner.java","lineNumber":68,"sourceCode":"      List<CombinedScanTask> tasks = Lists.newArrayList(tasksIterable);\n      FlinkInputSplit[] splits = new FlinkInputSplit[tasks.size()];\n      boolean exposeLocality = context.exposeLocality();\n\n      Tasks.range(tasks.size())\n          .stopOnFailure()\n          .executeWith(exposeLocality ? workerPool : null)\n          .run(\n              index -> {\n                CombinedScanTask task = tasks.get(index);\n                String[] hostnames = null;\n                if (exposeLocality) {\n                  hostnames = Util.blockLocations(table.io(), task);\n                }\n                splits[index] = new FlinkInputSplit(index, task, hostnames);\n              });\n      return splits;\n    } catch (IOException e) {\n      throw new UncheckedIOException(\"Failed to process tasks iterable\", e);\n    }\n  }\n\n  /** This returns splits for the FLIP-27 source */\n  public static List<IcebergSourceSplit> planIcebergSourceSplits(\n      Table table, ScanContext context, ExecutorService workerPool) {\n    try (CloseableIterable<CombinedScanTask> tasksIterable =\n        planTasks(table, context, workerPool)) {\n      return Lists.newArrayList(\n          CloseableIterable.transform(tasksIterable, IcebergSourceSplit::fromCombinedScanTask));\n    } catch (IOException e) {\n      throw new UncheckedIOException(\"Failed to process task iterable: \", e);\n    }\n  }\n\n  static CloseableIterable<CombinedScanTask> planTasks(\n      Table table, ScanContext context, ExecutorService workerPool) {\n    ScanMode scanMode = checkScanMode(context);","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSplitPlanner.java#L50-L86","documentation":"FlinkSplitPlanner.planInputSplits (the legacy Flink source path) iterates a CloseableIterable of CombinedScanTasks to build FlinkInputSplits; IOExceptions during task iteration (which lazily perform file IO) are wrapped into an UncheckedIOException 'Failed to process tasks iterable'.","triggerScenarios":"Calling FlinkSplitPlanner.planInputSplits(table, context, workerPool) when the lazy task iterable throws while being consumed — e.g. manifest listing/IO failure, table files deleted between planning and materialization, or block location lookup failures via Util.blockLocations.","commonSituations":"Files removed by concurrent compaction/expiry while the source plans splits; storage outages during manifest reading; misconfigured FileIO; permission errors on metadata files.","solutions":["Check the wrapped IOException cause for the specific storage/IO failure","Avoid expiring/rewriting data files between job planning and execution","Verify table metadata and manifest files are readable with the configured FileIO credentials","Retry split planning once storage is reachable again"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"Table table = loader.loadTable();\ntable.refresh();\ntable.scan().planTasks(); // surfaces IO issues before split planning","typeGuard":null,"tryCatchPattern":"try {\n  FlinkInputSplit[] splits = FlinkSplitPlanner.planInputSplits(table, context, pool);\n} catch (UncheckedIOException e) {\n  // transient storage failure: retry with backoff\n  retryWithBackoff(() -> FlinkSplitPlanner.planInputSplits(table, context, pool));\n}","preventionTips":["Avoid running expire_snapshots during scan planning windows","Ensure FileIO credentials and endpoints are valid before job start","Refresh the table before planning to pick up the latest snapshot"],"tags":["io","scan-planning","flink"],"backgroundTag":"file-read-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}