You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Ben Erridge <be...@cyberoblivion.com> on 2019/08/22 20:43:53 UTC

Mongo replicasetinfo failing on when auth turned on

I have a 3 node Mongo cluster that was working with Oak before I enabled
authorization.

I set up a user with every permission possible.

I use this code to build my repository.

MongoClientURI uri = new
MongoClientURI("mongodb://root4:root4pw@mongo1,mongo2,mongo3/test?replicaSet=rs0&authSource=admin");MongoClient
mongoClient = new MongoClient(uri);
DB db = mongoClient.getDB("test");DocumentNodeStore ns =
MongoDocumentNodeStoreBuilder.newMongoDocumentNodeStoreBuilder().setMongoDB(db).build();Oak
oak = new Oak(ns);Jcr jcr = new Jcr(oak);

The repository fails to build with this stack trace

java.util.concurrent.ExecutionException:
com.mongodb.MongoQueryException: Query failed with error code 13 and
error message 'not authorized on admin to execute command { find:
"nodes", filter: { _id: "0:/" }, limit: 1, singleBatch: true }' on
server mongo-bill-3:27017
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.jackrabbit.oak.plugins.document.mongo.replica.ReplicaSetInfo.getRootRevisions(ReplicaSetInfo.java:347)
at org.apache.jackrabbit.oak.plugins.document.mongo.replica.ReplicaSetInfo.updateRevisions(ReplicaSetInfo.java:270)
at org.apache.jackrabbit.oak.plugins.document.mongo.replica.ReplicaSetInfo.updateReplicaStatus(ReplicaSetInfo.java:182)
at org.apache.jackrabbit.oak.plugins.document.mongo.replica.ReplicaSetInfo.updateLoop(ReplicaSetInfo.java:145)
at org.apache.jackrabbit.oak.plugins.document.mongo.replica.ReplicaSetInfo.run(ReplicaSetInfo.java:134)
at java.lang.Thread.run(Thread.java:748)

I'm not sure if there is some setting I've missed? Is there any way to get
Oak and Mongo to work properly with authorization turned on in MongoDB?

Mongo: 3.4.22
Oak: 1.8.6
-- 
Benjamin Erridge

Re: Mongo replicasetinfo failing on when auth turned on

Posted by Ben Erridge <be...@cyberoblivion.com>.
Thanks for the suggestion.
I just tried 1.8.15 and still got the same error.
Any other suggestions would be appreciated!

On Mon, Aug 26, 2019 at 4:26 AM Julian Reschke <ju...@gmx.de>
wrote:

> On 22.08.2019 22:43, Ben Erridge wrote:
> > I have a 3 node Mongo cluster that was working with Oak before I enabled
> > authorization.
> > ...
> > I'm not sure if there is some setting I've missed? Is there any way to
> get
> > Oak and Mongo to work properly with authorization turned on in MongoDB?
> >
> > Mongo: 3.4.22
> > Oak: 1.8.6
>
> You are ~ 1 year behind in Oak 1.8 versions; current is Oak 1.8.15. I
> recommend trying a recent release first.
>
> Best regards, Julian
>
>
>
>

-- 
Benjamin Erridge

Re: Mongo replicasetinfo failing on when auth turned on

Posted by Julian Reschke <ju...@gmx.de>.
On 22.08.2019 22:43, Ben Erridge wrote:
> I have a 3 node Mongo cluster that was working with Oak before I enabled
> authorization.
> ...
> I'm not sure if there is some setting I've missed? Is there any way to get
> Oak and Mongo to work properly with authorization turned on in MongoDB?
>
> Mongo: 3.4.22
> Oak: 1.8.6

You are ~ 1 year behind in Oak 1.8 versions; current is Oak 1.8.15. I
recommend trying a recent release first.

Best regards, Julian