All posts

Apache XTable troubleshooting: errors, causes and fixes

A playbook built from the release source and from failures reproduced in runs: how to find the failing layer, then every error message by area with its cause and fix, including the ones that give no error at all, such as a zero-row Paimon sync and a failed sync that exits 0.

12 min read Lakehouse

TL;DR

Find the failing layer before you read a stack trace: source, the sync, target metadata, files, catalog, engine. Most reports of wrong data are a lagging target or a deleted file, and most reports of a missing table are catalog registration.

  • Three failures give no error. A Paimon primary-key table syncs with success and zero rows, a failed RunSync exits 0, and the Hive classpath silences XTable’s logging.
  • Every message below is from the 0.5.0-incubating source. Each is marked as reproduced in a run or read from the code.
  • Two of the errors suggest a fix that does not work from the CLI. Messages that say “run a full sync” refer to a sync mode that RunSync and the Spark runtime never request.
  • The Delta Kernel target, which the Spark runtime picks on newer Spark, cannot evolve a schema or write generated columns. That one explains a lot of Delta failures.

This is the page to keep open when a sync misbehaves. It is organised by where the problem shows up, and each entry gives the message, the cause and the fix. [run] means the failure was reproduced in this series. [source] means the message and its condition were read from the code and not triggered.

Six layers to check in order: the source table in its own engine, the sync's failure signal, the target metadata and its XTABLE_METADATA entry, the files the target lists, the catalog registration, and the engine's support for the format

Method

  1. Does the source work in its own engine? If Hudi, Iceberg or Delta cannot read it, XTable cannot either.
  2. Which signal does your entry point give? RunSync and RunCatalogSync exit 0 on failure, so read the log for Sync failed for the following formats and Error running sync. XTableSparkSync exits 1. The service API returns a map. The production post has the table.
  3. Is the target current? Read XTABLE_METADATA from the target’s table properties. lastInstantSynced against the source’s latest commit is the lag.
  4. Do the files exist? A target that lists a deleted file fails with FileNotFoundException or NotFoundException.
  5. Is the table registered, at the right location? Query by name in the engine.
  6. Does the engine support this format version? Iceberg 1.11 or later needs Java 17, and a version 9 Hudi target needs Hudi 1.1.0 or later.

Run RunSync with its log visible. When Hive jars are on the classpath, XTable’s log4j2 configuration can fail to start and print almost nothing, so keep a run without them for diagnosis.

Six common symptoms mapped to the layer that usually owns them

Installation and dependencies

Message Cause Fix
NoClassDefFoundError: org/apache/hudi/client/common/HoodieJavaEngineContext [run] A Hudi target in the Spark runtime, with no Hudi Java client Add hudi-java-client 1.2.1 or set xtable.hudi.target.execution.engine: spark. It is an Error, so it skips per-target handling
NoClassDefFoundError: org/apache/hudi/client/common/HoodieSparkEngineContext [run] Building the secondary index with java -jar Use XTableSparkSync, or add the Hudi Spark 3.4 bundle to a -cp run
NoClassDefFoundError: io/delta/kernel/engine/Engine [run] Delta Kernel jars missing from the Spark classpath Add delta-kernel-api and delta-kernel-defaults 4.0.0
NoSuchMethodError on a Hudi source with the 0.4.0 Spark runtime jar That jar does not work with Hudi 0.15 or later Use the 0.5.0 jar and the Hudi 1.2.x bundle
NoSuchMethodError: DeltaLog.ensureLogDirectoryExist() [run] A delta-spark 3.3.2 session met the older Delta writer Set useDeltaKernel(true) or --usedeltakernel
NoClassDefFoundError: org/apache/hadoop/hive/metastore/api/NoSuchObjectException [run] Hive classes are not bundled in this release Add the Hive jars, as in the catalog post
Target format is not yet supported: <format> [source] ServiceLoader found no ConversionTarget for it, often because its engine library is missing, which the loader only logs as a warning Put the engine library on the classpath
Unable to load class: <name> [source] A provider class in the converters config is not on the classpath or misspelt Fix the class name or add the jar
UnsupportedClassVersionError ... class file version 61.0 [run] Iceberg 1.11 or later on Java 11 Run the reader on Java 17

Source and configuration

Message Cause Fix
Source format PARQUET is not supported. Known source and target formats are [...] [run] Parquet is not in the defaults file Pass --convertersConfig naming ParquetConversionSourceProvider, or use the Spark runtime
NoSuchTableException: Table does not exist at location [run] tableBasePath is not an Iceberg table directory Point at the directory that holds metadata/
NoSuchFileException on --datasetConfig [run] The config file cannot be read The only failure that made RunSync exit non-zero
Please provide at-least one format to sync [source] targetFormats is empty List at least one
--basepath is required unless --datasetconfig is provided [run] Missing option in the Spark CLI Pass the option. The CLI lists each rule, for example that --datasetconfig excludes --basepath
Unsupported source format for spark-runtime sync: <format> [source] An unknown source in XTableSyncService Use one of the five
Hudi partition values read data/city_id=nyc [run] tableDataPath not set for an Iceberg table whose files sit under data/ Add tableDataPath
Data file <path> is outside the Hudi table base path ... The Hudi target needs every data file under its base path. [source] An Iceberg or Delta source whose files are outside the Hudi target’s base path, which is the data path Set tableDataPath to a directory that contains all the files, or drop the Hudi target
Invalid path: <path> [source] A malformed path in a config Fix the URI

Schema and partitions

Message Cause Fix
Unsupported type: <name> [source] from the Delta, Iceberg, Spark or catalog extractors A column type outside the 19 in the model Change or drop the column in the source
Unsupported Paimon type: <type> [source] The same, for Paimon Same
Invalid decimal type, precision and scale is missing [source] from the HMS and Glue extractors A decimal with no precision or scale reaching a catalog Fix the source schema
Bucket partition is not yet supported by Hudi targets [run] A bucket(...) partition and a Hudi target Drop the Hudi target for that table. Delta and Iceberg accepted it
Partition spec cannot be changed after creating Hudi table and Record key fields cannot be changed after creating Hudi table [source] The source’s partitioning or key changed under an existing Hudi target Recreate the Hudi target
Unsupported expression for generated expression and Unsupported date format expression [source] A Delta source with generated columns XTable cannot parse back into transforms Simplify the expression or partition on a plain column
Partition transform not supported: <name> [source] An Iceberg partition transform outside the six, for example truncate Use a supported transform
Schema evolution on an existing Delta table is not supported by DeltaKernelConversionTarget [run] A column was added in the source and the Delta target uses Kernel, which is the Spark runtime’s default on newer Spark Set xtable.delta.target.use_kernel=false, or sync that table with RunSync
Unsupported Delta writer feature: ... requires writer table feature "[generatedColumns]" [run] A day, month, year, hour or bucket partition with the Kernel target Use RunSync’s default Delta target
Cannot add or remove fields in map key struct for Iceberg tables [source] Schema evolution inside a map key Avoid struct map keys

Per-source problems

Hudi. A Merge-on-Read table converts as its read-optimized view, because the extractor filters log files, so rows appear stale until a compaction [run]. The message Unexpected commit type <action> [source] means the timeline holds an action the source does not know. Replaced file group <id> ... has no base file in the file system view [source] points at a replace commit whose files were cleaned.

Delta. A deletion vector is paired with a remove and dropped, so deleted rows stay visible in targets [source]. Missing metadata/schema for table [source] means the log has no readable schema at that version.

Paimon. A primary-key table with everything at level 0 syncs with success and zero rows [run]. Compact it, then sync again. No snapshots found for table [source] means the table is empty or the path is wrong.

Parquet. Parquet incremental sync does not support target formats synced to different instants. Run a full sync to realign the target tables. [source] means one target is behind another. There is no CLI flag for a full sync, so realign by removing the lagging target’s metadata on a copy first.

Incremental sync

Log message Meaning
No previous InternalTable sync for target. Falling back to snapshot sync. [run] The target has no XTABLE_METADATA. Normal on a first run
Incremental sync is not safe from instant ... Falling back to snapshot sync. [run] The source cannot resume from there, often after a clean or snapshot expiry
Incremental sync is not safe for target <format>. Falling back to snapshot sync. [source] The target itself asked for a snapshot. A Hudi target made by 0.4.0 does so once, for its column statistics
Hudi target table at <path> registered files that have a partition subdirectory as separate partitions, and an incremental sync cannot update this layout. Run one sync with syncMode FULL, and incremental sync then resumes. [source] A layout the Hudi target cannot extend incrementally. RunSync and the Spark runtime always request incremental, so the advice needs the library API or a target rebuild

A run with nothing new prints no success line and the API returns an empty map. That is not a failure [run].

Target metadata and files

Symptom Cause Fix
NotFoundException: File does not exist reading a converted table [run] The source cleaner deleted files the target still lists Sync again, and keep the interval under the cleaner window. The next sync falls back to a snapshot
Iceberg register_table deleted the metadata file it was given [run] A failed Hive commit in Iceberg 1.9.2 Copy v<N>.metadata.json before registering, and re-sync if it vanishes
Target is older than the source [run] Merge-on-Read log files not compacted, or the sync did not run Compare XTABLE_METADATA with the source’s latest commit
Unable to clean Hudi timeline or Unable to archive Hudi timeline [source] The Hudi target’s own housekeeping failed Check storage permissions on .hoodie/
Failed to deserialize TableSyncMetadata or Unable handle metadata version [source] An unreadable XTABLE_METADATA entry, or one written by a newer version Match the XTable version, or rebuild the target

CatalogSync

Message Cause Fix
MetaException: file:/... is not a directory or unable to create one [run] The table’s location is a local path the metastore cannot reach Use s3a:// or another shared path
UnknownHostException inside Unable to instantiate SessionHiveMetaStoreClient [run] The serverUrl host does not resolve Fix the URL. The run still exits 0
catalogType is not yet supported: <type> [source] A type other than STORAGE, GLUE or HMS Use one of them
Failed to create table: <name> or Failed to refresh table [source] The catalog client call failed Read the cause in the log and check catalog permissions
StorageDescriptor location changed from ... to ..., re-creating table [source] The location differs from XTable’s base path Intended, but it replaces the table
Almost no log output [run] Hive jars on the classpath broke the log4j2 setup Check the catalog itself, or diagnose without those jars

Spark runtime and the index

Message Cause Fix
N of M table sync(s) failed; see logs above [run] At least one target failed The line above lists each failed target with its reason
WARN Not using the index ...: it is synced to snapshot X, but the table is at Y [run] The index is behind the table Run the sync
IndexedColumnRenamedException [run] The indexed column’s name now belongs to another field Rebuild the index after the next commit, or set spark.xtable.index.pruning.enabled=false
<property> requires Hudi target table version 9 or requires the Spark execution engine [source] Index settings without version 9 or the Spark engine Set both
The secondary index of column <c> of table <t> is not built [source] A query path found no index Run the sync that builds it
... Changing the secondary index column of an existing table is not supported yet. [source] The indexed column was changed Rebuild the Hudi target

Three silent failures

The three failures that print no error, each with a cheap check: compare counts, grep the log, check the catalog

  • A zero-row Paimon sync. The log says success. Compare counts after the first sync of every Paimon primary-key table.
  • A failed RunSync or RunCatalogSync that exits 0. A wrong path, a rejected partition spec and an unreachable metastore all exited 0. Check the log, not the exit code.
  • An empty log. With Hive jars on the classpath XTable printed almost nothing. Verify in the catalog.

Recovery

These steps are guidance and the rebuild paths were not run:

  • Rebuild a target. Remove its metadata directory and sync again. With no XTABLE_METADATA the controller takes a snapshot pass. Try it on a copy first.
  • Re-register a table. Run RunCatalogSync again. It creates a missing table and refreshes an existing one.
  • Lost data files. Nothing in XTable restores them. Restore from the source’s backups, and then sync.

Checked against the source

The messages were extracted from every throw new in the main code of xtable-api, xtable-core, xtable-utilities, xtable-spark-runtime, xtable-spark-extensions, xtable-aws and xtable-hive-metastore, and the conditions were read in the classes that raise them. The ones tagged [run] were reproduced on Spark 3.5.9 in Docker, with a Hive Metastore and MinIO for the catalog cases.

Key takeaways

Start from the layer, not the stack trace. Know which signal your entry point gives, read XTABLE_METADATA to see whether the target is current, and treat the three silent failures as the first things to rule out. When a message tells you to run a full sync, remember that the tools you probably use never ask for one.

References

Trademarks

Apache XTable (incubating), Apache Hudi, Apache Iceberg, Apache Paimon, Apache Spark, Apache Hive and Apache are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries. Delta Lake is a trademark of the Linux Foundation. All other marks are the property of their respective owners.

Found this useful?

These posts and tools are free. If one saved you an afternoon, you can buy me a coffee.

Buy me a coffee

Comments

Questions, corrections and reviews are welcome. Sign in with GitHub to post; comments are stored in this site's public GitHub Discussions.