Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Mongo DB connection is not working with LDAP creds

Parasofttoudaya
Parasofttoudaya Posts: 232 ✭✭

Hi Team,

We migrated to LDAP creds to connect mongo, After the migration mongo connection is getting failure. is there anything known issue in connecting mongo with LDAPcreds?

Regards
Udaya

Comments

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    Anyone faced this issue? any solutions from parasoft team?

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited December 2017

    From client perspective, there are various way to authenticate. By default, the MongoDB java client will negotiate SCRAM-SHA-1 or MONGODB_CR authentication mechanism, depending on the version of the MongoDB server. Typically this will be SCRAM-SHA-1 unless MongoDB server is old.

    The MongoDB java client does support other authentication methods including x.509, Kerberos, and LDAP as detailed here. However, the "MongoDB Query Tool" only supports the default ones I mentioned (SCRAM-SHA-1 and MONGODB_CR).

  • @benken_parasoft can you point a documentation for this plugin? I am also struggling with this problem and I cannot find any documentation. I don't know what is supported and what is not.

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    It has been added as feature request and the ticket number is SOA-9147.
    And i see this is best tool to perform Automation with the experience of market tools. You might not know the features provided..

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited December 2017

    I am also struggling with this problem

    I hope my previous answer makes sense. As mentioned, the "MongoDB Query Tool" only supports the default authentication mechanism (SCRAM-SHA-1) as described in MongoDB docs. The "MongoDB Query Tool" does not support the other possible authentication methods (x.509, Kerberos, and LDAP).

    I cannot find any documentation

    I'm happy to help with other questions. Downloads from the Parasoft Marketplace, including the "MongoDB Query Tool" include detailed documentation in pdf format. Additionally, many of them are starting to have their documentation available online.

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited January 2018

    The feature has been added. :)
    Please try out the updated MongoDB Query Tool from the Parasoft Marketplace.
    New online docs have also also been added.

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    Thanks for sharing Ben :smile:

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭
    edited February 2018

    Ben,

    We are facing an issue, Existing MongoQueryTool were not working by using this jar.

    We have multiple teams configured in the same CTP server and all the teams were not ready to take this change.

    Any suggestions??

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭

    Existing MongoQueryTool were not working by using this jar

    Tools saved with the older jar should open and behave as before. In particular, if you had a tool with username and/or password specified then the tool should now have "server-defined" in the new Authentication Mechanism field. In other words, tools using the SCRAM-SHA-1 mechanism will work as before.

    If you have old tests that now need to work with LDAP then they won't just work. You have to update the tests, putting LDAP in the new Authentication Mechanism field. In other words, make sure you aren't trying to run old tests against LDAP. You have to go back and update those tests to use LDAP.

    Any suggestions??

    You will need to provide detail about what isn't working so I can help you here on the forum. Otherwise, you can try reaching out to Parasoft Support for assistance.

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    Hi @benken_parasoft

    New version of MongoQuery DB tool always expect the connection to be primary.
    isn't it?

    Error:
    Caused by: com.mongodb.MongoNotPrimaryException: The server is not the primary and did not execute the operation

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    Any Updates on this?

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited April 2018

    Caused by: com.mongodb.MongoNotPrimaryException: The server is not the primary and did not execute the operation

    Can you provide the full error detail (stack trace)? Offhand, I'm not sure this is related to authentication or even LDAP. In case this helps, you can also try searching for detail about this particular error message online, since this is a MongoDB client error and not specifically a Parasoft error message.

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    If this is something from MongoDB client error, we(Parasoft) must be able to parameter the uri rather than one host.

    where as uri contains all cluster host.

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭

    If this is something from MongoDB client error, we(Parasoft) must be able to parameter the uri rather than one host.

    To clarify, there are a lot of errors that can be thrown by the MongoDB client library. In many cases, the MongoDB Query Tool simply reports them. Concerning MongoNotPrimaryException, I don't have the full context here and so it is difficult to comment without the full error detail.

    where as uri contains all cluster host.

    Are you asking about how to Connect to a Replica Set? The MongoDB Query tool only lets you configure a single host and port, and not a URI where you can specify these options. Perhaps you can contact Parasoft and make another request.

    As mentioned, I think this is unrelated to LDAP authentication. If this helps, it also looks like @jakubiak previously commented on replica sets in this other thread: https://forums.parasoft.com/discussion/3485/mongodb-connection-failure-replica-set#latest

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    MongoNotPrimaryException, I am sure its relates to primary and secondary host. Because when i send the other host its working fine.

    Thanks, I am looking for something like @jakubiak mentioned. Lets us see what can be done for this.

    Thanks again for immediate response.