Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1170784 - Upgrade from OSE 2.1->2.2 will not set the OPENSHIFT_MYSQL_VERSION environment variable for mysql gears.
Upgrade from OSE 2.1->2.2 will not set the OPENSHIFT_MYSQL_VERSION environmen...
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 15:41 EST by Brenton Leanhardt
Modified: 2015-01-08 10:34 EST (History)
6 users (show)

See Also:
Fixed In Version: openshift-origin-cartridge-mysql-1.29.3.1-1
Doc Type: Bug Fix
Doc Text:
Cause: OPENSHIFT_MYSQL_VERSION was not set during mysql cartridge updates in all cases. Consequence: Gears wishing to make use of OPENSHIFT_MYSQL_VERSION may not have the expected value. Fix: OPENSHIFT_MYSQL_VERSION is now set in all cases. Result: OPENSHIFT_MYSQL_VERSION now contains the expected value.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-08 10:34:40 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 15:41:56 EST
Description of problem:

While looking in to merging upstream sprint 54 in to OSE 2.2 I noticed the following code in the mysql cartridge upgrade script:

if [[ $new_cart_version == "0.2.16" ]]; then
  set_env_var 'OPENSHIFT_MYSQL_VERSION' $mysql_version $env_dir
fi

The problem with that is that OSE 2.1 never shipped 0.2.16 and OSE 2.2 shipped 0.2.17.  As part of the OSE 2.1->2.2 upgrade process gears will go from whatever OSE 2.1 cartridge version was installed directly to 0.2.17.  That means that if statement will never be true for OSE.

I'm planning to fix this by changing the code to something like this:

if version_lt $curr $SPRINT_54; then
  if [[ ! -f ${OPENSHIFT_MYSQL_DIR}/env/OPENSHIFT_MYSQL_VERSION ]]; then
    # There is now a VERSION variable to allow the detection of 5.5
    # in rhcsh.
    set_env_var 'OPENSHIFT_MYSQL_VERSION' $mysql_version "${OPENSHIFT_MYSQL_DIR}/env"
  fi
fi

Technically it's safe to run set_env_var over again but I thought this shows our intention of only touching gears that have the problem.  This will of course be a compatible upgrade.
Comment 1 Brenton Leanhardt 2014-12-04 15:43:32 EST
For QE, please qa_ack this bug if you can verify that the 2.1->2.2 upgrade doesn't indeed fail to create this environment variable.
Comment 4 Ma xiaoqiang 2014-12-09 03:45:06 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 phps php-5.4 mysql-5.1 -s
#rhc app create phpapp php-5.4 mysql-5.5 
3. Check the env in the mysql gears
There is no 'OPENSHIFT_MYSQL_VERSION' env
4. Upgrade the env
5. Check the env in the mysql gears
[5486983b87692b817500000a-xiaom.ose-21.com.cn 5486983b87692b817500000a]\> env|grep -i mysq;
<--snip-->
OPENSHIFT_MYSQL_VERSION=5.1
[phpapp-xiaom.ose-21.com.cn 5486987087692bcb59000001]\> env|grep -i mysql
<--snip-->
OPENSHIFT_MYSQL_VERSION=5.5
Comment 6 errata-xmlrpc 2015-01-08 10:34:40 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.