Bug 1108951 - Node 0.10 Cartridge shown as v0.6.20 node js version
Summary: Node 0.10 Cartridge shown as v0.6.20 node js version
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Paul Morie
QA Contact: libra bugs
URL:
Whiteboard:
: 1109296 1109347 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-13 00:20 UTC by rizki
Modified: 2014-07-15 10:30 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-15 10:30:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Node 0.10 Cartridge shown as v0.6.20 node js version (896.22 KB, image/png)
2014-06-13 00:20 UTC, rizki
no flags Details

Description rizki 2014-06-13 00:20:45 UTC
Created attachment 908336 [details]
Node 0.10 Cartridge shown as v0.6.20 node js version

Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.Create node js 0.10 cartridge
2.open app through ssh
3.node -v

Actual results:v0.6.20


Expected results:v0.10.25

Comment 1 Yan Du 2014-06-13 11:51:54 UTC
Test on INT(devenv_4861), issue can be reproduced.

[n10-111.int.rhcloud.com 539a65a26cec0ec127000135]\> node -v
v0.6.20
[n10-111.int.rhcloud.com 539a65a26cec0ec127000135]\> scl enable v8314 nodejs010 "node --version"
v0.10.25
[n10-111.int.rhcloud.com 539a65a26cec0ec127000135]\> env | grep PATH
MANPATH=/opt/rh/v8314/root/usr/share/man::
OPENSHIFT_NODEJS_PATH_ELEMENT=/var/lib/openshift/539a65a26cec0ec127000135//.node_modules/.bin:/usr/bin
OPENSHIFT_NODEJS_LD_LIBRARY_PATH_ELEMENT=/opt/rh/v8314/root/usr/lib64
LD_LIBRARY_PATH=/opt/rh/v8314/root/usr/lib64
PATH=/var/lib/openshift/539a65a26cec0ec127000135//.node_modules/.bin:/usr/bin:/bin:/usr/bin:/usr/sbin

Comment 2 Nick Harvey 2014-06-13 16:17:53 UTC
*** Bug 1109296 has been marked as a duplicate of this bug. ***

Comment 3 rleaf 2014-06-13 17:55:43 UTC
*** Bug 1109347 has been marked as a duplicate of this bug. ***

Comment 4 Paul Morie 2014-06-13 18:35:59 UTC
Reproduced in my devenv

Comment 5 Paul Morie 2014-06-13 19:16:58 UTC
This is happening because nodejs 0.10 is used via the SCL, and 'node' will get the system node.  I will add a wrapper function to rhcsh to ensure that you get the right version when running 'node' in an ssh session to a gear.

Comment 6 Paul Morie 2014-06-13 19:35:54 UTC
PR submitted

https://github.com/openshift/origin-server/pull/5509

Comment 7 openshift-github-bot 2014-06-13 20:22:17 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/034441a3298525fe5356d0f44ddff2e181143d12
Fix bug 1108951: add rhcsh wrapper for nodejs

Comment 8 Meng Bo 2014-06-16 05:42:30 UTC
Checked on devenv_4869, issue still exists.

[no10-bmengdev1.dev.rhcloud.com 539e92616feb463bf9000001]\> env|grep OPENSHIFT_NODEJS_VERSION
OPENSHIFT_NODEJS_VERSION=0.10
[no10-bmengdev1.dev.rhcloud.com 539e92616feb463bf9000001]\> node -v
v0.6.20

No sure if this related to rhcsh, but I think at least the OPENSHIFT_NODEJS_PATH_ELEMENT should contain the nodejs010 binary path as how other scl cartridges work.

[no10-bmengdev1.dev.rhcloud.com 539e92616feb463bf9000001]\> env|grep OPENSHIFT_NODEJS_PATH
OPENSHIFT_NODEJS_PATH_ELEMENT=/var/lib/openshift/539e92616feb463bf9000001//.node_modules/.bin:/usr/bin


example for other scl cartridge:
[php54-bmengdev1.dev.rhcloud.com 539e9a286feb46204d000002]\> env|grep PATH_ELEMENT
OPENSHIFT_PHP_PATH_ELEMENT=/var/lib/openshift/539e9a286feb46204d000002/php/phplib/pear/pear:/opt/rh/php54/root/usr/bin:/var/lib/openshift/539e9a286feb46204d000002/php/usr/bin

Comment 9 Paul Morie 2014-06-16 16:43:11 UTC
PR submitted with fix.

Comment 10 openshift-github-bot 2014-06-16 17:32:58 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/136cd0d226113e5a6fdb9c4b541a9632ae34fed3
Fix bug 1108951: fix rhcsh 'node' wrapper

Comment 11 Meng Bo 2014-06-17 02:42:57 UTC
Checked on devenv_4874, the node version shows 0.10.25 when check the node version in rhcsh.

But still get the wrong version when sending command via ssh (w/o rhcsh option added).

# rhc ssh no10 --command "node --version"
v0.6.20
# ssh 539fe0c2b9187783b2000080.rhcloud.com "node -v"
v0.6.20

# ssh 539fe0c2b9187783b2000080.rhcloud.com rhcsh "node -v"
v0.10.25

We should also make the node has correct version when sending command via ssh w/o rhcsh command added.



For eg, PHP 5.4
# ssh 539fe191b9187783b20000b9.rhcloud.com "php --version"
PHP 5.4.16 (cli) (built: Feb  4 2014 08:10:51)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

Comment 12 Paul Morie 2014-06-17 20:39:09 UTC
I see the real root cause now - there was a problem setting the PATH_ELEMENT env var for nodejs.  PR submitted: https://github.com/openshift/origin-server/pull/5522

Comment 13 openshift-github-bot 2014-06-18 00:42:26 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/b434574b707dad96d10be954711294529cd8791c
Fix bug 1108951: correct nodejs update-configuration function

Comment 14 Yan Du 2014-06-18 08:16:50 UTC
Test on devenv_4882, issue have been fixed.


[n10a-dyy.dev.rhcloud.com 53a1828f8d925f26900000cd]\> node --version
v0.10.25

Connection to n10a-dyy.dev.rhcloud.com closed.
dhcp-14-104:test duyan$ rhc ssh n10a --command "node --version"
v0.10.25

[n10a-dyy.dev.rhcloud.com 53a1828f8d925f26900000cd]\> env | grep PATH
MANPATH=/opt/rh/nodejs010/root/usr/share/man:/opt/rh/v8314/root/usr/share/man::
OPENSHIFT_NODEJS_PATH_ELEMENT=/var/lib/openshift/53a1828f8d925f26900000cd//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin
OPENSHIFT_NODEJS_LD_LIBRARY_PATH_ELEMENT=/opt/rh/nodejs010/root/usr/lib64:/opt/rh/v8314/root/usr/lib64
LD_LIBRARY_PATH=/opt/rh/nodejs010/root/usr/lib64:/opt/rh/v8314/root/usr/lib64
PATH=/var/lib/openshift/53a1828f8d925f26900000cd//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/bin:/usr/bin:/usr/sbin

Move bug to verified.


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