Skip to content
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

mongodb user / password not enforced #199

Open
rgarrigue opened this issue Mar 7, 2017 · 3 comments
Open

mongodb user / password not enforced #199

rgarrigue opened this issue Mar 7, 2017 · 3 comments

Comments

@rgarrigue
Copy link

Hi

I tried to use db_user and db_password parameter, which failed. In /etc/mongod.conf there's noauth=true. And I'ld expect something like thios somewhere in the module

mongodb::db { $db_database:
user => $db_username,
password => $db_password,
}

Here's my log

==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Attempting to connect to localhost:27017
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Attempting to connect to localhost:27017
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Write concern for Mongo connection: {}
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Database initialization failed: Authentication to MongoDB with username and password failed.
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Authentication to MongoDB with username and password failed.
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Traceback (most recent call last):
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:   File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 198, in main
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:     connection.initialize(max_timeout=1)
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:   File "/usr/lib/python2.7/site-packages/pulp/server/db/connection.py", line 157, in initialize
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:     raise RuntimeError(msg)
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: RuntimeError: Authentication to MongoDB with username and password failed.
==> test.vagrant.local: Error: pulp-manage-db && touch /var/lib/pulp/init.flag returned 70 instead of one of [0]
==> test.vagrant.local: Error: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: change from notrun to 0 failed: pulp-manage-db && touch /var/lib/pulp/init.flag returned 70 instead of one of [0]
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Attempting to connect to localhost:27017
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Attempting to connect to localhost:27017
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Write concern for Mongo connection: {}
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Database initialization failed: Authentication to MongoDB with username and password failed.
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Authentication to MongoDB with username and password failed.
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Traceback (most recent call last):
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:   File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 198, in main
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:     connection.initialize(max_timeout=1)
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:   File "/usr/lib/python2.7/site-packages/pulp/server/db/connection.py", line 157, in initialize
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:     raise RuntimeError(msg)
==> test.vagrant.local: Notice: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: RuntimeError: Authentication to MongoDB with username and password failed.
==> test.vagrant.local: Error: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]: Failed to call refresh: pulp-manage-db && touch /var/lib/pulp/init.flag returned 70 instead of one of [0]
==> test.vagrant.local: Error: /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]: pulp-manage-db && touch /var/lib/pulp/init.flag returned 70 instead of one of [0]

@ekohl
Copy link
Member

ekohl commented Aug 31, 2017

I looked into this but the puppetlabs-mongodb module is broken enough that I got stuck on it.

@stbenjam
Copy link
Member

stbenjam commented Aug 31, 2017

I added auth a while back and then removed it in #149, because it just doesn't work well (or at all in some cases)

@ekohl
Copy link
Member

ekohl commented Sep 1, 2017

Thank you for the background. Sounds very familiar when you read that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants