The error message: > Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent this from happening in the future. is a common issue when using Airbyte's MongoDB source connector. This error typically occurs when the resume token (offset) saved from a previous sync is no longer available in the MongoDB oplog. This can happen if: - The oplog retention period is too short, and the resume token has been purged from the oplog before the next sync. - There is insufficient data movement, so the oplog position (LSN) does not advance, and the token becomes stale. - The sync frequency is too low relative to the oplog retention period.
Recommended actions: 1.
Increase Oplog Retention/Size: Ensure your MongoDB oplog is large enough to retain changes for a longer period (ideally at least 24 hours, but a week is recommended for reliability). See [MongoDB Oplog and Change Streams](
https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting#connector-limitations) for more details. 2.
Increase Sync Frequency: Run syncs more frequently so that the saved offset is always within the current oplog window. 3.
Ensure Data Movement: If there are long periods without changes in your collections, the resume token may not advance, increasing the risk of this error. Try to ensure there is at least some data movement between syncs. 4.
Reset the Connection: If you encounter this error, you will need to reset the Airbyte connection to perform a full refresh, as the previous incremental position is no longer valid. This issue is well-documented and has been reported by multiple users, even with sufficient oplog size and frequent syncs. In some cases, bugs in earlier connector versions caused state management issues, but the fundamental cause is almost always related to oplog retention and sync frequency. If you are using a recent connector version and still encounter this, double-check your oplog window and sync schedule, and consider upgrading to the latest connector version if you haven't already, as some bugs have been fixed in newer releases [source-mongodb-v2 issue](
https://github.com/airbytehq/airbyte/issues/62833), [troubleshooting docs](
https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting#connector-limitations). For more details and troubleshooting steps, refer to the official documentation: [MongoDB Oplog and Change Streams](
https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting#connector-limitations).