You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure this qualifies as a bug, most likely not, but transitioning from the legacy driver to mongodb with php library is ending up with auth failure message.
I'm using the same connection (mongodb://user:passwor@mymongoinstance:port/database) string that I used on legacy mongo driver. I'm running a simple find as you can see on stackoverflow. Why am I getting auth failure?
Below you can see in $this, the data being submitted to my collection. As soon as return new Query($this->filter, $options) is called passing query to mongodb driver I get "auth fails" in vendor/mongodb/mongodb/src/Operation/Find.php. I've tried setting readPreference to new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY), but it makes no difference.
Environment:
Windows 10
Wamp
PHP 5.5.12
Mongodb driver 1.1.4
Latest version of new php library (Installed with composer: composer require "mongodb/mongodb=^1.0.0")
Mongo instance version 2.4.6
The text was updated successfully, but these errors were encountered:
Looks like I answered this on StackOverflow before seeing this post. I'll repeat:
It is possible that the mongodb extension that you are using as not been compiled with SASL support. The older driver did not rely on any outside library, but the new one depends on OpenSSL for that. Sadly, there does not seem to be a way to check that by looking at phpinfo() output. You might be able to find whether it's linked to libsasl.lib with dependency walker (http://www.dependencywalker.com/), but I'm not a Windows expert.
So here's the solution. After 3 days of banging my head against a wall it turns out the new mongodb driver parses the mongodb uri differently than the legacy mongo driver. My password had a % sign in it. As soon as I changed the % sign to something else everything worked as expected.
I provided some more details on stackoverflow here: http://stackoverflow.com/questions/36021688/mongodb-auth-fails-with-mongodb-php-driver-and-new-php-library
Not sure this qualifies as a bug, most likely not, but transitioning from the legacy driver to mongodb with php library is ending up with auth failure message.
I'm using the same connection (mongodb://user:passwor@mymongoinstance:port/database) string that I used on legacy mongo driver. I'm running a simple find as you can see on stackoverflow. Why am I getting auth failure?
Below you can see in $this, the data being submitted to my collection. As soon as return new Query($this->filter, $options) is called passing query to mongodb driver I get "auth fails" in vendor/mongodb/mongodb/src/Operation/Find.php. I've tried setting readPreference to new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY), but it makes no difference.
Environment:
Windows 10
Wamp
PHP 5.5.12
Mongodb driver 1.1.4
Latest version of new php library (Installed with composer: composer require "mongodb/mongodb=^1.0.0")
Mongo instance version 2.4.6
The text was updated successfully, but these errors were encountered: