Description of problem: ssh into application and run "mongo", the connection to mongo shell will fail if the password contains a "-" character, "-" will be taken as an option Version-Release number of selected component (if applicable): On INT,denenv_1912 How reproducible: always note: to reproduce, you may need to update mongo password and modify /var/lib/stickshift/$UUID/.env/OPENSHIFT_NOSQL_DB_PASSWORD to make it contain a "-" character Steps to Reproduce: 1.Create an application, embed mongodb 2.ssh into application env|grep OPENSHIFT_NOSQL OPENSHIFT_NOSQL_DB_USERNAME=admin OPENSHIFT_NOSQL_DB_PASSWORD=-CDDdN2LmAaR see, there is a "-" in password string 3.set -x 4.mongo Actual results: ERROR: unknown option -C MongoDB shell version: 2.0.2 usage: /usr/bin/mongo [options] [db address] [file names (ending in .js)] ........... file names: a list of files to run. files have to end in .js and will exit after unless --shell is specified Expected results: should connect to mongo shell successfully Additional info: I have to specify a password using -p option to connect to mongoDB [perl1-jhou.int.rhcloud.com ~]\> mongo -u admin -p MongoDB shell version: 2.0.2 Enter password: connecting to: 127.2.13.129:27017/admin > show dbs admin 0.03125GB local (empty) perl1 0.03125GB
There doesn't seem to be a way we can keep the mongo command from treating a password starting with "-" as a new command line option. Fixed the password generator we use to never create a password which starts with a "-". That will prevent the problem from happening under normal use. Crankcase pull request 282.
Pull request accepted.
Verified on devenv_1916 Checked pull request 282 Step: 1.ssh into devenv instance 2.Check /usr/libexec/stickshift/cartridges/abstract/info/lib/util, any password starts with a "-" will not be generated 3.Create apps, embedded mongodb rhc app create -a app1 -t php-5.3 rhc app cartridge add -a app1 -c mongodb-2.0 4.ssh into application, run command mongo Results: successfully connected to mongodb