-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling MongoDB driver with --ssl or --use-sasl-client #1061
Comments
From Luca Silvestry email:
|
Dear fgalan I build fiware-orion with mongo-cxx-driver-r3.1.1 How to fix this proplem. Thanks! |
This error seems due to the compiler is looking for a required library it is not installed. Note that according to documentation you should use legacy-1.0.7 and not 3.1.1 for mongo driver dependency. |
Thanks fgalan, How to fix this proplem. |
It seem that some library is missing at linking stage, see: "try adding it to the linker command line". In this case, it is not the command line the place where it should be added, but probably in some CMakeList.txt. Sorry for not being so much precise with this feedbackk... Note that we don't build CB with the mongo driver in this special way (with SSL and so) so our building framework is not adapted to such case. However, it you solve the case modifying the CMakeList.txt files (or any other way) I would be more than happy to know how :) Please, keep posting your feedback in that case. Thanks! |
Since we (I and Hungtv31) could not build CB with mongo driver with SSL, we have set the mongodb standard authentication mechanism back to MONGO-CR. Its not perfect :(, but it's ok for us at the moment. |
i managed to compile without many issues. the point is to compile correctly the legacy mongodb library. you need to install sasl-devel libs: compile and install mongodb legacy driver: |
Im using docker to deploy Orion and mongoDB, but when i try to use auth im getting the same error described here. |
@Naff16 probably compiling the MongoDB driver using those flags will solve the issue. It should be a matter of adjusting the scons invokation at this point in the Dockerfile: https://github.com/telefonicaid/fiware-orion/blob/master/docker/Dockerfile#L43 However, note is not the official way of using Orion Context Broker, so you could find some uknown problem. I'd recommend you to test the new setup in deep before using in productive environments. |
Documentation explaining how to compile the driver that way is added in PR #3053 We don't know the impact of such compilation from a performance point of view, so we It would be great to have feedback from other participants in this disussiong (@hungtv31 @vuasutu @chicco785 @Naff16 ). Thanks! |
I suppose you meant "we are NOT including it", correct? |
Correct! Sorry for the typo... |
After leaving some time (12 days) to get comments with no feedback received, I'm closing the issue. |
From Luca Silvestry report by email:
Starting from V.3, MongDB has implemented a new security mechanism for user authentication, called SCRAM_SHA1 (http://docs.mongodb.org/manual/core/authentication/#authentication-scram-sha-1)
This improvement has changed the old MONGODB-CR Authentication and is not retro compatible. As a consequence, users created under MongoDB version 3 or higher are forced to the new SCRAM standard, and this requires mongo driver update.
http://docs.mongodb.org/manual/release-notes/3.0-compatibility/#compatibility-driver-versions
Luckily, checking into Orion Github repository, the C++ dirver used is compatible with the new mongo release, but it requires some switches at build time.
Check the following bash history to see what switches are required; it's an output of CB running from command line:
sudo contextBroker -db orion -dbhost x.x.x.x:27017 -dbuser user -dbpwd password
$ INFO@13:46:43 contextBroker.cpp[1411]: Orion Context Broker is running
$ INFO@13:46:43 mongoConnectionPool.cpp[184]: Successful connection to database
$ terminate called after throwing an instance of 'mongo::UserException' what(): SCRAM-SHA-1 mechanism support not compiled into client library. (Some mechanisms require the driver be compiled with the flags --ssl or --use-sasl-client)
This issue is about compiling the driver in that way and evalute that have some impact in the performance. In positive case, that flags could be part of the official build.
(This is "nice2have" while official MongoDB version for Orion stills being 2.6)
Effort: 2 man day
The text was updated successfully, but these errors were encountered: