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

mlaunch: Sharded Cluster creation fails #849

Closed
rhysmeister opened this issue Feb 28, 2022 · 3 comments
Closed

mlaunch: Sharded Cluster creation fails #849

rhysmeister opened this issue Feb 28, 2022 · 3 comments
Assignees
Milestone

Comments

@rhysmeister
Copy link

rhysmeister commented Feb 28, 2022

A previously working command to create a MongoDB sharded cluster with mlaunch started failing a few days ago.

Expected behavior

I expect the sharded cluster to be created.

Actual/current behaviour

The mlaunch command fails with the following error...

b"BadValue: security.keyFile is required when authorization is enabled with replica sets\ntry 'mongod --help' for more information\n"
can't start process, return code 2. tried to launch: "mongod" --replSet shard01 --dbpath "/home/runner/work/mmo/mmo/data/shard01/rs1/db" --logpath "/home/runner/work/mmo/mmo/data/shard01/rs1/mongod.log" --port 27018 --fork --auth --shardsvr --wiredTigerCacheSizeGB 1

Steps to reproduce the actual/current behaviour

mlaunch --replicaset --sharded shard01 shard02 shard03 --auth --username admin -***

Environment

Software Version
mtools latest
Python 3.6 & 3.8
MongoDB server 4.0, 4.2,4.4,5.0
Operating system ubuntu-latest
@blink1073
Copy link
Contributor

blink1073 commented Feb 28, 2022

Hi @rhysmeister, keyFile was removed in PyMongo 4, replaced with tlsCertificateKeyFile. We missed the --keyfile CLI option when migrating mtools for PyMongo 4 support.

@stennie stennie added bug and removed question labels Mar 1, 2022
@stennie stennie added this to the 1.7.1 milestone Mar 1, 2022
@rhysmeister
Copy link
Author

I think this may be a related one:

Run mlaunch --replicaset --auth
Traceback (most recent call last):
Generating keyfile: /home/runner/work/data/keyfile
launching: "mongod" on port 2[7](https://github.com/ansible-collections/community.mongodb/runs/5715048928?check_suite_focus=true#step:8:7)017
launching: "mongod" on port 2701[8](https://github.com/ansible-collections/community.mongodb/runs/5715048928?check_suite_focus=true#step:8:8)
launching: "mongod" on port 2701[9](https://github.com/ansible-collections/community.mongodb/runs/5715048928?check_suite_focus=true#step:8:9)
replica set 'replset' initialized.
waiting for primary to add a user.
  File "/opt/hostedtoolcache/Python/3.8.[12](https://github.com/ansible-collections/community.mongodb/runs/5715048928?check_suite_focus=true#step:8:12)/x64/bin/mlaunch", line 8, in <module>
    sys.exit(main())
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/mtools/mlaunch/mlaunch.py", line 2222, in main
    tool.run()
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/mtools/mlaunch/mlaunch.py", line 620, in run
    getattr(self, self.args['command'])()
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/mtools/mlaunch/mlaunch.py", line 826, in init
    if self._wait_for_primary():
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/mtools/mlaunch/mlaunch.py", line 19[17](https://github.com/ansible-collections/community.mongodb/runs/5715048928?check_suite_focus=true#step:8:17), in _wait_for_primary
    mrsc = self.client(hosts, replicaSet=rs_name,
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/mtools/mlaunch/mlaunch.py", line 936, in client
    return MongoConnection(host_and_port, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/mtools/mlaunch/mlaunch.py", line 60, in __init__
    Connection.__init__(self, *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pymongo/mongo_client.py", line 706, in __init__
    _check_options(seeds, opts)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pymongo/uri_parser.py", line 381, in _check_options
    raise ConfigurationError(
pymongo.errors.ConfigurationError: Cannot specify multiple hosts with directConnection=true

@stennie
Copy link
Collaborator

stennie commented Oct 3, 2022

This is fixed in the develop branch for next release of mtools.

@stennie stennie closed this as completed Oct 3, 2022
@stennie stennie added the mlaunch label Oct 3, 2022
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