Error: Unable To Access Change Streams / Oplog
Issue
The connection fails. The following error appears:
Unable to access Change streams / Oplog. Setup test failed with "com.fivetran.integrations.mongo.exceptions.MongoConnectionException: Invalid port [mongodb://:27017/]. Detailed error: java.net.ConnectException: Connection refused"
Environment
- Connector: MongoDB
- Connection method: SSH tunnel
Resolution
To resolve this issue, do the following:
- Identify the internal network address of the MongoDB server that the SSH tunnel host can access.
- In Fivetran, go to your MongoDB connection page.
- Select the Setup tab.
- Click Edit connection.
- In the Host and ports field, enter the internal address from step 1.
- Click Save & Test.
Cause
This issue occurs when we can't connect to the MongoDB instance on port 27017
. It typically happens when the Host and ports value is set to the SSH tunnel host’s IP address, even though MongoDB is running on a separate node. The field must point to the MongoDB server’s address as reachable from the SSH tunnel host.