Re: [mongodb-user] Rare case where master=null, probably all servers are down with 2.11.0 java driver

623 views
Skip to first unread message

Jeff Yemin

unread,
Mar 26, 2013, 2:51:37 PM3/26/13
to mongod...@googlegroups.com
Hi Chris,

Which Mongo/MongoClient constructor are you using?  I

Jeff


On Tue, Mar 26, 2013 at 2:07 PM, ChrisCurtin <ccu...@curtinhome.com> wrote:
Hi,

We upgraded our dev environments to 2.4.1 and the 2.11.0 Java driver. When we try to connect we get the following error:

com.mongodb.MongoException: Rare case where master=null, probably all servers are down

     at com.mongodb.DBTCPConnector$MyPort.get(DBTCPConnector.java:402)

     at com.mongodb.DBTCPConnector.authenticate(DBTCPConnector.java:617)

     at com.mongodb.DBApiLayer.doAuthenticate(DBApiLayer.java:180)

     at com.mongodb.DB.authenticateCommandHelper(DB.java:630)

     at com.mongodb.DB.authenticate(DB.java:588)

     ... (our code)


When we roll back to 2.10.1 driver it works fine.

Any thoughts what is different between 2.10.1 and 2.11 around DB authentication?

Thanks,

Chris

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

ChrisCurtin

unread,
Mar 26, 2013, 3:21:22 PM3/26/13
to mongod...@googlegroups.com
Hi Jeff,

We use: MongoClient(List<ServerAddresses>, MongoClientOptions) only options we use are  WriteConcern.MAJORITY. List of servers has multiple servers in it, all active.

Then:

        MongoClient mongoClient = mongoClientProvider.getMongoClient();
        DB database = mongoClient.getDB(databaseName);
Exception here -->         database.authenticate(username, password.toCharArray());

Jeff Yemin

unread,
Mar 26, 2013, 4:49:36 PM3/26/13
to mongod...@googlegroups.com
Hi Chris,

There does appear to be a race condition introduced in 2.11.0, but I can only see it manifesting if there was a connectivity problem between the client and one or more members of the replica set.  In particular, the call to Object.wait in com.mongodb.DynamicConnectionStatus#getConnectionStatus would have to time out (10 seconds by default) and the method return null.  This is certainly possible but doesn't seem to fit the circumstances you described, where all servers are active.  

I opened https://jira.mongodb.org/browse/JAVA-793 to track this bug, but it looks like I'll need some more information to get to the root cause.  Can you do a thread dump of your application after getting that exception, and let me know if there are any threads with names starting with either "MongosStatus" or "ReplicaSetStatus"?


In the mean time, you can also try this workaround: use this constructor 

    MongoClient(List<ServerAddress> seeds, List<MongoCredential> credentialsList, MongoClientOptions options)

instead of calling DB.authenticate().  


Regards,
Jeff

ChrisCurtin

unread,
Mar 27, 2013, 1:15:08 PM3/27/13
to mongod...@googlegroups.com
Hi Jeff,

I've added the thread dump to the JIRA. Also note that the error occurs immediately. not after a 10 second timeout. Operations has confirmed all the replicas are up for the cluster. 

Thanks,

Chris

Jeff Yemin

unread,
Mar 27, 2013, 4:31:24 PM3/27/13
to mongod...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages