{"record":{"id":"c5464fe432844ba7","repo":"apache/iceberg","slug":"failed-to-process-tasks-iterable-c5464f","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.3/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.3/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSplitPlanner.java#L50-L86","documentation":"FlinkSplitPlanner.planInputSplits wraps IOException raised while planning legacy FlinkInputSplits (iterating the CombinedScanTask and computing block/host locations via Util.blockLocations) into an UncheckedIOException. It signals that reading table metadata or file locations failed during split planning for the old Flink SourceFunction-style source.","triggerScenarios":"Calling FlinkSplitPlanner.planInputSplits(table, context) when iterating scan tasks or resolving block locations (Util.blockLocations on table.io()) throws IOException — unreadable manifests, missing data files, or FileIO access errors.","commonSituations":"Storage credentials misconfigured for the FileIO; files deleted by concurrent snapshot expiry or compaction between scan and locality resolution; HDFS/S3 transient outages during job submission.","solutions":["Inspect the wrapped IOException cause to identify the unreadable file/location.","Fix FileIO credentials/configuration for the table's storage (Hadoop conf, S3 endpoint/keys).","Re-run planning against a stable snapshot (use a branch/tag or snapshot id) so files are not removed concurrently by maintenance jobs.","Retry submission if the failure was a transient storage/network outage."],"exampleFix":"// before (scan pinned to live HEAD, files expired mid-planning)\nScanContext ctx = ScanContext.builder().build();\n// after (pin a stable snapshot/branch)\nScanContext ctx = ScanContext.builder().useBranch(\"audit-branch\").build();","handlingStrategy":"validation","validationCode":"// preflight: load the table and confirm all manifest files are readable\nTable table = tableLoader.loadTable();\ntable.snapshots().forEach(s -> table.io().newInputFile(s.manifestListLocation()).getLength());","typeGuard":null,"tryCatchPattern":"try {\n  FlinkInputSplit[] splits = FlinkSplitPlanner.planInputSplits(table, context);\n} catch (UncheckedIOException e) {\n  LOG.error(\"split planning failed; check FileIO access and concurrent maintenance\", e.getCause());\n  throw e;\n}","preventionTips":["Run a preflight metadata-read check with the same FileIO config used by the job.","Pin scans to branches/tags or snapshot ids to avoid concurrent file deletion.","Retry transient object-storage failures with backoff before failing job submission."],"tags":["flink","splits","scan-planning","unchecked-io"],"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-23T08:17:48.524Z"}