Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2391

Auth error when restoring to mongodb 4.2 that does not have auth enabled

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.2.0
    • Component/s: mongorestore
    • Labels:
      None
    • Environment:
      Ubuntu xenial

      I have previously been able to restore a db to mongo v4.0 without issues, but when I restore to v4.2 I see auth errors. In both cases the db does not have auth enabled. This is the error when restoring to mongo 4.2:

      $ mongorestore -h [HOSTNAME] -p 27017 -d [DBNAME] --sslCAFile [PATH_TO_CERTS_DIR]/ca/mongo-ca.crt --sslPEMKeyFile [PATH_TO_CERTS_DIR]/client/mongo-client.pem --ssl /tmp/tmp.qq5fLSuatw
      2019-10-06T03:59:55.045+0100 error connecting to host: could not connect to server: connection() : auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.Connection to [HOSTNAME] closed.

      $ cat /etc/mongod.conf | grep auth

      1. authorization: enabled

      This is the exact mongo version:

      $ mongo --version
      MongoDB shell version v4.2.0
      git version: a4b751dcf51dd249c5865812b390cfd1c0129c30
      OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
      allocator: tcmalloc
      modules: none
      build environment:
      distmod: ubuntu1604
      distarch: x86_64
      target_arch: x86_64
      $ mongorestore --version
      mongorestore version: r4.2.0
      git version: a4b751dcf51dd249c5865812b390cfd1c0129c30
      Go version: go1.12.4
      os: linux
      arch: amd64
      compiler: gc

      I read the release notes for 4.2 but did not find any mention of something changing in the auth system.

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            markjgsmith@gmail.com Mark Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: