Bug 980753 - [origin_runtime_157]No OPENSHIFT_POSTGRESQL_VERSION shown in app after having embedded postgresql-9.2 with scalable app
Summary: [origin_runtime_157]No OPENSHIFT_POSTGRESQL_VERSION shown in app after having...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Hiro Asari
QA Contact: libra bugs
URL:
Whiteboard:
: 980713 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-03 07:42 UTC by Yan Du
Modified: 2015-05-14 23:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-03 13:41:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yan Du 2013-07-03 07:42:00 UTC
Description of problem:
create an app embedded postgresql-9.2, and ssh in to the all, run env | grep POSTGRESQL to check psql environment variables, no OPENSHIFT_POSTGRESQL_VERSION shown



Version-Release number of selected component (if applicable):
devenv_3441
rhc-1.11.2



How reproducible:
Always



Steps to Reproduce:
1. Create an app and added postgresql-9.2 to the app
$ rhc app create j7s jbossas-7 -s
$ rhc cartridge add -a j7s -c postgresql-9.2
2. ssh the app and env
$ rhc app ssh j7s
$ env | grep POSTGRESQL



Actual results:
no OPENSHIFT_POSTGRESQL_VERSION shown.
[j7s-111.dev.rhcloud.com 574972695356251140259840]\> env | grep POSTGRESQL
OPENSHIFT_POSTGRESQL_DB_PASSWORD=ivpZBTFLARIZ
OPENSHIFT_POSTGRESQL_DB_HOST=f44b4698e39b11e28d3122000a98b95e-111.dev.rhcloud.com
OPENSHIFT_POSTGRESQL_DB_GEAR_DNS=f44b4698e39b11e28d3122000a98b95e-111.dev.rhcloud.com
OPENSHIFT_POSTGRESQL_DB_USERNAME=admins9krum5
OPENSHIFT_POSTGRESQL_DB_GEAR_UUID=f44b4698e39b11e28d3122000a98b95e
OPENSHIFT_POSTGRESQL_DB_URL=postgresql://admins9krum5:ivpZBTFLARIZ.rhcloud.com:35546/
OPENSHIFT_POSTGRESQL_DB_PORT=35546



Expected results:
OPENSHIFT_POSTGRESQL_VERSION=9.2 should exist.



Additional info:

it works noramlly with non-scalable app

[j6-111.dev.rhcloud.com 226342571932868581261312]\> env | grep POSTGRESQL
OPENSHIFT_POSTGRESQL_DB_SOCKET=/var/lib/openshift/226342571932868581261312/postgresql//socket/
OPENSHIFT_POSTGRESQL_DB_PASSWORD=_mkDsveFnuyj
OPENSHIFT_POSTGRESQL_DB_HOST=127.0.255.2
OPENSHIFT_POSTGRESQL_IDENT=redhat:postgresql:9.2:0.3.0
OPENSHIFT_POSTGRESQL_DB_PID=/var/lib/openshift/226342571932868581261312/postgresql//pid/postgres.pid
OPENSHIFT_POSTGRESQL_DIR=/var/lib/openshift/226342571932868581261312/postgresql/
OPENSHIFT_POSTGRESQL_DB_USERNAME=adminfc5ar1t
OPENSHIFT_POSTGRESQL_PATH_ELEMENT=/opt/rh/postgresql92/root/usr/bin
OPENSHIFT_POSTGRESQL_DB_URL=postgresql://adminfc5ar1t:_mkDsveFnuyj.255.2:5432
OPENSHIFT_POSTGRESQL_VERSION=9.2               <<======
OPENSHIFT_POSTGRESQL_DB_PORT=5432
OPENSHIFT_POSTGRESQL_DB_LOG_DIR=/var/lib/openshift/226342571932868581261312/postgresql//log/

Comment 1 Hiro Asari 2013-07-03 13:35:02 UTC
The issue here is not one where the environment variables are not set to expected values. It is that you are connecting to a wrong gear.

On a scaled application, the DB gear and the application gears are most likely different, but the DB environment is set up correctly on the DB gear. Of course, it is not clear how the user would connect to the DB gear.

Comment 2 Hiro Asari 2013-07-03 13:36:13 UTC
*** Bug 980713 has been marked as a duplicate of this bug. ***

Comment 3 Hiro Asari 2013-07-03 13:41:53 UTC
Right.

Use 'rhc app show j7s --gears' to get the correct parameter to connect to the postgresql gear:

$ bx bin/rhc app show j7s --gears
ID                       State   Cartridges            Size  SSH URL
------------------------ ------- --------------------- ----- ------------------------------------------------------------------------------
51d4220ba7ecc11f6c000002 started postgresql-9.2        small 51d4220ba7ecc11f6c000002.rhcloud.com
51d4220aa7ecc11f6c000001 started jbossas-7 haproxy-1.4 small 51d4220aa7ecc11f6c000001.rhcloud.com

$ ssh 51d4220ba7ecc11f6c000002.rhcloud.com
…
[51d4220ba7ecc11f6c000002-fooooooooooo.dev.rhcloud.com 51d4220ba7ecc11f6c000002]\> env | sort | grep POSTGRES
OPENSHIFT_POSTGRESQL_DB_HOST=127.0.250.129
OPENSHIFT_POSTGRESQL_DB_LOG_DIR=/var/lib/openshift/51d4220ba7ecc11f6c000002/postgresql//log/
OPENSHIFT_POSTGRESQL_DB_PASSWORD=PYS69-TxbH_s
OPENSHIFT_POSTGRESQL_DB_PID=/var/lib/openshift/51d4220ba7ecc11f6c000002/postgresql//pid/postgres.pid
OPENSHIFT_POSTGRESQL_DB_PORT=5432
OPENSHIFT_POSTGRESQL_DB_PROXY_PORT=35536
OPENSHIFT_POSTGRESQL_DB_SOCKET=/var/lib/openshift/51d4220ba7ecc11f6c000002/postgresql//socket/
OPENSHIFT_POSTGRESQL_DB_URL=postgresql://adminhiwic1u:PYS69-TxbH_s.250.129:5432
OPENSHIFT_POSTGRESQL_DB_USERNAME=adminhiwic1u
OPENSHIFT_POSTGRESQL_DIR=/var/lib/openshift/51d4220ba7ecc11f6c000002/postgresql/
OPENSHIFT_POSTGRESQL_IDENT=redhat:postgresql:9.2:0.3.0
OPENSHIFT_POSTGRESQL_PATH_ELEMENT=/opt/rh/postgresql92/root/usr/bin
OPENSHIFT_POSTGRESQL_VERSION=9.2


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