My team is now building data integration pipelines in Google Cloud Data Fusion. The pipelines read data from Mongo Atlas collections and push into BigQuery. We've faced a problem with one of our Mongo Atlas clusters and would like to consult with you.
Here is a description of how it works:
1. We have a Google Cloud Fusion private instance with VPC
2. The Google VPC is configured with peered connection to Mongo Atlas VPC
3. The Google VPC's IP range is added to Mongo Atlas Network Access
4. If we create a VM in the same Google VPC then it is able to connect to Mongo and read data.
5. We have a pipeline in the Google Cloud Fusion instance using MongoDB plugin v2.0.1 to access Mongo Atlas
In MongoDB plugin settings we do specify:
Host: shard-name
Port: 27017
Database: DB
Collection: collection name
Username: user
Password: password
Connection Arguments: tls=true, authSource=admin
com.mongodb.MongoCommandException: Command failed with error 13 (Unauthorized): 'Command buildInfo requires authentication' on server ххххххххх:27017. The full response is {"ok": 0.0, "errmsg": "Command buildInfo requires authentication", "code": 13, "codeName": "Unauthorized", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1750240037, "i": 1}}, "signature": {"hash": {"$binary": "Kbv90onBLw0Jm4OlA3LTkZLcNHU=", "$type": "00"}, "keyId": {"$numberLong": "7456539992995659777"}}}, "operationTime": {"$timestamp": {"t": 1750240037, "i": 1}}}
The Mongo Atlas user has readAnyDatabase@admin role.
Interesting is that we have quite the same setup for another Mongo Atlas project and cluster and the Google Cloud Fusion pipeline works without any issues.
What could be the reason for this problem? Some configuration on the VPC / Data Fusion instance side or on the Mongo Atlas side?
Hi @kpetrosov,
Welcome to Google Cloud Community!
The error “com.mongodb.MongoCommandException: Command failed with error 13 (Unauthorized)” typically arises from permission or authentication issues.
To resolve the issue, consider the following suggestions:
If the issue persists, I’d recommend reaching out to Google Cloud Support. When reaching out, include detailed information and relevant screenshots of the errors you’ve encountered. This will assist them in diagnosing and resolving your issue more efficiently.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.