charts icon indicating copy to clipboard operation
charts copied to clipboard

MongoDB probes always answers OK when url connection contains true value

Open Mc-Mido opened this issue 1 year ago • 1 comments

Name and Version

bitnami/mongodb master

What steps will reproduce the bug?

  1. enable TLS (for example)
  2. have a replica set configuration error
  3. probs doesn't detect that RS is KO

What is the expected behavior?

Probes should detect that there is a problem with the RS.

What do you see instead?

All probes are OK.

Additional information

mongosh  $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.isMaster().ismaster || db.isMaster().secondary' | grep "true"
Connecting to:          mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&tls=true&tlsCertificateKeyFile=%2Fcerts%2Fmongodb.pem&tlsCAFile=%2Fcerts%2Fmongodb-ca-cert&appName=mongosh+1.5.1

If you make a not silent grep you can see that the URL match due to some 'true' values in parameters.

Maybe something like that should be enough to fix that:

mongosh  $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.isMaster().ismaster || db.isMaster().secondary' | grep -v "Connecting to" | grep -q "true"

Mc-Mido avatar Aug 05 '22 09:08 Mc-Mido

Thanks for reporting this issue. Would you like to contribute by creating a PR to solve the issue? The Bitnami team will be happy to review it and provide feedback. Here you can find the contributing guidelines.

carrodher avatar Aug 08 '22 11:08 carrodher

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

bitnami-bot avatar Aug 24 '22 01:08 bitnami-bot

Thanks for reporting this issue. Would you like to contribute by creating a PR to solve the issue? The Bitnami team will be happy to review it and provide feedback. Here you can find the contributing guidelines.

Ok I'll try to create a PR this week.

Mc-Mido avatar Aug 24 '22 06:08 Mc-Mido

Thanks for the PR, the team will review it and provide feedback

carrodher avatar Aug 24 '22 09:08 carrodher