-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.5.3
-
Component/s: Connection Management
-
Environment:Using the library via the Casbah Scala library
Some Mongo database servers do not give average accounts access to the admin database. This causes problems when attempting to make an authorized connection to a normal database.
When attempting to connect to such a machine, I get errors like this:
{{Jan 11, 2012 3:56:24 PM com.mongodb.DBTCPConnector fetchMaxBsonObjectSize
WARNING: null
java.io.IOException: couldn't connect to [/0.0.39.87:27017] bc:java.net.SocketException: Invalid argument or cannot assign requested address
at com.mongodb.DBPort._open(DBPort.java:206)
at com.mongodb.DBPort.go(DBPort.java:94)
at com.mongodb.DBPort.go(DBPort.java:75)
at com.mongodb.DBPort.findOne(DBPort.java:129)
at com.mongodb.DBPort.runCommand(DBPort.java:138)
at com.mongodb.DBTCPConnector.fetchMaxBsonObjectSize(DBTCPConnector.java:409)
at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:396)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:192)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295)
at com.mongodb.DB.command(DB.java:152)
at com.mongodb.DB._doauth(DB.java:496)
at com.mongodb.DB.authenticate(DB.java:433)
at com.mongodb.casbah.MongoDB.authenticate(MongoDB.scala:74)}}
I can't say what the exact solution is, but it appears that fetchMaxBsonObjectSize() returns a null in this situation, with its unexpected presence (an int is expected) then causing the exception in later commands like DB.authenticate().