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/
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.
*** Bug 980713 has been marked as a duplicate of this bug. ***
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