[JAVA-2817] Can not connect via my app Created: 20/Mar/18  Updated: 27/Oct/23  Resolved: 22/Mar/18

Status: Closed
Project: Java Driver
Component/s: Authentication
Affects Version/s: 3.6.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kerwin Stanley Assignee: Ross Lawley
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongoldb Atlas


Issue Links:
Backports
backports JAVA-2818 can not connect Closed
Related
related to DOCS-12568 [Atlas] Connecting to MTM clusters re... Closed
Case:

 Description   

Timed out after 30000 ms while waiting for a server that matches com.mongodb.Mongo$4@683b93dd. Client view of cluster state is {type=REPLICA_SET, servers=[{address=kxnbis-shard-00-01-hmp7e.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='kerwinfs', source='admin', password=<hidden>, mechanismProperties={}}}, caused by {com.mongodb.MongoCommandException: Command failed with error 8000: 'bad auth Authentication failed.' on server kxnbis-shard-00-01-hmp7e.mongodb.net:27017. The full response is

{ "ok" : 0, "errmsg" : "bad auth Authentication failed.", "code" : 8000, "codeName" : "AtlasError" }

}}, {address=kxnbis-shard-00-00-hmp7e.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='kerwinfs', source='admin', password=<hidden>, mechanismProperties={}}}, caused by {com.mongodb.MongoCommandException: Command failed with error 8000: 'bad auth Authentication failed.' on server kxnbis-shard-00-00-hmp7e.mongodb.net:27017. The full response is

{ "ok" : 0, "errmsg" : "bad auth Authentication failed.", "code" : 8000, "codeName" : "AtlasError" }

}}, {address=kxnbis-shard-00-02-hmp7e.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='kerwinfs', source='admin', password=<hidden>, mechanismProperties={}}}, caused by {com.mongodb.MongoCommandException: Command failed with error 8000: 'bad auth Authentication failed.' on server kxnbis-shard-00-02-hmp7e.mongodb.net:27017. The full response is

{ "ok" : 0, "errmsg" : "bad auth Authentication failed.", "code" : 8000, "codeName" : "AtlasError" }

}}]



 Comments   
Comment by Ross Lawley [ 20/Mar/18 ]

Hi kerwinfs,

As mentioned previously, the error shown is an "Authentication Failed" error. Please check your credentials and IP whitelist are configured correctly when connecting to your Atlas cluster.

The atlas documentation mentions some prerequisites for connecting:

TLS/SSL
Clients must have support for TLS/SSL to connect to an Atlas cluster.

Clients must have support for the SNI TLS extension to connect to an Atlas M0 Free Tier or M2/M5 shared starter cluster.

Whitelist
To access a cluster, you must connect from an IP address on the Atlas project’s IP whitelist. If you need to add an IP address to the whitelist, you can do so in the Connect dialog. You can also add the IP address from the Security tab.

See: https://docs.atlas.mongodb.com/connect-to-cluster/#prerequisites

It should be noted SNI support requires both Java 8 or newer and the 3.6.3 Java driver.

I hope that helps, if you require further assistance please follow up via either the mongodb-user mailinglist or stackoverflow - please post a link in this ticket if you do and I'll endeavour to follow up.

All the best,

Ross

Comment by Kerwin Stanley [ 20/Mar/18 ]

I'm using the mongo driver. So you can't help?

Regards,
Kerwin

Comment by Ross Lawley [ 20/Mar/18 ]

Hi kerwinfs,

Just to let you know this project is for Java driver bugs or feature requests. The best place for questions regarding MongoDB usage or the community support for Atlas specifics is the mongodb-user mailinglist or stackoverflow as you will reach a boarder audience there. If your business requires an answer from MongoDB within a time frame then we do offer production support.

The error shown is an "Authentication Failed", please check your credentials and IP whitelist are configured correctly when connecting to your Atlas cluster. Are you on Atlas free or Atlas professional? I believe further support is available to professional users - let me know and I'll double check for you.

Ross

Generated at Thu Feb 08 08:58:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.