[CXX-340] Assertion occurs when trying to perform client authentication to MongoDB dtabase Created: 12/Sep/14  Updated: 13/Nov/14  Resolved: 12/Sep/14

Status: Closed
Project: C++ Driver
Component/s: API
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Lisbeth Fall Assignee: Tyler Brock
Resolution: Done Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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));



 Comments   
Comment by Lisbeth Fall [ 12/Sep/14 ]

Tyler,

I moved the authentication code to after the connect and everything works.

Thank you,
Liz

Comment by Lisbeth Fall [ 12/Sep/14 ]

Hi Tyler,

Thank you for letting me know. I received about five e-mails with your one response. I am not sure if that is an issue or not.

Thank you,
Liz

Comment by Tyler Brock [ 12/Sep/14 ]

Hi Liz, we moved those tickets to Community Private support as they contained potentially sensitive information. This way only you can view the ticket and not the community at large. You should be able to see it now if you take a look (there was a permission problem initially)

Comment by Lisbeth Fall [ 12/Sep/14 ]

Thank you, Tyler. Whoops on my part. I will try that and let you know.

Also, can we look into the my previous bug with the client certificate? I am not sure why I can't view that issue. The issue was CXX-332.

Thanks,
Liz

Comment by Tyler Brock [ 12/Sep/14 ]

Hi Liz,

You have to call connect before you authenticate to the database.

Comment by Lisbeth Fall [ 12/Sep/14 ]

I am on RHEL 6.2. I had a typo above with LHEL.

Thanks,
Liz

Generated at Wed Feb 07 21:58:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.