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

Error while creating replica set with name and auth args #476

Closed
KozlovAV opened this issue Jan 12, 2017 · 3 comments
Closed

Error while creating replica set with name and auth args #476

KozlovAV opened this issue Jan 12, 2017 · 3 comments
Milestone

Comments

@KozlovAV
Copy link

mlaunch init --replicaset --nodes 3 --name RS1 --hostname localhost --auth

will result in

replica set 'RS1' initialized.
waiting for primary to add a user.
Traceback (most recent call last):
  File "/usr/local/bin/mlaunch", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/mtools/mlaunch/mlaunch.py", line 1443, in main
    tool.run()
  File "/usr/local/lib/python2.7/site-packages/mtools/mlaunch/mlaunch.py", line 260, in run
    getattr(self, self.args['command'])()
  File "/usr/local/lib/python2.7/site-packages/mtools/mlaunch/mlaunch.py", line 414, in init
    if self._wait_for_primary():
  File "/usr/local/lib/python2.7/site-packages/mtools/mlaunch/mlaunch.py", line 1228, in _wait_for_primary
    hosts = [x['host'] for x in self.config_docs['replset']['members']]
KeyError: 'replset'

The problem in hardcoded replica set name ('replset') in line 1228

hosts = [x['host'] for x in self.config_docs['replset']['members']]
rs_name = self.config_docs['replset']['_id']

Maybe self.args['name'] should be OK

@stennie
Copy link
Collaborator

stennie commented Jan 12, 2017

@KozlovAV Thanks for the bug report! Can you confirm which version of mtools you are using?

@KozlovAV
Copy link
Author

mlaunch --version
mtools version 1.2.3

@Bastian82
Copy link

I can reproduce this issue aswell:
mtools version 1.3.1

Bastian82 pushed a commit to Bastian82/mtools that referenced this issue Oct 27, 2017
…uth args

   * index value for config_docs is now taken from args
   * Add simple test for --name parameter
@stennie stennie added this to the 1.3.3 milestone Oct 27, 2017
stennie added a commit that referenced this issue Oct 27, 2017
Fix #476: Error while creating replica set with name and auth args
stephentunney pushed a commit to stephentunney/mtools that referenced this issue Nov 22, 2017
…uth args

   * index value for config_docs is now taken from args
   * Add simple test for --name parameter
stephentunney pushed a commit to stephentunney/mtools that referenced this issue Nov 22, 2017
…uth args

   * index value for config_docs is now taken from args
   * Add simple test for --name parameter
stephentunney pushed a commit to stephentunney/mtools that referenced this issue Dec 13, 2017
…uth args

   * index value for config_docs is now taken from args
   * Add simple test for --name parameter
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

4 participants