Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-8938

Oak run recovery fails when running on mongo replicaSet with auth enabled

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.6.0, 1.8.0
    • 1.8.21
    • run
    • None

    Description

      When running oak run jar in recovery mode on a mongo replica set with auth enabled. it fails to pass the auth data for a findOne command called in GetRootRevisionsCallable

       

      DBObject root = collection.findOne(new BasicDBObject(Document.ID, "0:/"));

      Stack Trace as below
      07:07:27.790 [MongoDocumentStore replica set info provider] ERROR o.a.j.o.p.d.m.replica.ReplicaSetInfo - Can't connect to the Mongo instance07:07:27.790 [MongoDocumentStore replica set info provider] ERROR o.a.j.o.p.d.m.replica.ReplicaSetInfo - Can't connect to the Mongo instancejava.util.concurrent.ExecutionException: com.mongodb.MongoQueryException: Query failed with error code 13 and error message 'not authorized on dampro64tmp to execute command { find: "nodes", filter:

      { _id: "0:/" }

      , limit: 1, singleBatch: true }' on server 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:346) at org.apache.jackrabbit.oak.plugins.document.mongo.replica.ReplicaSetInfo.updateRevisions(ReplicaSetInfo.java:269) at org.apache.jackrabbit.oak.plugins.document.mongo.replica.ReplicaSetInfo.updateReplicaStatus(ReplicaSetInfo.java:181) at org.apache.jackrabbit.oak.plugins.document.mongo.replica.ReplicaSetInfo.updateLoop(ReplicaSetInfo.java:144) at org.apache.jackrabbit.oak.plugins.document.mongo.replica.ReplicaSetInfo.run(ReplicaSetInfo.java:133) at java.lang.Thread.run(Thread.java:745)Caused by: com.mongodb.MongoQueryException: Query failed with error code 13 and error message 'not authorized on DB to execute command { find: "nodes", filter:

      { _id: "0:/" }

      , limit: 1, singleBatch: true }' on server at com.mongodb.operation.FindOperation$1.call(FindOperation.java:722) at com.mongodb.operation.FindOperation$1.call(FindOperation.java:711) at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:471) at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:415) at com.mongodb.operation.FindOperation.execute(FindOperation.java:711) at com.mongodb.operation.FindOperation.execute(FindOperation.java:83) at com.mongodb.Mongo$3.execute(Mongo.java:826) at com.mongodb.Mongo$3.execute(Mongo.java:813) at com.mongodb.DBCursor.initializeCursor(DBCursor.java:877) at com.mongodb.DBCursor.hasNext(DBCursor.java:144) at com.mongodb.DBCursor.one(DBCursor.java:683) at com.mongodb.DBCollection.findOne(DBCollection.java:829) at com.mongodb.DBCollection.findOne(DBCollection.java:792) at com.mongodb.DBCollection.findOne(DBCollection.java:739) at org.apache.jackrabbit.oak.plugins.document.mongo.replica.GetRootRevisionsCallable.call(GetRootRevisionsCallable.java:58) at org.apache.jackrabbit.oak.plugins.document.mongo.replica.GetRootRevisionsCallable.call(GetRootRevisionsCallable.java:34) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297) at org.apache.jackrabbit.oak.plugins.document.mongo.replica.ReplicaSetInfo.getRootRevisions(ReplicaSetInfo.java:340) ... 5 common frames omitted

      Attachments

        1. OAK-8938.patch
          0.8 kB
          Vinod Holani
        2. OAK-8938_V2.patch
          5 kB
          Marcel Reutegger
        3. OAK-8938_V1.patch
          4 kB
          Vinod Holani

        Issue Links

          Activity

            People

              mreutegg Marcel Reutegger
              vholani Vinod Holani
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: