-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
Error: "Could not evaluate MongoDB shell: rs.slaveOk();printjson(db.getMongo().getDBs())" when auth = true #562
Comments
It's possible that this is just lack of documentation... |
This code manifests/server/config.pp#L166 actually creates a mongorc.js file if all of handle_creds, auth and store_creds are true. I tested this now and it seems to work. |
It's these two that I think needs to be tweaked:
Somewhere it should say explicitly that with auth and create_admin you need both of these true and that this will create a mongorc.js with authentication. |
As I said I don't know enough Ruby and Mongo to know for sure, but if it's the |
I'm having the same problem and it seems that puppet is trying to execute |
This happens all the time with this module and is some form of race condition. You have to turn auth off then complete a full puppet run to actually create the admin user then turn auth back on. The "localhost exception" could be used to deal with this : https://docs.mongodb.com/manual/core/security-users/#localhost-exception |
Please note this is still not fixed and the commit it issue 587 just attempts to handle the config file being in yaml. To clarify if you have auth enabled and have defined an admin user and password when you run puppet the following error occurs...
You have to disable auth and run puppet which is then able to create the admin user / db...
And then you can finally re-enable authentication. There is clearly a race condition here which needs to be handled. |
Affected versions
How to reproduce (e.g Puppet code you use)
Worth noting is that we have changed auth from false to true on an existing installation. I haven't tested a fresh installation with auth true. I have tested that the admin credentials still work after puppet run though.
After seeing https://forge.puppet.com/puppet/mongodb/readme#handle_creds I tried setting
handle_creds => false
but it didn't change anything. Do I really have to managemongorc.js
manually myself!?Problem Description
Puppet log:
NB: This is even though we have no replicas and no
mongodb_database
ormongodb::db
.It seems here https://github.com/voxpupuli/puppet-mongodb/blob/v3.0.0/lib/puppet/provider/mongodb_database/mongodb.rb#L9 is where the call is made. I don't know Ruby well but I assume
self.instances
is invoked on some automatic instantiation even though we don't explicitly use it.My guess is that #446 created this regression in combination with auth=true. It was noted by @Dharmender-Singh in the PR: #446 (comment) and I see no change in PR addressing this. But it seems weird that more people don't have this problem then...?
The text was updated successfully, but these errors were encountered: