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

Why can't driver connect?

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Incomplete
    • Icon: Major - P3 Major - P3
    • None
    • legacy-1.0.0-rc3
    • None
    • Linux (Fedora 21)

    Description

      Hi.
      I'm having some strange problems with the C++ driver. I have been digging for some time.
      I'm programming against Fedora 21's libmongoclient (2.4.9) and it works. But since I'm deploying to Amazon I need to compile statically so I clone from mongo-cxx-driver. This worked fine last week, but today I pulled the latest rc3 and now I can't even get the hello world app to work (slightly modified):

      #include <cstdlib>
      #include <iostream>
      #include <string>
      #include "mongo/client/dbclient.h" // for the driver
      using namespace std;
       
      void run() {
          mongo::DBClientConnection c;
          string host = "127.0.0.1";
          mongo::HostAndPort hp(host, 27017);
          string err;
          c.connect(hp, err);
      }
       
      int main() {
          mongo::client::initialize();
          try
              { run(); std::cout << "connected ok" << std::endl; }
          catch( const mongo::DBException &e )
              { std::cout << "caught " << e.what() << std::endl; }
          return EXIT_SUCCESS;
      }

      This code, and my fails to connect and throws this exception:

      caught DBClientBase::findN: transport error: 127.0.0.1:27017 ns: admin.$cmd query: { ismaster: 1 }

      I tried resetting to rc2 and that revision actually connects without exceptions and I can download a BSONObject, however - this version just returns EOO for fields that actually exists (I can see them in Robomongo and the whole program works with Fedora's libmongoclient).
      But since I cannot even get the hello world sample to work something has to be wrong.

      I'm compiling with:
      sudo scons --prefix=/usr --ssl -j 8 install

      And I'm cloning with:
      git clone https://github.com/mongodb/mongo-cxx-driver.git

      Attachments

        Activity

          People

            Unassigned Unassigned
            alexhultman Alex Hultman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: