Bug 1170789 - Nodejs gears can potentially be misconfigured to work with the v8 SCL.
Summary: Nodejs gears can potentially be misconfigured to work with the v8 SCL.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Brenton Leanhardt
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-04 21:12 UTC by Brenton Leanhardt
Modified: 2015-01-08 15:34 UTC (History)
6 users (show)

Fixed In Version: openshift-origin-cartridge-nodejs-1.30.3.1-1
Doc Type: Bug Fix
Doc Text:
Cause: NodeJS was not configured properly on all possible cartridge upgrade paths. Consequence: Environments skipping intermediate updates may not have a properly configured NodeJS deployment. Fix: All upgrade paths configure NodeJS properly. Result: Upgrades now ensure properly configured NodeJS deployments.
Clone Of:
Environment:
Last Closed: 2015-01-08 15:34:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0019 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.3 bug fix and enhancement update 2015-01-08 20:33:24 UTC

Description Brenton Leanhardt 2014-12-04 21:12:29 UTC
Description of problem:

While performing merge from upstream sprint 58 I noticed that in OSE 2.1 the nodejs cartridge upgrade script contained the following code:

From 2.1 GA's openshift-origin-cartridge-nodejs-1.24.3.3-1.el6op:

if version_lt $old_cart_version $OSE_21_GA; then
  if [ -f ${OPENSHIFT_NODEJS_DIR}env/LD_LIBRARY_PATH ]; then
    rm -f ${OPENSHIFT_NODEJS_DIR}env/LD_LIBRARY_PATH
  fi
  update-configuration $nodejs_version
fi

From 2.1.z's openshift-origin-cartridge-nodejs-1.24.3.7-1.el6op:

if [[ $new_cart_version == "0.0.17.3" ]]; then
  update-configuration $nodejs_version
fi

Ultimately the problem that was trying to be addressed in openshift-origin-cartridge-nodejs-1.24.3.7-1.el6op is the addition of the v8 SCL dependency for the nodejs cartridge.  However, admins in OSE can upgrade from version 0.0.17 of the cartridge directly to a version older than 0.0.17.3.  This would mean the if statement in 2.1.z's nodejs cartridge would never run.

However, it's more complicated than that.  If they we're upgrading from 2.0.z to 2.1 update-configuration would run and fix both problem at the same time.  This bug may never have actually been encountered in the wild for OSE customers.  In reality they may have deleted their gears when they hit this problem and and after recreating them the problem would go away.  However, I would like to fix any potentially broken gears and ensure that this runs for any gears that upgrade to the latest nodejs cartridge.

Comment 1 Brenton Leanhardt 2014-12-04 21:15:57 UTC
The easiest way to test this would be manually break a nodejs gear by editing $OPENSHIFT_NODEJS_DIR/env/OPENSHIFT_NODEJS_PATH_ELEMENT $OPENSHIFT_NODEJS_DIR/env/OPENSHIFT_NODEJS_LD_LIBRARY_PATH_ELEMENT.  Essentially you want to verify that this block of code is run when the cartridge upgrade is performed:

https://github.com/openshift/origin-server/blob/master/cartridges/openshift-origin-cartridge-nodejs/lib/util#L21

Comment 4 Ma xiaoqiang 2014-12-09 08:50:01 UTC
Check on puddle [2.2.z/2014-12-08.2]

1. install the env for ose-2.1
2. create apps 
#rhc app create nodejs nodejs
3. modify the env on nodejs
[nodejs-xiaom.ose-21.com.cn 5486988687692b817500003a]\> env|grep PATH
MANPATH=/opt/rh/nodejs010/root/usr/share/man
OPENSHIFT_NODEJS_PATH_ELEMENT=/opt/rh/nodejs010/root/usr/bin
OPENSHIFT_NODEJS_LD_LIBRARY_PATH_ELEMENT=/opt/rh/nodejs010/root/usr/lib64
LD_LIBRARY_PATH=/opt/rh/nodejs010/root/usr/lib64
OPENSHIFT_HAPROXY_PATH_ELEMENT=/var/lib/openshift/5486988687692b817500003a/haproxy/usr/bin
PATH=/opt/rh/nodejs010/root/usr/bin:/var/lib/openshift/5486988687692b817500003a/haproxy/usr/bin:/bin:/usr/bin:/usr/sbin
4. Upgrade the env
5. Check the env in nodejs
[nodejs-xiaom.ose-21.com.cn 5486988687692b817500003a]\> 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/5486988687692b817500003a/app-root/runtime/repo/node_modules/.bin:/var/lib/openshift/5486988687692b817500003a//.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
OPENSHIFT_HAPROXY_PATH_ELEMENT=/var/lib/openshift/5486988687692b817500003a/haproxy/usr/bin
PATH=/var/lib/openshift/5486988687692b817500003a/app-root/runtime/repo/node_modules/.bin:/var/lib/openshift/5486988687692b817500003a//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/var/lib/openshift
/5486988687692b817500003a/haproxy/usr/bin:/bin:/usr/bin:/usr/sbin

The code in the PR works.

Comment 6 errata-xmlrpc 2015-01-08 15:34:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0019.html


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