0

We have a MongoDB Replica set from Ali Cloud. We set up the MongoDB URL as

mongodb://username:password@dds-xxxxx-pub.mongodb.rds.aliyuncs.com:3717,dds-xxxxx-pub.mongodb.rds.aliyuncs.com:3717/admin?replicaSet=mgset-xxxxx

When the server starts, ReactiveMongo threw an error:

Invalid node status Primary for dds-2zedbafbdcdae6541787-pub.mongodb.rds.aliyuncs.com:3717 (expected: Unknown); Fallback to Unknown status

I looked through ReactiveMongo's source code but couldn't understand why it is expecting unknown status?

upSet.updateAll { n =>
          if (node.names.contains(n.name) && // the node itself
            n.status != node.status) {
            // invalidate node status on status conflict
            warn(s"Invalid node status ${node.status} for ${node.name} (expected: ${n.status}); Fallback to Unknown status")

            n._copy(status = NodeStatus.Unknown)
          } else n
        }
cchantep
  • 9,118
  • 3
  • 30
  • 41
angelokh
  • 9,426
  • 9
  • 69
  • 139
  • It's not "expecting unknown" but as indicated by the message it "Fallback to Unknown status" when the node is not properly reachable. http://reactivemongo.org/releases/0.1x/documentation/tutorial/alibaba-apsaradb.html – cchantep Nov 05 '19 at 08:55
  • @cchantep But I can access it from my terminal with the same link with `mongo "mongodb://username:password@dds.........."`. So that means the Mongo server has public access. – angelokh Nov 09 '19 at 05:26
  • 1
    As indicated in mentioned tutorial, connection is fine (even if ApsaraDB is not a fully compatible MongoDB) – cchantep Nov 09 '19 at 11:14
  • This is also happening to us when upgrade to ReactiveMongo 0.18.8 ... and this is a bug that also was present on previous version, it appeared, fixed, then apprear again ... sadly the status check is a little a mess there, if you like you may open a ticket to the ReactiveMongo guys here -> https://github.com/ReactiveMongo/ReactiveMongo/issues – Carlos Saltos Nov 12 '19 at 13:51
  • 1
    I've already open the issue here -> https://github.com/ReactiveMongo/ReactiveMongo/issues/894 – Carlos Saltos Nov 12 '19 at 14:04

1 Answers1

0

It works for us after ignoring the replicaSet option.

http://reactivemongo.org/releases/0.1x/documentation/tutorial/alibaba-apsaradb.html

Finally for ReactiveMongo connection, the replicaSet option can be removed from the URI, and the password placeholder must be replaced with the actual value.

mongodb.uri = "mongodb://root:${APSARADB_PASSWORD}@dds-4e6322c0290348c49176-pub.mongodb.germany.rds.aliyuncs.com:3717/${APSARADB_DBNAME}"

Community
  • 1
  • 1
angelokh
  • 9,426
  • 9
  • 69
  • 139