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

fixes #15058 - enable mongo auth #126

Merged
merged 1 commit into from
May 17, 2016
Merged

Conversation

stbenjam
Copy link
Member

@stbenjam stbenjam commented May 16, 2016

Companion PR's:

Test box:

mongoauth:
    box: centos7-katello-nightly
    options: --module-prs katello/126,pulp/146,capsule/84

@stbenjam stbenjam force-pushed the 15058 branch 2 times, most recently from 5825192 to 50a2ef5 Compare May 16, 2016 14:54
@ekohl
Copy link
Member

ekohl commented May 17, 2016

ACK

@@ -46,6 +46,10 @@
#
# $repo_export_dir:: Directory to create for repository exports
#
# $pulp_db_username:: Username for mongo
#
# $pulp_db_password:: Password for mongo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't doing this kind of exposure for the Candlepin database, maybe we should. Also, if you change this to just database we won't have to update it when Pulp switches off mongo.

@stbenjam
Copy link
Member Author

@ehelms Renamed mongo to database in the docs

@stbenjam
Copy link
Member Author

On the other PR's, too

@ekohl
Copy link
Member

ekohl commented May 17, 2016

ACK

@stbenjam stbenjam merged commit a9d4344 into theforeman:master May 17, 2016
@stbenjam stbenjam deleted the 15058 branch May 17, 2016 15:04
@beav
Copy link
Contributor

beav commented May 17, 2016

I don't think this works on el6, there is a new el6 bats failure:


Could not prefetch mongodb_user provider 'mongodb': Execution of '/usr/bin/mongo admin --quiet --host 127.0.0.1:27017 --eval printjson(db.isMaster())' returned 1: Tue May 17 17:55:26.480 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:147

additionally,


  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Attempting to connect to localhost:27017
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Write concern for Mongo connection: {}
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Database initialization failed: Authentication to MongoDB with username and password failed.
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Authentication to MongoDB with username and password failed.
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: Traceback (most recent call last):
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:   File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 192, in main
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:     connection.initialize(max_timeout=1)
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:   File "/usr/lib/python2.6/site-packages/pulp/server/db/connection.py", line 157, in initialize
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns:     raise RuntimeError(msg)
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: RuntimeError: Authentication to MongoDB with username and password failed.
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]: Failed to call refresh: pulp-manage-db returned 70 instead of one of [0]
  /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]: pulp-manage-db returned 70 instead of one of [0]

@akofink
Copy link

akofink commented May 29, 2016

I'm not sure this is related, but...

This fails on CentOS7 (centos7-devel box):

/usr/bin/mongo admin --quiet --host 127.0.0.1:27017 --eval printjson(db.isMaster())

This works, however (with quotes):

/usr/bin/mongo admin --quiet --host 127.0.0.1:27017 --eval 'printjson(db.isMaster())'

I'm just executing these commands on the centos7-devel box after running vagrant up, which is currently failing at these pulp_db setup commands.

@stbenjam
Copy link
Member Author

stbenjam commented May 30, 2016

The quotes would probably be removed when it shows you the command but they should be there when puppet's actually executing it. I think. It's quirky.

I've seen this error intermittently, and @beav saw some other Mongo-related issues. I wonder if we just end up turning this back off all together. It only works on one OS, and apparently not very well.

Mongo is going away eventually anyway.

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

Successfully merging this pull request may close these issues.

None yet

5 participants