mongolab / mongoctl

Manage MongoDB servers and replica sets using JSON configurations!
MIT License
178 stars 25 forks source link

configure-cluster command is prompting for local and admin password even though server is configured without password #3

Closed rpidikiti closed 11 years ago

rpidikiti commented 11 years ago

When we run configure cluster option, utility is prompting for local and admin password even though server is configured without password. But cluster seems to configure right. It only happens first time, re-running the same command for reconfiguring the cluster works fine, i.e. passwords are not prompted.

mongoctl --config-root /mnt/mongodb/mongoctl configure-cluster mongodb-insights

Validating cluster 'mongodb-insights'... Initializing replica set cluster 'mongodb-insights' ... Determining which server should be primary... Selected server 'xxxxxxxx' as primary. Executing db command { "replSetInitiate": { "_id": "mongodb-insights", "members": [ { "host": "", "_id": 0 } ] } } WARNING: Command { "replSetInitiate": { "_id": "mongodb-insights", "members": [ { "host": "", "_id": 0 } ] } } is taking a while to complete. This is not necessarily bad. Will now wait for the replica set to initialize. Enter username for database 'local': Enter password for user 'local\' Password: ERROR: Invalid login! Enter username for database 'local': Enter password for user 'local\' Password: ERROR: Invalid login! Enter username for database 'local': Enter password for user 'local\' Password: ERROR: Invalid login! Enter username for database 'admin': Enter password for user 'admin\' Password: ERROR: Invalid login! Enter username for database 'admin': Enter password for user 'admin\' Password: ERROR: Invalid login! Enter username for database 'admin': Enter password for user 'admin\' Password: ERROR: Invalid login! ERROR: Unable to initialize replica set cluster 'mongodb-insights'. Cause: Failed to authenticate to admin db

Re-running same command works fine

mongoctl --config-root /mnt/mongodb/mongoctl configure-cluster mongodb-insights

Validating cluster 'mongodb-insights'... Re-configuring replica set cluster 'mongodb-insights'... Current replica set configuration: { "_id": "mongodb-insights", "version": 3, "members": [ { "host": "", "_id": 0 } ] } Executing the following command on server 'xxxxxxx': { "replSetReconfig": { "_id": "mongodb-insights", "version": 4, "members": [ { "host": "", "_id": 0 } ] }, "force": false } Re-configuration for replica set cluster 'mongodb-insights' ran successfully! New replica set configuration: { "_id": "mongodb-insights", "version": 4, "members": [ { "host": "", "_id": 0 } ] }

abdulito commented 11 years ago

Hi,

I am looking into this now. Which mongo version are you using? If I understad correctly, you have no "auth" or "replKey" set in your server's cmdOptions. Right?

rpidikiti commented 11 years ago

Mongo version is 2.0.2 and we also tried in 2.2.0

and my cmdOptions are

"cmdOptions":{"port":27017,"dbpath":"/mnt2/mongodb/mongodb-insights","directoryperdb":true}

abdulito commented 11 years ago

Hello again,

I was able to reproduce the issue you were having just a committed a fix. I should be pushing a new release to Pypi soon. I'll keep you posted about that. Thanks for reporting this!!!!

Do you guys install mongoctl from Pypi? Meaning that do you install mongoctl using something the following command

# sudo pip install mongoctl

Or do you clone/install from github?

-abdul

fehguy commented 11 years ago

@abdulito just confirmed it was working with 3.1--we'll try the latest from pypi and report back

rpidikiti commented 11 years ago

Abdul,

Yes, we install using pip install mongoctl

abdulito commented 11 years ago

Thanks tony. I didn't push a new release to pypi yet but will let you know as soon as i do. Should be within this week hopefully

Cheers!

-abdul

On Wed, Oct 31, 2012 at 2:55 PM, Tony Tam notifications@github.com wrote:

@abdulito https://github.com/abdulito just confirmed it was working with 3.1--we'll try the latest from pypi and report back

— Reply to this email directly or view it on GitHubhttps://github.com/mongolab/mongoctl/issues/3#issuecomment-9963592.

abdulito commented 11 years ago

Hey guys. Just pushed the fix into a new release 0.3.4 to Pypi. Please upgrade and let me know if everything works well.

Thanks!

-abdul

fehguy commented 11 years ago

Tested! works now, please close the issue.

abdulito commented 11 years ago

Thanks Tony!

Closing... -abdul