Bug 831966 - cannot connect to mongo db via mongo shell for scalable jbosseap app
cannot connect to mongo db via mongo shell for scalable jbosseap app
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Mrunal Patel
libra bugs
: Reopened, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-14 04:14 EDT by Meng Bo
Modified: 2015-05-14 18:55 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-25 14:27:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
development log (83.55 KB, text/x-log)
2012-06-20 22:51 EDT, Meng Bo
no flags Details
mcollective log (347.46 KB, text/x-log)
2012-06-20 22:52 EDT, Meng Bo
no flags Details
mcollective-client log (229.66 KB, text/x-log)
2012-06-20 22:52 EDT, Meng Bo
no flags Details

  None (edit)
Description Meng Bo 2012-06-14 04:14:50 EDT
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
Comment 1 Mrunal Patel 2012-06-15 10:53:35 EDT
Was not able to reproduce. Could you provide mcollective/broker logs?
Comment 2 Meng Bo 2012-06-18 06:38:56 EDT
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.
Comment 3 Mrunal Patel 2012-06-19 18:36:45 EDT
It is just the DNS propagating. If you keep retrying after a few seconds, it eventually succeeds.
Comment 4 Meng Bo 2012-06-20 22:51:02 EDT
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]\>
Comment 5 Meng Bo 2012-06-20 22:51:48 EDT
Created attachment 593336 [details]
development log
Comment 6 Meng Bo 2012-06-20 22:52:24 EDT
Created attachment 593337 [details]
mcollective log
Comment 7 Meng Bo 2012-06-20 22:52:52 EDT
Created attachment 593338 [details]
mcollective-client log
Comment 8 Meng Bo 2012-06-20 22:53:47 EDT
Attached all the avaiable logs for help debug.
Comment 9 Xiaoli Tian 2012-06-21 07:51:35 EDT
Notes, if you only type mongo, the DB you connected is the mongo in the sever, not the mongo we add for the cartridge.
Comment 10 Mrunal Patel 2012-06-21 11:14:56 EDT
Nosql connection hook was missing from the spec file. Submitted
https://github.com/openshift/crankcase/pull/154 with the fix.
Comment 11 Xiaoli Tian 2012-06-23 00:19:49 EDT
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

Note You need to log in before you can comment on or make changes to this bug.