Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1170789 - Nodejs gears can potentially be misconfigured to work with the v8 SCL.
Nodejs gears can potentially be misconfigured to work with the v8 SCL.
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image (Show other bugs)
2.2.0
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Brenton Leanhardt
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-04 16:12 EST by Brenton Leanhardt
Modified: 2015-01-08 10:34 EST (History)
6 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-08 10:34:43 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0019 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.3 bug fix and enhancement update 2015-01-08 15:33:24 EST

  None (edit)
Description Brenton Leanhardt 2014-12-04 16:12:29 EST
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 16:15:57 EST
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 03:50:01 EST
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 10:34:43 EST
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.