-
Notifications
You must be signed in to change notification settings - Fork 619
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
BadValue: need to enable SSL via the sslMode flag when using SSL configuration parameters #172
Comments
Thanks for the swift response tianon; appreciate it!
|
Nice, so that was successful for you? |
yes, i've got it working now:
|
i ran into this same issue both with version 3.4.3 and 3.4.4. |
@sdanieru possibly -- we're debating whether it's worth trying to parse the YAML configuration, but it's a complicated proposition to do so. The code currently only checks whether you've specified mongo/3.4/docker-entrypoint.sh Line 139 in ce12e5e
--sslMode so that one could simply specify --sslMode on the command line to inform the initdb code that SSL is necessary.
|
@tianon, then we have to check the value of On the other hand, you can't set |
I have currently derived a docker container which takes some CLI and initializes the It works fine till I enable SSL. The error I get is:
And when I specify all the parameters on the CLI, the sslMode gets set to allowSSL rather than requireSSL. I went through the docker-entrypoint.sh script but I cannot understand why has it been hacked in the first place! Am I missing something obvious here? |
@krish7919 it's for the new initdb behavior -- the MongoDB configuration file is a bit complex to parse via Bash (it's YAML, and doesn't match the CLI flags 1-to-1), but we need to start The |
@tianon : So correct me if I am wrong: If I start mongod with the default entrypoint script with a MONGO_INITDB_ROOT_USERNAME and a MONGO_INITDB_ROOT_PASSWORD, it would create a default admin user for further access? And once I log in to the mongo shell using this, I can create other users and roles? |
Hi Folks,
I'm attempting to spin up a mongo container w/ ssl from the stock 3.4 image with something like this:
docker run -d --name dev-hrs-db -v /home/core/repos/mongodb/conf/dev-hrs-db.conf:/etc/mongod.conf -v /data/dev-hrs-db:/data -v /home/core/certs:/certs -p 27033:27033 mongo:3.4 mongod -f /etc/mongod.conf
mongod fails with this error:
BadValue: need to enable SSL via the sslMode flag when using SSL configuration parameters try 'mongod --help' for more information
Which is strange since all the ssl directives are in the conf file. When I add all the ssl directives directly on the command line, mongod gets a little further but then fails with the following error:
2017-04-25T21:25:36.135+0000 I STORAGE [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data, terminating
Also, if I just launch the container w/
-it
and then manually startmongod -f /etc/mongod.conf
in the container, it works just fine, which tells me the conf file is legit and accessible from within the container, and the /data mount is ok as well.For the life of me I cannot figure out why this is happening; I have a vague suspicion that it might be an issue with permissions on the filesystem in the image relating to the -v mounts, but I really have no idea. It's also worth noting that I've had success previously with this setup, so I'm wondering if something changed in the image?
Any help is welcome!
The text was updated successfully, but these errors were encountered: