im getting the following from clickhouse destinati...
# ask-ai
a
im getting the following from clickhouse destination Sync completed, but unflushed states were detected
k
The message "Sync completed, but unflushed states were detected" for the ClickHouse destination typically indicates that while the sync process finished, some state messages (which track progress for incremental syncs and checkpointing) were not properly flushed or committed by the destination. From the logs and issues you provided, there are several related symptoms with the ClickHouse destination: - The sync completes successfully, but no tables are created in the main database—only internal tables are present. - The logs show that the process skips the final commit of tables and type-and-dedupe steps, e.g.,
Skipping commitFinalTables final
and
Skipping TypeAndDedupe final
([source](https://github.com/airbytehq/airbyte/issues/36199)). - The sync summary reports records emitted and committed, but
destinationStateMessagesEmitted
is 0, which means the destination did not emit any state messages back to Airbyte ([source](https://github.com/airbytehq/airbyte/issues/36199)). In Airbyte, state messages are crucial for incremental syncs and for ensuring that data is not re-synced unnecessarily. The destination is responsible for emitting state messages only after it has successfully committed the data associated with that state. If these are not emitted (i.e., "unflushed"), Airbyte cannot be sure that the data was safely written, and future syncs may reprocess the same data or fail to resume correctly ([State & the Whole Sync](https://docs.airbyte.com/platform/understanding-airbyte/airbyte-protocol#state--the-whole-sync)). Possible causes based on the knowledge sources: - The ClickHouse destination may be skipping the final commit and deduplication steps, which prevents it from emitting the final state messages. - There may be a misconfiguration or a bug in the destination connector that causes it not to flush or emit state messages as expected. What you can do: - Check if you are using the latest version of the ClickHouse destination connector, as this issue has been reported and discussed in the Airbyte community ([source](https://github.com/airbytehq/airbyte/issues/36199)). - Review your sync mode and destination configuration to ensure it matches the expected setup for incremental syncs and state management. - If the issue persists, consider following or commenting on the open GitHub issue for updates or workarounds. If you need more specific troubleshooting steps, please provide additional logs or configuration details.