Bug 978309 - OPENSHIFT_*_DB_PORT is blank after embed DB cartridge to a scalable app
OPENSHIFT_*_DB_PORT is blank after embed DB cartridge to a scalable app
Status: CLOSED CURRENTRELEASE
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers (Show other bugs)
1.2.0
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: John W. Lamb
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-26 06:41 EDT by Gaoyun Pei
Modified: 2017-03-08 12 EST (History)
4 users (show)

See Also:
Fixed In Version: openshift-origin-port-proxy-1.6.4-1.el6op
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-28 11:46:54 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 Gaoyun Pei 2013-06-26 06:41:33 EDT
Description of problem:
After embed DB cartridge(mysql-5.1, postgresql-8.4) to a scalable application, check the environment variables related to DB, found that OPENSHIFT_*_DB_PORT is blank, which would lead to fail to log into database.

Version-Release number of selected component (if applicable):
OpenShiftEnterprise 1.2 RC2
http://download.lab.bos.redhat.com/rel-eng/OpenShiftEnterprise/1.2/2013-06-25.3/


How reproducible:
Always

Steps to Reproduce:
1. Create a scalable app, then embed mysql and postgresql to it

2. Check the environment variables

[app4-111.oserc2.com 51caaaaccc072cffa1000041]\> env|grep DB
OPENSHIFT_MYSQL_DB_PORT=
OPENSHIFT_MYSQL_DB_HOST=51caaee4cc072c87f9000043-111.oserc2.com
OPENSHIFT_MYSQL_DB_PASSWORD=G_921ph1vdVr
OPENSHIFT_POSTGRESQL_DB_PASSWORD=2q1gEpTzG1hT
OPENSHIFT_POSTGRESQL_DB_HOST=51caaf15cc072cc12d000039-111.oserc2.com
OPENSHIFT_MYSQL_DB_GEAR_UUID=51caaee4cc072c87f9000043
OPENSHIFT_MYSQL_DB_USERNAME=adminwmnam6q
OPENSHIFT_POSTGRESQL_DB_GEAR_DNS=51caaf15cc072cc12d000039-111.oserc2.com
OPENSHIFT_POSTGRESQL_DB_USERNAME=adminkzjs8su
OPENSHIFT_POSTGRESQL_DB_GEAR_UUID=51caaf15cc072cc12d000039
OPENSHIFT_MYSQL_DB_URL=mysql://adminwmnam6q:G_921ph1vdVr@51caaee4cc072c87f9000043-111.oserc2.com:/
OPENSHIFT_POSTGRESQL_DB_URL=postgresql://adminkzjs8su:2q1gEpTzG1hT@51caaf15cc072cc12d000039-111.oserc2.com:/
OPENSHIFT_POSTGRESQL_DB_PORT=
OPENSHIFT_MYSQL_DB_GEAR_DNS=51caaee4cc072c87f9000043-111.oserc2.com


3. ssh into the DB gear, the DB gear also missing variable OPENSHIFT_*_DB_PROXY_PORT

[51caaee4cc072c87f9000043-111.oserc2.com 51caaee4cc072c87f9000043]\> env|grep DB
OPENSHIFT_MYSQL_DB_PORT=3306
OPENSHIFT_MYSQL_DB_HOST=127.3.181.129
OPENSHIFT_MYSQL_DB_PASSWORD=G_921ph1vdVr
OPENSHIFT_MYSQL_DB_USERNAME=adminwmnam6q
OPENSHIFT_MYSQL_DB_SOCKET=/var/lib/openshift/51caaee4cc072c87f9000043/mysql//socket/mysql.sock
OPENSHIFT_MYSQL_DB_URL=mysql://adminwmnam6q:G_921ph1vdVr@127.3.181.129:3306/
OPENSHIFT_MYSQL_DB_LOG_DIR=/var/lib/openshift/51caaee4cc072c87f9000043/mysql//log/


Actual results:
[app4-111.oserc2.com 51caaaaccc072cffa1000041]\> mysql
ERROR 2003 (HY000): Can't connect to MySQL server on '51caaee4cc072c87f9000043-111.oserc2.com' (113)
[app4-111.oserc2.com 51caaaaccc072cffa1000041]\> psql
psql: could not connect to server: No route to host
	Is the server running on host "51caaf15cc072cc12d000039-111.oserc2.com" and accepting
	TCP/IP connections on port ?


Expected results:
App gears should have a correct OPENSHIFT_*_DB_PORT variable the same with OPENSHIFT_*_DB_PROXY_PORT

Additional info:
Comment 2 John W. Lamb 2013-06-26 15:28:47 EDT
Addressed with this PR:
https://github.com/openshift/enterprise-server/pull/96
Comment 3 Gaoyun Pei 2013-06-27 02:30:49 EDT
Verify this bug on puddle:
http://download.lab.bos.redhat.com/rel-eng/OpenShiftEnterprise/1.2/2013-06-26.3/

The OPENSHIFT_*_DB_PORT variable is correct, and all the haproxy + web gears could connect to mysql and postgresql.
Comment 4 Luke Meyer 2013-06-28 11:46:54 EDT
Closing all bugs introduced, fixed, and verified during 1.2 release work (thus never shipped).

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