Bug 869236
Summary: | Some environment variables are incorrect after migration | ||
---|---|---|---|
Product: | OKD | Reporter: | jizhao |
Component: | Containers | Assignee: | Paul Morie <pmorie> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | libra bugs <libra-bugs> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 2.x | CC: | jhou, mpatel, pmorie, szhou, xtian |
Target Milestone: | --- | Keywords: | TestBlocker |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-11-06 18:50:09 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
jizhao
2012-10-23 11:15:26 UTC
OPENSHIFT_GEAR_DIR, OPENSHIFT_GEAR_CTL_SCRIPT, OPENSHIFT_GEAR_TYPE, OPENSHIFT_RUNTIME_DIR, OPENSHIFT_LOG_DIR are translated for existing apps so that existing application code that uses those variables does not break. OPENSHIFT_GEAR_NAME is not getting removed. (In reply to comment #1) > OPENSHIFT_GEAR_DIR, OPENSHIFT_GEAR_CTL_SCRIPT, OPENSHIFT_GEAR_TYPE, > OPENSHIFT_RUNTIME_DIR, OPENSHIFT_LOG_DIR are translated for > existing apps so that existing application code that uses those variables > does > not break. > > OPENSHIFT_GEAR_NAME is not getting removed. Well, it seems the attachment of US2105 in rally is outdated. I'll update corresponding test cases. This may also caused some problem on INT After upgrade of INT, env vars for mongodb did not got updated, and I was unable to connect to mongo shell via rhcsh [perl1-jhou.int.rhcloud.com ~]\> set -x [perl1-jhou.int.rhcloud.com ~]\> mongo + mongo + test 0 -gt 0 + uopt='--username '\''admin'\''' + '[' -n '' ']' + echo + egrep '\-\-host|' + hopt= + unset LD_LIBRARY_PATH + /usr/bin/mongo --username ''\''admin'\''' MongoDB shell version: 2.2.0 connecting to: test Wed Oct 24 00:35:20 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91 [perl1-jhou.int.rhcloud.com ~]\> env|grep DB OPENSHIFT_NOSQL_DB_PASSWORD=UYKK4ub99cne OPENSHIFT_NOSQL_DB_PORT=27017 OPENSHIFT_NOSQL_DB_HOST=127.1.255.129 OPENSHIFT_NOSQL_DB_USERNAME=admin [perl1-jhou.int.rhcloud.com ~]\> /usr/bin/mongo 127.1.255.129:27017 -uadmin -pUYKK4ub99cne + /usr/bin/mongo 127.1.255.129:27017 -u admin -pUYKK4ub99cne MongoDB shell version: 2.2.0 connecting to: 127.1.255.129:27017/test Error: { errmsg: "auth fails", ok: 0.0 } Wed Oct 24 00:36:46 uncaught exception: login failed exception: login failed Also failed for postgresql connection via rhcsh [python1-jhou.int.rhcloud.com ~]\> psql + psql + PGDATABASE=python1 + PGHOST= + PGPORT=5432 + PGUSER=''\''admin'\''' + PGPASSWORD= + /usr/bin/psql --set 'HISTFILE=~/app-root/data/.psql_history' psql: FATAL: Ident authentication failed for user "'admin'" [python1-jhou.int.rhcloud.com ~]\> env|grep DB + env + grep DB OPENSHIFT_DB_HOST=127.2.5.129 OPENSHIFT_DB_CTL_SCRIPT=/var/lib/openshift/a912d3fc0a5c44acaa532796309010d0//postgresql-8.4/python1_postgresql_ctl.sh OPENSHIFT_DB_PASSWORD=RiCRhGD2qiTu OPENSHIFT_DB_USERNAME=admin OPENSHIFT_DB_POSTGRESQL_84_RESTORE=/usr/libexec/openshift/cartridges/embedded/postgresql-8.4/info/bin/postgresql_restore.sh OPENSHIFT_DB_POSTGRESQL_84_DUMP_CLEANUP=/usr/libexec/openshift/cartridges/embedded/postgresql-8.4/info/bin/postgresql_cleanup.sh OPENSHIFT_DB_POSTGRESQL_84_EMBEDDED_TYPE=postgresql-8.4 OPENSHIFT_DB_URL=postgresql://admin:RiCRhGD2qiTu.5.129:5432/ OPENSHIFT_DB_SOCKET=/var/lib/openshift/a912d3fc0a5c44acaa532796309010d0//postgresql-8.4/socket/postgres.sock OPENSHIFT_DB_POSTGRESQL_84_DUMP=/usr/libexec/openshift/cartridges/embedded/postgresql-8.4/info/bin/postgresql_dump.sh OPENSHIFT_DB_TYPE=postgresql OPENSHIFT_DB_PORT=5432 Recreated issue with postgres shell via rhcsh, will investigate. Was not able to reproduce problem for mongo shell. Reproduced issues both with mongo and postgres. The root cause here was incorrect values in a ruby case statement which was causing the mongo and postgres carts not to be migrated for the typeless gears changes (I introduced this when refactoring the migration script to include rename changes). Fixed in devenv AMI 2376. Tested on INT(same as devenv_2376) Seems postgresql and mongo for non-scaling apps are not migrated successfully, they are still using the old fashioned environment variables, and can't connect to them via rhcsh mongodb: OPENSHIFT_NOSQL_DB_CTL_SCRIPT=/var/lib/openshift/a186701afaee4224997685ea6b7409a1//mongodb-2.2/perl1_mongodb_ctl.sh OPENSHIFT_NOSQL_DB_HOST=127.1.255.129 OPENSHIFT_NOSQL_DB_MONGODB_22_DUMP_CLEANUP=/usr/libexec/openshift/cartridges/embedded/mongodb-2.2/info/bin/mongodb_cleanup.sh OPENSHIFT_NOSQL_DB_MONGODB_22_DUMP=/usr/libexec/openshift/cartridges/embedded/mongodb-2.2/info/bin/mongodb_dump.sh OPENSHIFT_NOSQL_DB_MONGODB_22_EMBEDDED_TYPE=mongodb-2.2 OPENSHIFT_NOSQL_DB_MONGODB_22_RESTORE=/usr/libexec/openshift/cartridges/embedded/mongodb-2.2/info/bin/mongodb_restore.sh OPENSHIFT_NOSQL_DB_PASSWORD=UYKK4ub99cne OPENSHIFT_NOSQL_DB_PORT=27017 OPENSHIFT_NOSQL_DB_TYPE=mongodb OPENSHIFT_NOSQL_DB_URL=mongodb://admin:UYKK4ub99cne.255.129:27017/ OPENSHIFT_NOSQL_DB_USERNAME=admin postgresql: OPENSHIFT_DB_CTL_SCRIPT=/var/lib/openshift/a912d3fc0a5c44acaa532796309010d0//postgresql-8.4/python1_postgresql_ctl.sh OPENSHIFT_DB_HOST=127.2.5.129 OPENSHIFT_DB_PASSWORD=RiCRhGD2qiTu OPENSHIFT_DB_PORT=5432 OPENSHIFT_DB_POSTGRESQL_84_DUMP_CLEANUP=/usr/libexec/openshift/cartridges/embedded/postgresql-8.4/info/bin/postgresql_cleanup.sh OPENSHIFT_DB_POSTGRESQL_84_DUMP=/usr/libexec/openshift/cartridges/embedded/postgresql-8.4/info/bin/postgresql_dump.sh OPENSHIFT_DB_POSTGRESQL_84_EMBEDDED_TYPE=postgresql-8.4 OPENSHIFT_DB_POSTGRESQL_84_RESTORE=/usr/libexec/openshift/cartridges/embedded/postgresql-8.4/info/bin/postgresql_restore.sh OPENSHIFT_DB_SOCKET=/var/lib/openshift/a912d3fc0a5c44acaa532796309010d0//postgresql-8.4/socket/postgres.sock OPENSHIFT_DB_TYPE=postgresql OPENSHIFT_DB_URL=postgresql://admin:RiCRhGD2qiTu.5.129:5432/ OPENSHIFT_DB_USERNAME=admin For scaling apps: the env vars are updated properly, but can't connect to the db shell [python1s-jhou.int.rhcloud.com ~]\> mongo MongoDB shell version: 2.2.0 connecting to: 06496d5f6b-jhou.int.rhcloud.com:27017/admin Thu Oct 25 03:01:41 Error: couldn't connect to server 06496d5f6b-jhou.int.rhcloud.com:27017 src/mongo/shell/mongo.js:93 exception: connect failed I've done migration testing from devenv-stage_239 to devenv_2377. There's re still some bugs: Version: from devenv-stage_239 to devenv_2377 Actual results: 1.OPENSHIFT_DB_PROXY_PORT, OPENSHIFT_NOSQL_DB_PROXY_PORT are missing. 2.For scalable apps: OPENSHIFT_MONGODB_DB_SOCKET is missing; OPENSHIFT_NOSQL_DB_SOCKET has no value. For normal app: OPENSHIFT_NOSQL_DB_SOCKET has no value(jbossas-7) or missing(nodejs-0.6), OPENSHIFT_MONGODB_DB_SOCKET is missing. Besides, for scalable apps, the old database environment variables only exist in the database gear after migration. Will this cause any problem? Retesting using these permutations: ['php-5.3', 'mysql-5.1'], ['php-5.3', 'postgresql-8.4'], ['php-5.3', 'mongodb-2.0'], ['nodejs-0.6', 'mysql-5.1'], ['nodejs-0.6', 'postgresql-8.4'], ['nodejs-0.6', 'mongodb-2.0'], ['jbossas-7', 'mysql-5.1'], ['jbossas-7', 'postgresql-8.4'], ['jbossas-7', 'mongodb-2.0'], Running the hascaledb migration script re-executes the db connectors for scalable apps, so the old db environment variables aren't required on the non-db gears in a scalable app after migration. Actually, you are right, we need to translate the DB variables on the other gears of a scalable app. Pull request made. The migratomatic tool has been changed to test this use-case by default. Please re-test using devenv AMI 2389 using migratomatic: https://engineering.redhat.com/trac/Libra/wiki/Migratomatic The migratomatic tool will create scalable apps with DBs by default. Finished migration testing from devenv-stage_239 to devenv_2397. Still some bugs. Version: from devenv-stage_239 to devenv_2397 Actual results: 1.global: OPENSHIFT_APP_DIR, OPENSHIFT_APP_TYPE are missing after migration. According to the latest env var spreadsheet, they should be translated instead of removed. 2.mongodb: - scalable apps: In the haproxy gear, OPENSHIFT_NOSQL_DB_SOCKET, OPENSHIFT_MONGODB_DB_SOCKET, OPENSHIFT_NOSQL_DB_PROXY_PORT, OPENSHIFT_MONGODB_DB_PROXY_PORT are missing; In mongodb gear, OPENSHIFT_NOSQL_DB_SOCKET has no value, OPENSHIFT_NOSQL_DB_PROXY_PORT and OPENSHIFT_NOSQL_DB_PROXY_PORT are missing. - non-scalable apps: OPENSHIFT_NOSQL_DB_SOCKET, OPENSHIFT_MONGODB_DB_SOCKET are missing - both scalable and non-scalable apps: OPENSHIFT_NOSQL_DB_GEAR_DNS, OPENSHIFT_NOSQL_DB_GEAR_UUID, OPENSHIFT_NOSQL_DB_HOST, OPENSHIFT_NOSQL_DB_PASSWORD, OPENSHIFT_NOSQL_DB_PORT, OPENSHIFT_NOSQL_DB_PROXY_PORT, OPENSHIFT_NOSQL_DB_SOCKET, OPENSHIFT_NOSQL_DB_URL, OPENSHIFT_NOSQL_DB_USERNAME 3.mysql: For scalable apps, in haproxy gear, OPENSHIFT_MYSQL_DB_PROXY_PORT, OPENSHIFT_DB_PROXY_PORT are missing; in mysql gear, OPENSHIFT_DB_PROXY_PORT is missing. 4.postgresql: For scalable apps, in haproxy gear, OPENSHIFT_POSTGRESQL_DB_PROXY_PORT, OPENSHIFT_DB_PROXY_PORT are missing; In postgresql gear, OPENSHIFT_DB_PROXY_PORT is missing. 5.jbossas/jbosseap: OPENSHIFT_JBOSS_CLUSTER, OPENSHIFT_JBOSS_CLUSTER_PORT, OPENSHIFT_JBOSS_CLUSTER_PROXY_PORT, OPENSHIFT_JBOSS_CLUSTER_REMOTING, OPENSHIFT_JBOSS_MESSAGING_PORT, OPENSHIFT_JBOSS_MESSAGING_THROUGHPUT_PORT, OPENSHIFT_JBOSS_REMOTING_PORT are missing. 6.10gen-mms-agent: OPENSHIFT_10GEN_MMS_AGENT_CTL_SCRIPT, OPENSHIFT_10GEN_MMS_AGENT_GEAR_DIR still exist. OPENSHIFT_APP_DIR, OPENSHIFT_APP_TYPE were translated as part of earlier typeless gear migrations. The current migration does not touch these variables. --- 3.mysql: For scalable apps, in haproxy gear, OPENSHIFT_MYSQL_DB_PROXY_PORT, OPENSHIFT_DB_PROXY_PORT are missing; in mysql gear, OPENSHIFT_DB_PROXY_PORT is missing. 4.postgresql: For scalable apps, in haproxy gear, OPENSHIFT_POSTGRESQL_DB_PROXY_PORT, OPENSHIFT_DB_PROXY_PORT are missing; In postgresql gear, OPENSHIFT_DB_PROXY_PORT is missing. --- OPENSHIFT_DB_PROXY_PORT variable only exists on db gear for a scalable app and it is moved (not translated). So, the behavior that we see above is correct. (I am updating the spreadsheet to reflect this). ---- 2.mongodb: - scalable apps: In the haproxy gear, OPENSHIFT_NOSQL_DB_SOCKET, OPENSHIFT_MONGODB_DB_SOCKET, OPENSHIFT_NOSQL_DB_PROXY_PORT, OPENSHIFT_MONGODB_DB_PROXY_PORT are missing; In mongodb gear, OPENSHIFT_NOSQL_DB_SOCKET has no value, OPENSHIFT_NOSQL_DB_PROXY_PORT and OPENSHIFT_NOSQL_DB_PROXY_PORT are missing. - non-scalable apps: OPENSHIFT_NOSQL_DB_SOCKET, OPENSHIFT_MONGODB_DB_SOCKET are missing - both scalable and non-scalable apps: OPENSHIFT_NOSQL_DB_GEAR_DNS, OPENSHIFT_NOSQL_DB_GEAR_UUID, OPENSHIFT_NOSQL_DB_HOST, OPENSHIFT_NOSQL_DB_PASSWORD, OPENSHIFT_NOSQL_DB_PORT, OPENSHIFT_NOSQL_DB_PROXY_PORT, OPENSHIFT_NOSQL_DB_SOCKET, OPENSHIFT_NOSQL_DB_URL, OPENSHIFT_NOSQL_DB_USERNAME ---- There is no db socket for mongodb. Will fix the other issue. ------ 2.mongodb: - scalable apps: In the haproxy gear, OPENSHIFT_NOSQL_DB_SOCKET, OPENSHIFT_MONGODB_DB_SOCKET, OPENSHIFT_NOSQL_DB_PROXY_PORT, OPENSHIFT_MONGODB_DB_PROXY_PORT are missing; mrunal: Expected behavior. In mongodb gear, OPENSHIFT_NOSQL_DB_SOCKET has no value, mrunal: Fixed, it won't be created. OPENSHIFT_NOSQL_DB_PROXY_PORT and OPENSHIFT_NOSQL_DB_PROXY_PORT are missing. mrunal: Expected behavior. - non-scalable apps: OPENSHIFT_NOSQL_DB_SOCKET, OPENSHIFT_MONGODB_DB_SOCKET are missing mrunal: Expected behavior. - both scalable and non-scalable apps: OPENSHIFT_NOSQL_DB_GEAR_DNS, OPENSHIFT_NOSQL_DB_GEAR_UUID, OPENSHIFT_NOSQL_DB_HOST, OPENSHIFT_NOSQL_DB_PASSWORD, OPENSHIFT_NOSQL_DB_PORT, OPENSHIFT_NOSQL_DB_PROXY_PORT, OPENSHIFT_NOSQL_DB_SOCKET, OPENSHIFT_NOSQL_DB_URL, OPENSHIFT_NOSQL_DB_USERNAME mrunal: Fixed. ---- ---- 5.jbossas/jbosseap: OPENSHIFT_JBOSS_CLUSTER, OPENSHIFT_JBOSS_CLUSTER_PORT, OPENSHIFT_JBOSS_CLUSTER_PROXY_PORT, OPENSHIFT_JBOSS_CLUSTER_REMOTING, OPENSHIFT_JBOSS_MESSAGING_PORT, OPENSHIFT_JBOSS_MESSAGING_THROUGHPUT_PORT, OPENSHIFT_JBOSS_REMOTING_PORT are missing. mrunal: Fixed. ---- 6.10gen-mms-agent: OPENSHIFT_10GEN_MMS_AGENT_CTL_SCRIPT, OPENSHIFT_10GEN_MMS_AGENT_GEAR_DIR still exist. mrunal: Fixed. ----- Pull request for remaining issues - https://github.com/openshift/li/pull/549 Submitted new pull request because of merge conflict - https://github.com/openshift/li/pull/551 The code has been merged. Change this bug to ON_QA. Verify this bug. Version: from devenv-stage_239 to devenv_2404. Actual results: 1.OPENSHIFT_NOSQL_DB_SOCKET isn't created 2.The following env vars still exist after migration: OPENSHIFT_NOSQL_DB_GEAR_DNS, OPENSHIFT_NOSQL_DB_GEAR_UUID, OPENSHIFT_NOSQL_DB_HOST, OPENSHIFT_NOSQL_DB_PASSWORD, OPENSHIFT_NOSQL_DB_PORT, OPENSHIFT_NOSQL_DB_PROXY_PORT, OPENSHIFT_NOSQL_DB_SOCKET, OPENSHIFT_NOSQL_DB_URL, OPENSHIFT_NOSQL_DB_USERNAME 3.The following env vars still exist after migration: OPENSHIFT_JBOSS_CLUSTER, OPENSHIFT_JBOSS_CLUSTER_PORT, OPENSHIFT_JBOSS_CLUSTER_PROXY_PORT, OPENSHIFT_JBOSS_CLUSTER_REMOTING, OPENSHIFT_JBOSS_MESSAGING_PORT, OPENSHIFT_JBOSS_MESSAGING_THROUGHPUT_PORT, OPENSHIFT_JBOSS_REMOTING_PORT 4.OPENSHIFT_10GEN_MMS_AGENT_CTL_SCRIPT, OPENSHIFT_10GEN_MMS_AGENT_GEAR_DIR no longer exist. |