Uploaded image for project: 'Managed Service - Connectors'
  1. Managed Service - Connectors
  2. MGDCTRS-1651

MongoDB Debezium Connector fails when connecting to MongoDB Atlas with authentication error

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • None
    • None
    • debezium
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Very Likely
    • 0

      When deploying a MongoDB Debezium Connector (version 1.9.6.Final) to a MongoDB Atlas managed database (free tier shared database), the connector fails with the following error message:

      ConnectRestException: PUT /connectors/mctr-cdhqssbjdpqd9bgpgsug/config returned 400 (Bad Request): Connector configuration is invalid and contains the following 1 error(s): Unable to connect: Command failed with error 8000 (AtlasError): '(Unauthorized) not authorized on local to execute command \{ buildInfo: 1, $db: "local", $clusterTime: { clusterTime: {1667477216 20}, signature: \{ hash: {0 [183 104 200 148 159 6 196 216 183 101 77 205 157 67 154 68 186 248 101 54]}, keyId: 7116891406542569472.000000 } }, lsid: \{ id: {4 [145 64 26 49 201 202 73 64 154 235 217 203 231 1 227 43]} } }' on server ac-chk8ots-shard-00-01.dmgnh8m.mongodb.net:27017. The full response is \{"ok": 0, "errmsg": "(Unauthorized) not authorized on local to execute command { buildInfo: 1, $db: \"local\", $clusterTime: { clusterTime: {1667477216 20}, signature: \{ hash: {0 [183 104 200 148 159 6 196 216 183 101 77 205 157 67 154 68 186 248 101 54]}, keyId: 7116891406542569472.000000 } }, lsid: \{ id: {4 [145 64 26 49 201 202 73 64 154 235 217 203 231 1 227 43]} } }", "code": 8000, "codeName": "AtlasError"} You can also find the above list of errors at the endpoint `/connector-plugins/\{connectorType}/config/validate`
      

      How to reproduce

      • On cloud.mongo.com, provision a MongoDB using the free tier. Create a user with admin privileges. Make sure the database is accessible from anywhere (0.0.0.0/0).
      • On console.redhat.com provision a Kafka trial cluster, and create a Debezium MongoDB connector to the MongoDB instance.

      Expected

      The connector deploys successfully.

      Result

      The connector fails with the error message stated above.

      Analysis

      When connecting to MongoDB, the Debezium connector performs a buildInfo call to the local database. See https://github.com/debezium/debezium/blob/aa1982adc50cad10cf1c7e4123335a7900e3d16e/debezium-connector-mongodb/src/main/java/io/debezium/connector/mongodb/MongoDbConnector.java#L228-L236

      It seems MongoDB Atlas no longer authorizes that call (not sure since when, but it used to work until two weeks ago when I last tried).

      I see the same issue when using the Debezium 1.9.6 connector on Kafka Connect running on my local OpenShift cluster.

      Also, the 2.0.0.Final version of the Debezium connector does not longer issue the call to buildInfo, so this version works fine against MongoDB Atlas

            rk3rn3r René Kerner
            btison Bernard Tison (Inactive)
            Archiver:
            ranumula@redhat.com Raju Anumula

              Created:
              Updated:
              Resolved:
              Archived: