<@U04S8PLJWMT> I'm getting the following error for...
# ask-ai
p
@kapa.ai I'm getting the following error for second sync of a connection that is set mysql as source and snowflake as destination.
Copy code
[config_error] MySQL Connector Error: The sync encountered an unexpected error in the change event producer and has stopped. Please check the logs for details and troubleshoot accordingly.
https://docs.oracle.com/javase/9/docs/api/java/lang/RuntimeException.html
the connection set to sync from CDC. initial sync completes in 12 hours with 375 GB loaded. Binlogs are available for 16 hours. After initial sync completed second sync ran and in 1 hour it gets failed with 1 hour. In source connection, I have set
initial loadout time
to 16 hours and
concurrency
to 2 as well. What could be the issue here?
k
Based on the information in your question and the provided knowledge sources, there are several possible causes for the error you’re encountering during the second (incremental) sync from MySQL (CDC) to Snowflake: ### 1. Binlog Position/Schema Mismatch A common issue after a large initial sync is that the binlog position or schema information stored by Airbyte becomes out of sync with the actual state of the MySQL binlogs. This can happen if: - The binlogs required for incremental sync are no longer available (expired or purged). - There was a schema change in the source table between the initial and incremental syncs. - The connector is reading from a binlog position that is no longer valid, or the table structure has changed, causing deserialization errors. This is supported by errors like: > Error processing before of row in clientes because it's different column size with internal schema size 65, but before size 1, restart connector with schema recovery mode. and > Error during binlog processing. Last offset stored = {file=..., pos=...}, binlog reader near position = ... > Producer failure io.debezium.DebeziumException: Error processing binlog event [MySQL CDC Issue - Debezium error - Can't incremental sync after the first full load](https://github.com/airbytehq/airbyte/issues/51607) ### 2. Binlog Retention Not Sufficient Even though you have binlogs available for 16 hours, if the initial sync takes 12 hours and the incremental sync starts after that, there is a risk that the binlog position required for the incremental sync is no longer present, especially if there is high write activity on the database. Airbyte requires the binlog position from the end of the initial sync to be present for the next incremental sync to work. If the binlog is purged before the incremental sync starts, Airbyte cannot continue and will fail. > The root causes is that the binlogs needed for the incremental sync have been removed by MySQL. > Possible solutions include: > - Sync the data source more frequently. > - Set a higher
binlog_expire_logs_seconds
(recommended: 7 days). [MySQL Source Troubleshooting](https://docs.airbyte.com/integrations/sources/mysql/mysql-troubleshooting#troubleshooting) ### 3. Schema Changes or Table Map Issues If there are schema changes (columns added/removed) between the initial and incremental syncs, or if the connector starts reading the binlog in the middle of a logical event group, you may see errors like: > No TableMapEventData has been found for table id:... Usually that means that you have started reading binary log 'within the logical event group' (e.g. from WRITE_ROWS and not proceeding TABLE_MAP) [MySQL CDC Issue - Debezium error](https://github.com/airbytehq/airbyte/issues/51607) ### 4. Large Table/Resource Constraints Large initial syncs (375 GB) can stress the system and may cause timeouts or resource exhaustion, especially if the sync containers run out of memory or disk, or if the MySQL server closes idle connections due to timeout settings. ### Recommendations - Increase Binlog Retention: Set your MySQL binlog retention to at least several days (e.g., 3-7 days) to ensure the required binlog positions are available for incremental syncs, especially after large initial loads. - Check for Schema Changes: Ensure no schema changes occur between the initial and incremental syncs. - Review Logs: Look for specific errors in the Airbyte logs related to binlog position, schema mismatch, or deserialization errors for more targeted troubleshooting. - Sync More Frequently: Reduce the interval between syncs to minimize the risk of binlog expiration. - Resource Allocation: Ensure your Airbyte and database servers have sufficient resources (memory, disk, network) to handle large syncs. If the problem persists, please provide the specific error message from the Airbyte logs after the second sync fails for more targeted assistance. References integrated above.