Bug 856487 - Can't connect to mongodb-2.0 for ruby1.9 app successfully on stage
Can't connect to mongodb-2.0 for ruby1.9 app successfully on stage
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Adam Miller
libra bugs
: Regression, Reopened
: 856956 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-12 02:53 EDT by Wei Sun
Modified: 2015-05-14 18:59 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-06 13:48:24 EST
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 (24.05 KB, text/plain)
2012-09-12 02:53 EDT, Wei Sun
no flags Details

  None (edit)
Description Wei Sun 2012-09-12 02:53:49 EDT
Created attachment 612001 [details]
development.log

Description of problem:
Can't embed mongodb for non-scalable ruby1.9 app

Version-Release number of selected component (if applicable)
devenv_2156
rhc 0.98.14

How reproducible:
always

Steps to Reproduce:
1.create ruby1,9 app
rhc app create -a rack9test -t ruby-1.9 
2.embed mongodb-2.0
rhc app cartridge add -a rack9test -c mongodb-2.0
3.
  
Actual results:
Can't embed mongodb

[sunwei@dhcp-8-229 int]$ rhc app cartridge add -a rack9test -c mongodb-2.0
Password: ******

Problem reported from server. Response code was 500.
Re-run with -d for more information.

RESULT:
Node execution failure (invalid exit code from node).  If the problem persists please contact Red Hat support.


Expected results:
can embed mongodb

Additional info:

can embed mongodb for scalable app ,and can embed mongodb for other cartridge
Comment 1 Wei Sun 2012-09-12 03:33:58 EDT
scalabe ruby1.9 app can embed mongodb successfully,but can't use it

step:
1.create a scalable ruby-1.9 app
2.embed mongodb-2.0 for it
[wsun@localhost dev]$ rhc app cartridge add -a rack9scaletest -c mongodb-2.0
Password: 


RESULT:

MongoDB 2.0 database added.  Please make note of these credentials:

       Root User: admin
   Root Password: cf-RtCkhuckQ
   Database Name: rack9scaletest

Connection URL: mongodb://60f9dfe0e1-wsundev912.dev.rhcloud.com:35556/
MongoDB gear-local connection URL: mongodb://127.0.252.129:35556/

3.ssh 
4.mongo
[rack9scaletest-wsundev912.dev.rhcloud.com ~]\> mongo
/usr/bin/mongo: symbol lookup error: /usr/bin/mongo: undefined symbol: js_DateClass
Comment 2 Mengjiao Gao 2012-09-12 03:58:21 EDT
The same issue exits in the website , both the ruby 1.9 and rubyonrails app cannot  embed mongodb in the website.
Comment 3 Paul Morie 2012-09-12 13:47:49 EDT
The problem here appears to be that ruby-1.9's configure script creates an entry for LD_LIBRARY_PATH in the .env directory.  This is sourced by the mongodb control script and disrupts mongodb by causing the wrong libjs to be loaded.
Comment 4 John Poelstra 2012-09-12 14:02:46 EDT
Paul and Dan working on this and have identified root cause
Comment 5 Ram Ranganathan 2012-09-12 16:39:39 EDT
Temporary fix for mongo with pull request:
  https://github.com/openshift/crankcase/pull/478

Waiting on merge. 

Longer term need a way to address sclized versions.
Comment 6 Wei Sun 2012-09-13 02:00:48 EDT
on devenv_2172 ,can add mongodb-2.0 for ruby 1.9 app,but could not connection mongo

info:
[rack9test-wsundev1913.dev.rhcloud.com ~]\> mongo
/usr/bin/mongo: symbol lookup error: /usr/bin/mongo: undefined symbol: js_DateClass

1.create ruby 1.9 app
2.add mongodb
[sunwei@dhcp-8-229 dev]$ rhc app cartridge add -a rack9test -c mongodb-2.0 
Password: 


RESULT:

MongoDB 2.0 database added.  Please make note of these credentials:

       Root User: admin
   Root Password: xSChdRyH2e_V
   Database Name: rack9test

Connection URL: mongodb://127.0.250.129:27017/

You can manage your new MongoDB by also embedding rockmongo-1.1

3.ssh app
mongo
[rack9test-wsundev1913.dev.rhcloud.com ~]\> mongo
/usr/bin/mongo: symbol lookup error: /usr/bin/mongo: undefined symbol: js_DateClass
Comment 7 Rony Gong 2012-09-13 04:56:04 EDT
*** Bug 856956 has been marked as a duplicate of this bug. ***
Comment 8 Ram Ranganathan 2012-09-13 13:05:08 EDT
Workaround: is to unset LD_LIBRARY_PATH on rhcsh. The issue is the new version of mongo uses libjs.so which is getting pulled from the ruby193 scl. 

I'll fix the mongo function in rhcsh. But you can still hit this if you run /usr/bin/mongo -- the fix for that would be a longer term solution to address sclized versions and provide a mechanism to run the binaries therein.
Comment 9 Ram Ranganathan 2012-09-13 13:17:49 EDT
Waiting on pull request: 
    https://github.com/openshift/li/pull/367

Please note that the workaround above as it is required if accessing other mongo utilities. The issue is the ruby193 scl is needed for running irb/ruby -- users of a ruby-1.9 app would expect an equivalent functionality (ruby version) matching the app.
Comment 10 Wei Sun 2012-09-13 22:32:48 EDT
verified on devenv_2176

step:
1.create a ruby1.9 app
2. add mongodb-2.0 for app
3.ssh app
4. mongo

result:

[rack9test-wsundev914.dev.rhcloud.com ~]\> mongo
MongoDB shell version: 2.0.7
connecting to: 127.0.250.129:27017/admin
>


[rack9scaletest-wsundev914.dev.rhcloud.com ~]\> mongo
MongoDB shell version: 2.0.7
connecting to: 268ce17e05-wsundev914.dev.rhcloud.com:35536/admin
>
Comment 11 Wei Sun 2012-09-14 03:46:51 EDT
But it doesn't work on stg(devenv-stage_235)

[rack9test-wsunstg914.stg.rhcloud.com ~]\> mongo
/usr/bin/mongo: symbol lookup error: /usr/bin/mongo: undefined symbol: js_DateClass
Comment 12 Wei Sun 2012-09-14 03:59:33 EDT
It doesn't work on devenv-stage_236

[rack9test-wsundevs914.dev.rhcloud.com ~]\> mongo
/usr/bin/mongo: symbol lookup error: /usr/bin/mongo: undefined symbol: js_DateClass
Comment 13 Wei Sun 2012-09-17 01:17:05 EDT
It doesn't work on stage(devenv-stage_237)

[rack9test-wsunstg914.stg.rhcloud.com ~]\> mongo
/usr/bin/mongo: symbol lookup error: /usr/bin/mongo: undefined symbol: js_DateClass
Comment 14 Wei Sun 2012-09-17 02:14:47 EDT
It still doesn't work on stage(devenv-stage_237),so I re-open this bug.

step:
1. for non-scaling ruby1.9 app

Result:

[rack9test-wsunstg917.stg.rhcloud.com ~]\> mongo
/usr/bin/mongo: symbol lookup error: /usr/bin/mongo: undefined symbol: js_DateClass

info:

Application Info
================
rack9test
    Framework: ruby-1.9
     Creation: 2012-09-17T01:50:37-04:00
         UUID: 4d3b1db7af0f42699b337f60fa9478e8
      Git URL: ssh://4d3b1db7af0f42699b337f60fa9478e8@rack9test-wsunstg917.stg.rhcloud.com/~/git/rack9test.git/
   Public URL: http://rack9test-wsunstg917.stg.rhcloud.com/

 Embedded: 
      mongodb-2.0 - Connection URL: mongodb://127.6.95.129:27017/

2.for scaling ruby1.9 app

Result:
[rack9scaletest-wsundevstg917.dev.rhcloud.com ~]\> mongo
/usr/bin/mongo: symbol lookup error: /usr/bin/mongo: undefined symbol: js_DateClass

info:
Application Info
================
rack9scaletest
    Framework: ruby-1.9
     Creation: 2012-09-17T02:07:00-04:00
         UUID: 44fc14e402914dada18616ce95d66949
      Git URL: ssh://44fc14e402914dada18616ce95d66949@rack9scaletest-wsundevstg917.dev.rhcloud.com/~/git/rack9scaletest.git/
   Public URL: http://rack9scaletest-wsundevstg917.dev.rhcloud.com/

 Embedded: 
      haproxy-1.4
      mongodb-2.0 - Connection URL: mongodb://06636e3d6d-wsundevstg917.dev.rhcloud.com:35616/
Comment 15 Ram Ranganathan 2012-09-17 13:56:32 EDT
As mentioned, there's a workaround for stage. And it doesn't address all cases -- see comment #9.

I created a pull request for stage -- https://github.com/openshift/li/pull/378

Spoke to admiller and he will merge it if it is really needed. Assigning to admiller.
Adam, please close/assign to QA as we deem neccessary.  
Thanks.
Comment 16 Chandrika Gole 2012-09-17 15:38:51 EDT
tested this with the workaround on devenv-stage_237

refer comment 9 for full fix for this bug.


1. Create ruby 1.9 app
2. embed mongo
3. log in to the apps gear and 'unset LD_LIBRARY_PATH'
[rb-cgoledfvv.dev.rhcloud.com ~]\> mongo
MongoDB shell version: 2.0.7
connecting to: 127.0.250.129:27017/admin
Comment 17 Adam Miller 2012-09-17 19:20:23 EDT
After discussions it was decided Ram's patch was the most logical course of action right now. Patch was merged, package was built. 

Package rhc-node-0.98.7-1.el6_3 should be available via devenv-stage_238
Comment 18 Adam Miller 2012-09-17 20:09:34 EDT
Correction, it would appear there was a race condition in the build for 238 that caused apache to not start and that caused the validation to fail, which failed the ami build. This will be available in devenv-stage_239
Comment 19 Wei Sun 2012-09-17 22:24:49 EDT
verified on devenv-stage_239

step:
1.create ruby1.9 app
2.add mongodb-2.0
3.log in to the apps gear

Result:
1.for non-scaling app
[rack9test-wsundevstg918.dev.rhcloud.com ~]\> mongo
MongoDB shell version: 2.0.7
connecting to: 127.0.250.129:27017/admin
> 

2.for scaling app
[rack9scaletest-wsundevstg918.dev.rhcloud.com ~]\> mongo
MongoDB shell version: 2.0.7
connecting to: 98a8ac89ff-wsundevstg918.dev.rhcloud.com:35551/admin
>
Comment 20 Wei Sun 2012-09-17 23:36:31 EDT
verified on stage(devenv-stage_239)

Result:

1.non-scaling app
[ruby9-bmengstg918.stg.rhcloud.com ~]\> mongo
MongoDB shell version: 2.0.7
connecting to: 127.8.165.1:27017/admin
> 

2.scaling app
[ruby9s-bmengstg918.stg.rhcloud.com ~]\> mongo
MongoDB shell version: 2.0.7
connecting to: 1c1a2098c1-bmengstg918.stg.rhcloud.com:50441/admin
>

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