-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with Mongo 3.0? #34
Comments
I actually just found this closed issue: #31 I'll try installing directly from source since it doesn't look like it's on CRAN yet. |
I'm still unable to authenticate even when using the 0.1.0 version of RMongo.
When I try to query without authenticating I get this:
|
@tcash21 are you sure the user/pass is correct with the permissions? the error message sounds like the permissions aren't correct. |
Yes. We actually wrote a new version with the latest driver and it's working. Will let you know once we're able to release it. Thank you though! |
Getting the same error with RMongo 0.1.0 and Mongo 3.0.2: Error in .jcall(rmongo.object@javaMongo, "[S", "dbShowCollections") : Authentication succeeds if I use local mongo client or pymongo to connect to remote mongodb, but fails in R as well as clients like UMongo. Not sure what I've done wrong. |
@tcash21 do you have any suggestions for @davesgonechina ? |
Hi, I adapted your code such that is able to connect to replica sets with the new authentication method of MongoDB 3.0. Unfortunately I have no experience with the used programming language Scala (and almost no exp. in R). ALso I do not have the time to get the code to a higher quality. I have not tested, if my changes break anything (which could be the case especially for old authentication methods in my code). I will publish the patch here and write a few remarks in my next post. So if you, @tc , or anybody else has the time, please feel free to adopt the code snippet and commit it to Github. Also one remark, although it is not urgent, RMongo uses the Monog Java driver in version 2.13 the 3.0 driver is available for at least half a year now, RMongo is using maven to build this library, it would be cool t update also the driver to 3.0. |
|
OK, no idea how to upload patches in a discussion on GIthib. Seems that I would need write rights for uploading a patch file. In my previos post, see above, I posted the content of my patch. The patch should work at least for replica sets with MongoDB 3.0 SCRAM-SHA1 authentictaion. |
Hi, you can submit this as a pull request. There's a help page on github
|
Hi, not sure if I did the Pull request stuff right (first time), did you receive it? |
Got the pull request, thanks! will review. |
Hi svensteudter, I am using patch to connect to a replica sets. How would you initialise a host variable when using Am stuck here. Can you help. |
Hi svensteudter, |
Hi midunrajendranpandera, What I did was changing some code, to adapt it to the new way how a connection and authentication to MongoDB should be done. I ONLY updated this with the focus on connecting to a replica set. That should work. The rest remained unchanged. If you ar eable to connect and authentciate to a replica seton MongoDB 3.0 with my patch, than my patch is doing what it is intended for, else not. The way to use it in R should be If there is another bug not related to connecting and authenticating to MongoDB wirh RMongo please open a new issue. |
@tc Btw. I have almost no experience in R and absolutely no expereince scala. All I did was adapting your code quick'n dirty for a colleague of mine. What looks a litle bit strange to me is the how the code is built. You include the Java driver, add a Scala intermediate layer which has the responsibility to call the Java methods. From those both, Java Mongo driver and the Scala intermediate layer you build a Java library. Would it not be the easiest solution, to simply use the Java Mongo driver directly? I.e., only the code in rmongo.R would be needed, which directly operates on the Java driver. Am I missing here something? (This would still need some work for calling the corresponding Java methods in R) |
Here's an alternative method for connecting to MongoDB 3.0, which is to roll back MongoDB's user authentication method from SCRAM-SHA-1 to MONGODB-CR. I can confirm RMongo and rmongodb both can successfully authenticate and query with these changes. Log in to MongoDB with administrative privileges. If the following returns the value '5', it is set to SCRAM-SHA-1 and you need to change it to '3'
First you might need to add the system role to your user account:
Then change the authentication scheme:
Once this is done, restart mongo. Make sure to set auth=true either in the command line or mongod.conf file. Now when you create a new user, it will use MONGODB-CR which compatible with older drivers. Previously existing users, however, will continue to use SCRAM-SHA-1 unless you drop and recreate their accounts. You can check each users authentication method using:
|
Hi davesgonechina, this is a well known solution. Good point to add it here in the discussion. Some could use this to reset the authentication protocol to the previous used method and circumvent the problems. For a productive system, where availablity is a must this is not an option, because you need to shut down the system and (if I understood the solution correct), during changing the authentication method, active users can not access the db until the users are also migrated to this authentication method. |
Thanks for your response svensteudter. |
@svensteudter, you are right, we can use just the Java mongo driver and On Wed, Oct 21, 2015 at 1:31 AM, svensteudter [email protected]
Tommy Chheng |
It looks like RMongo is still incompatible with Mongo 3.0. When I try to execute a dbGetQuery() for a database hosted on mongolab.com, I see the following error:
Any hope for an update on this? Btw, in the readme file, the command line for installing the src should use a capitalized "INSTALL" instead of lowercase:
|
Sorry but i'm a little busy at the moment. Feel free to submit a PR and i On Sat, Nov 7, 2015 at 9:22 AM, Kory Becker [email protected]
Tommy Chheng |
This is still open yes? I can't connect using authentication with Mongo 3.x? |
No, you should be able with the modifications added to login to MongoDB BUT NOT with the standard login method, but using "mongoDbReplicaSetConnectWithCredentials " at least connecting to RS. As far as I remember this was also working for single dbs. |
Hi there, |
Have you tried @svensteudter 's solution? |
Hi all, finally checking in on this again I wasn't getting alerts. @davesgonechina and @tc unfortunately I don't have permission to release the full code, but we set up auth via java like this: I have not tried the
|
Hello,
Trying to connect, authenticate and query but I need to switch away from the admin database once authenticated.
Additionally, even querying against the database is resulting in Read operation failures:
Error in .jcall(rmongo.object@javaMongo, "S", "dbGetQuery", collection, :
com.mongodb.MongoException$Network: Read operation to server dscimemd01/10.9.68.7:27017 failed on database huron
Is this an issue with Mongo 3.0 and the driver included in this package?
Thanks,
Tanya
The text was updated successfully, but these errors were encountered: