<@U04S8PLJWMT> I ran into this problem while synci...
# ask-ai
h
@kapa.ai I ran into this problem while syncing MongoDB -> AWS RedShift
Copy code
io.airbyte.cdk.integrations.source.relationaldb.state.FailedRecordIteratorException: java.lang.RuntimeException: java.lang.RuntimeException: org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
k
The error message you encountered:
Copy code
io.airbyte.cdk.integrations.source.relationaldb.state.FailedRecordIteratorException: java.lang.RuntimeException: java.lang.RuntimeException: org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
is a generic error that can occur during Change Data Capture (CDC) syncs, often related to issues with the underlying data stream or state management. Based on the knowledge sources, here are some common causes and troubleshooting steps for similar errors when syncing MongoDB to Redshift: 1. Oplog Retention and Resume Token Issues If your syncs run less frequently than the MongoDB Oplog retention period, the connector may lose the ability to resume from the last offset, resulting in errors like "Saved offset is not valid" or "resume token was not found." This can cause the CDC process to fail and throw exceptions in the change event producer. - Solution: - Increase the Oplog retention period and/or size on your MongoDB cluster. - Increase the sync frequency in Airbyte to ensure the Oplog does not roll over before the next sync. - If the error persists, you may need to reset the Airbyte connection and perform a full re-sync to re-establish a valid offset. [See Connector Limitations and Troubleshooting](https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting#connector-limitations) [Related issue example](https://github.com/airbytehq/airbyte/issues/46569) 2. MongoDB Cluster and Deployment Requirements - Only replica set clusters are supported. - TLS/SSL is required. - Some MongoDB deployments (e.g., AWS DocumentDB) have additional limitations, such as lack of support for custom SSL certificates. - Collections with inconsistent
_id
types or unsupported features (views, capped collections) can also cause sync failures. [Connector Limitations](https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting#connector-limitations) 3. Connection Pool or Cursor Issues Errors like
MongoCursorNotFoundException
or
MongoConnectionPoolClearedException
can also cause syncs to fail, especially during large or long-running syncs. These may be related to network interruptions, timeouts, or resource limits on the MongoDB server. [Example issue](https://github.com/airbytehq/airbyte/issues/45103) [Another example](https://github.com/airbytehq/airbyte/issues/44378) Recommended Actions: - Check your MongoDB Oplog size and retention settings, and adjust as needed. - Ensure your Airbyte sync frequency is high enough to avoid Oplog roll-over. - Review your MongoDB cluster configuration to ensure it meets Airbyte's requirements. - If the error persists, try resetting the Airbyte connection and performing a full refresh. If you continue to encounter this error after following these steps, please provide more detailed logs or context for further troubleshooting.
h
@kapa.ai what are the airbyte requirements for MongoDB? How can I full refresh the connection?
k
A message from kapa.ai
### Airbyte Requirements for MongoDB According to the knowledge sources, the main requirements for using MongoDB as a source in Airbyte are: - Cluster Type: Only [replica set](https://www.mongodb.com/docs/manual/replication/) clusters are supported. Standalone MongoDB instances are not supported. - TLS/SSL: TLS/SSL is required by the connector. For self-hosted MongoDB, you must enable TLS/SSL. For MongoDB Atlas, TLS/SSL is enabled by default. - User Permissions: You need a dedicated read-only MongoDB user with the appropriate privileges. For MongoDB Atlas, the user should have the
readAnyDatabase
privilege if you want to sync multiple databases. For self-hosted, the user should have the
read
role on the target database. - Oplog: The connector relies on the MongoDB Oplog for CDC (Change Data Capture). You should ensure your Oplog is sized to retain at least 24 hours of changes, and ideally up to a week, to avoid sync issues. - Supported Deployments: Only replica set clusters are supported. Views, capped collections, and clustered collections are not supported. Collections with inconsistent
_id
types are also not supported. Atlas clusters must be M10 tier or above. - SSL Certificates: Airbyte does not support self-signed SSL certificates for SSH tunnels, and does not support custom SSL certificates required by AWS DocumentDB. For more details, see the [Connector Limitations](https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting#connector-limitations) and [Quick Start](https://docs.airbyte.com/integrations/sources/mongodb-v2#quick-start) sections. --- ### How to Perform a Full Refresh in Airbyte To perform a full refresh of your MongoDB connection in Airbyte: 1. Go to your Airbyte UI. 2. Select the connection you want to refresh. 3. Trigger a Refresh Sync (sometimes called "Full Refresh" or "Refresh and Remove Records/Retain Records" depending on your sync mode). A Refresh Sync erases the current cursor for incremental streams, effectively rewinding the sync back to the beginning and re-importing all records from the source. This can be done from the UI or via the Airbyte API. Note that a full refresh will re-import all data, which may be slower and more resource-intensive than incremental syncs. During the refresh, previously available data in your destination remains available until the new data is swapped in at the end of the sync. For more information, see the [Refreshing your data](https://docs.airbyte.com/platform/operator-guides/refreshes) documentation. Note: If you are using the MongoDB V2 connector, full refresh mode is supported and can be selected as the replication method for your streams. This is useful if you need to re-import all data or recover from sync issues. [Replication Methods](https://docs.airbyte.com/integrations/sources/mongodb-v2#replication-methods)
h
@kapa.ai what is the difference between a sync and a refresh?
k
A message from kapa.ai
The difference between a sync and a refresh in Airbyte is as follows: - Sync: A sync is the standard process where Airbyte transfers data from the source to the destination according to the configured sync mode (e.g., incremental, full refresh, append, overwrite). In a regular sync, Airbyte only processes new or changed data based on the last known state (for incremental syncs), or all data (for full refresh syncs) as per the selected mode. Syncs are typically scheduled or triggered manually to keep the destination up to date with the source. - Refresh: A refresh (or "Refresh Sync") is a special operation that erases the current cursor for any incremental streams, effectively "rewinding" the sync back to the beginning. This means Airbyte will re-import all records from the source, regardless of what has already been synced. Refreshes are useful if you want to mirror deletions from the source, recover from errors, or re-attempt a sync from scratch. During a refresh, the previous data in your destination remains available until the new data is fully synced and swapped in, minimizing downtime. Refreshes can be triggered from the UI or API and may be more resource-intensive than regular syncs because they re-import all data [Refreshing your data](https://docs.airbyte.com/platform/next/operator-guides/refreshes). In summary: - Sync = routine data transfer based on the last state and sync mode. - Refresh = a special, full re-import that resets the sync state and reprocesses all data from the source.