Hi everyone :wave: I’m running into an issue with ...
# replication-troubleshooting
t
Hi everyone 👋 I’m running into an issue with the MongoDB source connector.
Airbyte version: 0.50.34
MongoDB connector version: v2.0.2
At first, everything works fine. But, after 3 days, the sync always fails:
Copy code
Failure reason: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future. See https://docs.airbyte.com/integrations/sources/mongodb-v2#mongodb-oplog-and-change-streams for more details
I already tried increasing the sync frequency, but the issues still happens. If anyone has experienced a similar situation?
k
You're not alone—this "Saved offset is not valid" error is a recurring issue reported by many Airbyte users with the MongoDB source connector, even when oplog retention and sync frequency seem sufficient. Key points from similar cases: - Oplog Retention & Sync Frequency: While the error message suggests increasing oplog retention or sync frequency, several users have reported the issue persists even with frequent syncs (as low as every 6 minutes) and oplog windows of several days (e.g., 3–7 days) [[source](https://github.com/airbytehq/airbyte/issues/46569), [source](https://github.com/airbytehq/airbyte/issues/48496)]. - Connector Version: The problem has been observed across multiple connector versions, including v1.x and v2.x, and across different Airbyte versions. - State/Resume Token Issues: Some users have found that the connector's internal state (resume token) can get "stuck" or out of sync, especially after a few days. Manually updating the resume token in the connection state has been used as a workaround, but this is not a sustainable solution [[source](https://github.com/airbytehq/airbyte/issues/62833)]. - Oplog Permissions: In some cases, the Airbyte MongoDB user lacked sufficient permissions to read oplog stats, causing the connector to fall back to defaults and leading to errors. Granting the user
read@local
permission resolved the issue for some users [[source](https://github.com/airbytehq/airbyte/issues/48496)]. - Connector Bugs: There are open issues and ongoing investigations by the Airbyte team, with some test/dev connector images released to address oplog and state management bugs, but no definitive fix has been confirmed yet [[source](https://github.com/airbytehq/airbyte/issues/48496), [source](https://github.com/airbytehq/airbyte/issues/62833)]. What you can try: 1. Check MongoDB User Permissions: Ensure your Airbyte MongoDB user has
read@local
permission so the connector can accurately read oplog stats. 2. Reset the Connection: As a temporary workaround, resetting the connection (full refresh) can get things working again, but the issue may recur after a few days. 3. Monitor State/Resume Token: If you are comfortable, inspect the Airbyte connection state and see if the resume token is updating as expected. Some users have manually updated stale tokens as a workaround. 4. Upgrade Connector & Airbyte: If possible, upgrade to the latest Airbyte and MongoDB connector versions, as fixes and improvements are ongoing. 5. Follow Open Issues: Track these GitHub issues for updates and potential fixes: - [Incremental sync error on specific collection - Saved offset is not valid](https://github.com/airbytehq/airbyte/issues/48496) - [Failed syncs due to [config_error] Saved offset is not valid](https://github.com/airbytehq/airbyte/issues/62833) - [Incremental syncs giving errors - Saved offset is not valid](https://github.com/airbytehq/airbyte/issues/46569) Summary: This is a known, unresolved issue with the MongoDB source connector in Airbyte. While increasing oplog retention and sync frequency are recommended, they do not always resolve the problem. Ensuring proper permissions and keeping your connector up to date may help, but a permanent fix is still pending from the Airbyte team. If you haven't already, consider commenting on the linked GitHub issues with your details to help the team prioritize a solution. For more details, see the [MongoDB source troubleshooting docs](https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting#connector-limitations) and the linked GitHub issues.