{"record":{"id":"c650cbf5d06020a4","repo":"apache/iceberg","slug":"failed-to-load-iceberg-table-from-table-loader-c650cb","errorCode":null,"errorMessage":"Failed to load iceberg table from table loader: ","messagePattern":"Failed to load iceberg table from table loader: ","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java","lineNumber":444,"sourceCode":"    }\n\n    private DataStreamSink<Void> chainIcebergOperators() {\n      Preconditions.checkArgument(\n          inputCreator != null,\n          \"Please use forRowData() or forMapperOutputType() to initialize the input DataStream.\");\n      Preconditions.checkNotNull(tableLoader, \"Table loader shouldn't be null\");\n\n      DataStream<RowData> rowDataInput = inputCreator.apply(uidPrefix);\n\n      if (table == null) {\n        if (!tableLoader.isOpen()) {\n          tableLoader.open();\n        }\n\n        try (TableLoader loader = tableLoader) {\n          this.table = loader.loadTable();\n        } catch (IOException e) {\n          throw new UncheckedIOException(\n              \"Failed to load iceberg table from table loader: \" + tableLoader, e);\n        }\n      }\n\n      flinkWriteConf = new FlinkWriteConf(table, writeOptions, readableConfig);\n\n      // Find out the equality field id list based on the user-provided equality field column names.\n      Set<Integer> equalityFieldIds =\n          SinkUtil.checkAndGetEqualityFieldIds(table, equalityFieldColumns);\n\n      RowType flinkRowType =\n          resolvedSchema != null\n              ? toFlinkRowType(table.schema(), resolvedSchema)\n              : toFlinkRowType(table.schema(), tableSchema);\n      int writerParallelism =\n          flinkWriteConf.writeParallelism() == null\n              ? rowDataInput.getParallelism()\n              : flinkWriteConf.writeParallelism();","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java#L426-L462","documentation":"FlinkSink's operator chain loads the Iceberg Table via the provided TableLoader during operator initialization (open/setup). If loadTable() throws an IOException — e.g. the table metadata file is missing, unreadable, or the underlying filesystem/object store is unreachable — it is wrapped in this UncheckedIOException naming the TableLoader.","triggerScenarios":"TableLoader.open()/loadTable() raising IOException because the metadata JSON or manifest files can't be read: wrong warehouse/Hadoop conf in the cluster, deleted or renamed table, expired cloud credentials, or a catalog that points to nonexistent metadata.","commonSituations":"Submitting the Flink job from a machine with valid conf but the TaskManagers lack Hadoop/AWS configuration; the table was dropped/rewritten while the job was being built; version-hive/.hadoop catalog misconfiguration; S3 credentials expiring at task startup.","solutions":["Verify the catalog and TableLoader configuration (warehouse path, Hadoop conf, credentials) is available on all TaskManagers, not just the client.","Confirm the table exists and its metadata location is valid via the catalog (SHOW/inspect metadata pointer).","Check filesystem/object-store reachability and credential validity from the cluster.","Recreate the sink after the table has been recreated/renamed so the loader points to live metadata."],"exampleFix":"// before\nTableLoader loader = TableLoader.fromHadoopTable(\"hdfs://nn/warehouse/db/table\"); // cluster cannot resolve nn\n// after\nTableLoader loader = TableLoader.fromCatalog(CatalogLoader.hive(\"hive_catalog\", hiveConf, uri, db, table));","handlingStrategy":"try-catch","validationCode":"try (TableLoader loader = tableLoader) {\n  loader.open();\n  Table t = loader.loadTable(); // fail fast on client before submitting job\n}","typeGuard":null,"tryCatchPattern":"try { loader.loadTable(); } catch (IOException e) {\n  throw new UncheckedIOException(\"Pre-flight table load failed for \" + loader, e);\n}","preventionTips":["Perform a pre-flight loadTable() in job-submission code to fail early with a clear error.","Distribute Hadoop/AWS config files (core-site.xml, hive-site.xml, credentials) to the cluster.","Monitor the metadata pointer of the table to catch dropped/renamed tables before job startup."],"tags":["flink","iceberg","table-loader","io","sink"],"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"}