Bug 962338 - The TYPELESS_TRANSLATED_VARS environment variable is not migrated successfully
The TYPELESS_TRANSLATED_VARS environment variable is not migrated successfully
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Paul Morie
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-13 04:57 EDT by Jianwei Hou
Modified: 2015-05-14 19:11 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-10 23:56:27 EDT
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)

  None (edit)
Description Jianwei Hou 2013-05-13 04:57:11 EDT
Description of problem:
Some environment variables inside .env/TYPELESS_TRANSLATED_VARS were not migrated successfully

Version-Release number of selected component (if applicable):
Upgrading devenv-stage_351 to devenv_3219 and migrate

How reproducible:
Always

Steps to Reproduce:
1. Launch a devenv-stage_351 ami
2. Create a diy app, add TYPELESS_TRANSLATED_VARS file under /var/lib/openshift/$uuid/.env, with following contents:
export OPENSHIFT_RUNTIME_DIR="/var/lib/openshift/e419a130bb9011e2b6f522000a8dbcca/diy-0.1/runtime/"
export OPENSHIFT_RUN_DIR="/var/lib/openshift/e419a130bb9011e2b6f522000a8dbcca/diy-0.1/run/"
export OPENSHIFT_GEAR_TYPE="diy-0.1"
export OPENSHIFT_LOG_DIR="$OPENSHIFT_DIY_LOG_DIR"
export OPENSHIFT_GEAR_DIR="/var/lib/openshift/e419a130bb9011e2b6f522000a8dbcca/diy-0.1/"
export OPENSHIFT_GEAR_CTL_SCRIPT="/usr/libexec/openshift/cartridges/diy-0.1/info/bin/app_ctl.sh"

3. scp -r ~/devenv-local and /etc/yum.repos.d/local.repo from devenv_3219 instance to same location on devenv-stage_351 instance
4. yum -y update --enablerepo devenv-local (the instance will be default to v2 format after upgrade)
6. rhc-v2-migrate --version 2.0.28
7. SSH into app after migration, verify that the env vars files defined in .env/TYPELESS_TRANSLATED_VARS are created and sourced
  
Actual results:
After migration, the env vars defined inside TYPELESS_TRANSLATED_VARS are not migrated into raw values.
[specialapp-jhou.dev.rhcloud.com e419a130bb9011e2b6f522000a8dbcca]\> ls -al .env/
total 104
drwxr-x---.  3 root                             e419a130bb9011e2b6f522000a8dbcca 4096 May 13 02:38 .
drwxr-x---. 10 root                             e419a130bb9011e2b6f522000a8dbcca 4096 May 13 02:38 ..
-rw-r--r--.  1 root                             root                                1 May 13 02:38 CARTRIDGE_VERSION_2
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   79 May 13 02:38 HISTFILE
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   52 May 13 02:38 HOME
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   31 May 13 02:38 OPENSHIFT_APP_DNS
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   10 May 13 02:38 OPENSHIFT_APP_NAME
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   32 May 13 02:38 OPENSHIFT_APP_UUID
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   66 May 13 02:38 OPENSHIFT_DATA_DIR
-rw-r--r--.  1 root                             root                               13 May 13 02:38 OPENSHIFT_DIY_IP
-rw-r--r--.  1 root                             root                                4 May 13 02:38 OPENSHIFT_DIY_PORT
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   31 May 13 02:38 OPENSHIFT_GEAR_DNS
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   10 May 13 02:38 OPENSHIFT_GEAR_NAME
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   32 May 13 02:38 OPENSHIFT_GEAR_UUID
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   52 May 13 02:38 OPENSHIFT_HOMEDIR
-rw-r--r--.  1 root                             root                               13 May 13 02:38 OPENSHIFT_INTERNAL_IP
-rw-r--r--.  1 root                             root                                4 May 13 02:38 OPENSHIFT_INTERNAL_PORT
-rw-r--r--.  1 root                             root                                4 May 13 02:38 OPENSHIFT_NAMESPACE
-rw-r--r--.  1 root                             root                               56 May 13 02:38 OPENSHIFT_PRIMARY_CARTRIDGE_DIR
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca   74 May 13 02:38 OPENSHIFT_REPO_DIR
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca    5 May 13 02:38 OPENSHIFT_TMP_DIR
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca    5 May 13 02:38 TMP
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca    5 May 13 02:38 TMPDIR
-rw-r--r--.  1 root                             e419a130bb9011e2b6f522000a8dbcca    5 May 13 02:38 TMP_DIR
-rw-r--r--.  1 root                             root                              464 May 13 02:38 TYPELESS_TRANSLATED_VARS
drwxr-xr-x.  2 e419a130bb9011e2b6f522000a8dbcca e419a130bb9011e2b6f522000a8dbcca 4096 May 13 01:50 .uservars

[specialapp-jhou.dev.rhcloud.com e419a130bb9011e2b6f522000a8dbcca]\> cat .env/TYPELESS_TRANSLATED_VARS 
export OPENSHIFT_RUNTIME_DIR="/var/lib/openshift/e419a130bb9011e2b6f522000a8dbcca/diy-0.1/runtime/"
export OPENSHIFT_RUN_DIR="/var/lib/openshift/e419a130bb9011e2b6f522000a8dbcca/diy-0.1/run/"
export OPENSHIFT_GEAR_TYPE="diy-0.1"
export OPENSHIFT_LOG_DIR="$OPENSHIFT_PHP_LOG_DIR"
export OPENSHIFT_GEAR_DIR="/var/lib/openshift/e419a130bb9011e2b6f522000a8dbcca/diy-0.1/"
export OPENSHIFT_GEAR_CTL_SCRIPT="/usr/libexec/openshift/cartridges/diy-0.1/info/bin/app_ctl.sh"

Expected results:
According to https://github.com/openshift/li/blob/master/rhc-node/mcollective/lib/migrate-v2.rb
The OPENSHIFT_RUNTIME_DIR, OPENSHIFT_RUN_DIR, OPENSHIFT_LOG_DIR, OPENSHIFT_GEAR_DIR should be created.

Additional info:
Will the .env/.uservars be removed after migration?
Comment 2 Paul Morie 2013-05-16 11:05:20 EDT
Yes, the .env/.uservars directory will be removed after the migration.
Comment 3 Jianwei Hou 2013-05-17 03:13:39 EDT
Verified while migrating on devenv_3235

The environment variables in TYPELESS_TRANSLATED_VARS are migrated into new format
[diy1-jhou.dev.rhcloud.com .env]\> cat OPENSHIFT_RUN_DIR
/var/lib/openshift/0fc3cee8beb411e2936322000aa63b64/diy-0.1/run/
[diy1-jhou.dev.rhcloud.com .env]\> cat OPENSHIFT_GEAR_DIR
/var/lib/openshift/0fc3cee8beb411e2936322000aa63b64/diy-0.1/

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