{"record":{"id":"5cb75fe4a1c6d462","repo":"apache/iceberg","slug":"failed-to-create-tablemaintenance-5cb75f","errorCode":null,"errorMessage":"Failed to create tableMaintenance ","messagePattern":"Failed to create tableMaintenance ","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java","lineNumber":305,"sourceCode":"      } else {\n        builder = TableMaintenance.forChangeStream(tableChangeStream, tableLoader);\n      }\n\n      builder\n          .uidSuffix(tableMaintenanceUid)\n          .add(maintenanceTasks)\n          .rateLimit(Duration.ofSeconds(flinkMaintenanceConfig.rateLimit()))\n          .lockCheckDelay(Duration.ofSeconds(flinkMaintenanceConfig.lockCheckDelay()))\n          .parallelism(flinkMaintenanceConfig.parallelism());\n\n      String slotSharingGroup = flinkMaintenanceConfig.slotSharingGroup();\n      if (slotSharingGroup != null) {\n        builder.slotSharingGroup(slotSharingGroup);\n      }\n\n      builder.append();\n    } catch (IOException e) {\n      throw new UncheckedIOException(\"Failed to create tableMaintenance \", e);\n    }\n  }\n\n  @Override\n  public DataStream<RowData> addPreWriteTopology(DataStream<RowData> inputDataStream) {\n    return distributeDataStream(inputDataStream);\n  }\n\n  @Override\n  public DataStream<CommittableMessage<IcebergCommittable>> addPreCommitTopology(\n      DataStream<CommittableMessage<WriteResult>> writeResults) {\n    TypeInformation<CommittableMessage<IcebergCommittable>> typeInformation =\n        CommittableMessageTypeInfo.of(this::getCommittableSerializer);\n\n    String suffix = defaultSuffix(uidSuffix, table.name());\n    String preCommitAggregatorUid = String.format(\"Sink pre-commit aggregator: %s\", suffix);\n\n    // global forces all output records send to subtask 0 of the downstream committer operator.","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java#L287-L323","documentation":"IcebergSink.addPostCommitTopology() attaches the table maintenance topology, which involves I/O (e.g. opening the table/loader while building maintenance operators). An IOException during that construction is wrapped in this UncheckedIOException, meaning maintenance topology setup failed — the write itself is not what failed.","triggerScenarios":"Calling IcebergSink.builder()...append() with table maintenance enabled while an IOException occurs building the maintenance sub-topology, e.g. TableLoader cannot open the table or the maintenance catalog resources can't be accessed.","commonSituations":"Maintenance enabled with a table whose metadata can't be loaded on the job manager; wrong catalog configuration for maintenance; permissions issues reading table metadata in the cluster environment.","solutions":["Verify the TableLoader/catalog configuration can load the table before enabling maintenance (test loader.loadTable() locally).","Check cluster-side access to the table's metadata location and required credentials.","Disable table maintenance if unneeded so the post-commit topology is skipped.","Fix the underlying IOException reported as the cause of this UncheckedIOException."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"try (TableLoader loader = cfg.tableLoader()) {\n  loader.open();\n  loader.loadTable(); // verify maintenance can load the table before enabling it\n}","typeGuard":null,"tryCatchPattern":"try { sink.append(); } catch (UncheckedIOException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Failed to create tableMaintenance\")) {\n    LOG.error(\"Maintenance topology setup failed; check table access for maintenance\", e);\n  }\n}","preventionTips":["Validate the TableLoader can load the table on the job cluster before enabling maintenance.","Ensure maintenance-related catalog configs and credentials are present cluster-wide.","Disable maintenance in environments where the table is read-only or inaccessible."],"tags":["flink","iceberg","maintenance","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"}