Description of problem: mongo shell not work for scalable jbosseap app with mongodb embedded. Version-Release number of selected component (if applicable): cartridge-mongodb-2.0-0.21.3-1.git.0.d9f2d51.el6.noarch cartridge-jbosseap-6.0-0.1.6-1.git.19.27af983.el6.noarch How reproducible: always Steps to Reproduce: 1.create scalable jbosseap app 2.embedded mongodb to it 3.ssh login to the app 4.try mongo shell Actual results: [jeap-bmengint2.int.rhcloud.com ~]\> mongo MongoDB shell version: 2.0.2 connecting to: test Thu Jun 14 03:44:33 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:84 exception: connect failed Expected results: should connect to the mongodb without problem Additional info: this issue not exist for normal jbosseap app
Was not able to reproduce. Could you provide mcollective/broker logs?
Still can reproduce this issue on devenv_1850, sometimes, the mongo shell can connect to the instance mongodb but not the application's. Cannot get useful logs from instance.
It is just the DNS propagating. If you keep retrying after a few seconds, it eventually succeeds.
Checked this issue again on devenv_1860, issue still exist. After embed mongodb to scalable jbosseap application, ssh to the application and run mongo shell. It will connect to the instance mongodb but not the applications. [jbosseap1s-bmengdev.dev.rhcloud.com ~]\> mongo MongoDB shell version: 2.0.2 connecting to: test PRIMARY> show dbs admin (empty) local 0.0546875GB openshift_broker_dev 0.0546875GB When trying to connect to the application mongodb with specified the db dns, it can connect to it. [jbosseap1s-bmengdev.dev.rhcloud.com ~]\> mongo ef3f33e451-bmengdev.dev.rhcloud.com:35541 MongoDB shell version: 2.0.2 connecting to: ef3f33e451-bmengdev.dev.rhcloud.com:35541/test > show dbs Wed Jun 20 22:36:49 uncaught exception: listDatabases failed:{ "errmsg" : "need to login", "ok" : 0 } When trying to check the ENV vars of the application for mongodb info, get nothing about it. [jbosseap1s-bmengdev.dev.rhcloud.com ~]\> env|grep -i nosql [jbosseap1s-bmengdev.dev.rhcloud.com ~]\> [jbosseap1s-bmengdev.dev.rhcloud.com .env]\> ls JAVA_HOME OPENSHIFT_GEAR_DNS OPENSHIFT_JBOSS_CLUSTER OPENSHIFT_PROXY_PORT M2_HOME OPENSHIFT_GEAR_NAME OPENSHIFT_JBOSS_CLUSTER_PORT OPENSHIFT_REPO_DIR OPENSHIFT_APP_DNS OPENSHIFT_GEAR_TYPE OPENSHIFT_JBOSS_CLUSTER_PROXY_PORT OPENSHIFT_RUN_DIR OPENSHIFT_APP_NAME OPENSHIFT_GEAR_UUID OPENSHIFT_JBOSS_CLUSTER_REMOTING OPENSHIFT_RUNTIME_DIR OPENSHIFT_APP_UUID OPENSHIFT_HAPROXY_STATUS_IP OPENSHIFT_JBOSS_MESSAGING_PORT OPENSHIFT_TMP_DIR OPENSHIFT_DATA_DIR OPENSHIFT_HOMEDIR OPENSHIFT_JBOSS_MESSAGING_THROUGHPUT_PORT PATH OPENSHIFT_GEAR_CTL_SCRIPT OPENSHIFT_INTERNAL_IP OPENSHIFT_JBOSS_REMOTING_PORT USER_VARS OPENSHIFT_GEAR_DIR OPENSHIFT_INTERNAL_PORT OPENSHIFT_LOG_DIR [jbosseap1s-bmengdev.dev.rhcloud.com .uservars]\> ls [jbosseap1s-bmengdev.dev.rhcloud.com .uservars]\>
Created attachment 593336 [details] development log
Created attachment 593337 [details] mcollective log
Created attachment 593338 [details] mcollective-client log
Attached all the avaiable logs for help debug.
Notes, if you only type mongo, the DB you connected is the mongo in the sever, not the mongo we add for the cartridge.
Nosql connection hook was missing from the spec file. Submitted https://github.com/openshift/crankcase/pull/154 with the fix.
Verified it on stage-2.0.13 [scalejbosseap2-domainxstg1.stg.rhcloud.com ~]\> mongo MongoDB shell version: 2.0.2 connecting to: 8ff7774e60-domainxstg1.stg.rhcloud.com:42181/admin > show dbs 'admin 0.03125GB local (empty) scalejbosseap2 0.03125GB > use scalejbosseap2 switched to db scalejbosseap2