Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-340

Assertion occurs when trying to perform client authentication to MongoDB dtabase

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • API

    Description

      Hi Tyler,

      I can't get to my previous ticket CXX-332.

      I am on RHEL 6.2. I am using 2.6.3 MongoDB C++ driver:

      Here are the issues I am having below: I am encountering an Assertion when trying to authenticate to the MongoDB database. I have included the assertion and also my code. Please let me know if you need any additional information. Thank you.

      11 Sep 2014 10:58:38,228 [TV2.CWFPresenterMgr           ][ User= Session=] [INFO ]: anytoany: BEFORE CONNECT
      anytoany api SSL init SUCCESSFUL!!
      2014-09-11T10:58:38.230-0500 Assertion failure p src/mongo/client/dbclientinterface.h 1289
      2014-09-11T10:58:38.231-0500 0x4de5690 0x4de9193 0x4ddcf81 0x4d6a50d 0x4d9a97a 0x4d5ed2c 0x4d77692 0x4d6ad92 0x4d6b2bb 0x4d6c161 0x4d6c2f1 0x4d65fa0 0x4d6717b 0x4d69ab0 0x4d62d54 0x3e0f0a 0x3fb66a 0x80f5a4b 0x8073aff 0x8155331
      /usr/local/lib/libmongoclient.so(+0xcd690) [0x4de5690]
      /usr/local/lib/libmongoclient.so(+0xd1193) [0x4de9193]
      /usr/local/lib/libmongoclient.so(_ZN5mongo12verifyFailedEPKcS1_j+0x171) [0x4ddcf81]
      /usr/local/lib/libmongoclient.so(_ZN5mongo18DBClientConnection4callERNS_7MessageES2_bPSs+0x14d) [0x4d6a50d]
      /usr/local/lib/libmongoclient.so(_ZN5mongo14DBClientCursor4initEv+0xaa) [0x4d9a97a]
      /usr/local/lib/libmongoclient.so(_ZN5mongo12DBClientBase5queryERKSsNS_5QueryEiiPKNS_7BSONObjEii+0x21c) [0x4d5ed2c]
      /usr/local/lib/libmongoclient.so(_ZN5mongo18DBClientConnection5queryERKSsNS_5QueryEiiPKNS_7BSONObjEii+0x82) [0x4d77692]
      /usr/local/lib/libmongoclient.so(_ZN5mongo17DBClientInterface5findNERSt6vectorINS_7BSONObjESaIS2_EERKSsNS_5QueryEiiPKS2_i+0x92) [0x4d6ad92]
      /usr/local/lib/libmongoclient.so(_ZN5mongo17DBClientInterface7findOneERKSsRKNS_5QueryEPKNS_7BSONObjEi+0x8b) [0x4d6b2bb]
      /usr/local/lib/libmongoclient.so(_ZN5mongo20DBClientWithCommands10runCommandERKSsRKNS_7BSONObjERS3_i+0x511) [0x4d6c161]
      /usr/local/lib/libmongoclient.so(_ZN5mongo18DBClientConnection10runCommandERKSsRKNS_7BSONObjERS3_i+0x41) [0x4d6c2f1]
      /usr/local/lib/libmongoclient.so(_ZN5mongo20DBClientWithCommands12_authMongoCRERKSsS2_S2_PNS_7BSONObjEb+0x80) [0x4d65fa0]
      /usr/local/lib/libmongoclient.so(_ZN5mongo20DBClientWithCommands5_authERKNS_7BSONObjE+0x46b) [0x4d6717b]
      /usr/local/lib/libmongoclient.so(_ZN5mongo18DBClientConnection5_authERKNS_7BSONObjE+0x220) [0x4d69ab0]
      /usr/local/lib/libmongoclient.so(_ZN5mongo20DBClientWithCommands4authERKSsS2_S2_RSsb+0x2f4) [0x4d62d54]
       

      mongo::sslGlobalParams.sslMode.store(mongo::SSLGlobalParams::SSLMode_requireSSL);
                      mongo::sslGlobalParams.sslPEMKeyFile = "";
                      //mongo::sslGlobalParams.sslPEMKeyFile = "/users/apps/tstlrn/u019807/DTCD9C3B2F42757.ent.wfb.bank.corp_mongo_wells.pem";  
                      mongo::Status status = mongo::client::initialize();
                      if (!status.isOK())
                      {
                              std::cout << "anytoany api SSL init FAILED!!" << std::endl;
                              //::abort();
       
                      }
                      else
                      {
       
                              // still try to connect
                              std::cout << "anytoany api SSL init SUCCESSFUL!!" << std::endl;
                      }
       
                      std::string database = "anytoany";
                      std::string userid = "anytoanyadmin";
                      std::string pw = "password";
                      std::string errorMessage = "auth error";
                      mongoClient.auth(database, userid, pw, errorMessage, true);
                      mongoClient.connect(mongo::HostAndPort(hostname));

      Attachments

        Activity

          People

            tyler@10gen.com Tyler Brock
            lfall911 Lisbeth Fall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: