Bug 979740

Summary: Unable to add 'postgres' as an additional cartridge (both via UI & cli)
Product: OpenShift Online Reporter: Ajay <aj.fuel>
Component: ContainersAssignee: Fotios Lindiakos <fotios>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 2.xCC: bmeng, jkeck, mpatel
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-22 15:18:52 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 Ajay 2013-06-30 07:24:36 UTC
Description of problem:
  I am using the free version of openshift and recently created a python app using flask and postgres. When I tried adding postgres cartridge to my app, it fails with the following message:

/var/lib/openshift/607bb3a873f442629a88328ea75ef36c/postgresql/bin/install: line 39: HOME: unbound variable

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


How reproducible:


Steps to Reproduce:
1. Login via openshift UI
2. Click postgres 'add cartridge'

Actual results:
 postgres did not install, get the message: /var/lib/openshift/607bb3a873f442629a88328ea75ef36c/postgresql/bin/install: line 39: HOME: unbound variable

Expected results:
  postgres cartridge should be installed.

Additional info:
  I had mongodb previously installed, but since I planned on using postgres, I removed mongodb.

Comment 1 Fotios Lindiakos 2013-07-10 16:52:35 UTC
PR Submitted: https://github.com/openshift/origin-server/pull/3041

Comment 2 openshift-github-bot 2013-07-10 18:35:49 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/b024b15d5c80f530a406e75be3643a31dcf41799
Bug 979740 - Fix Postgres cartridge using $HOME

https://bugzilla.redhat.com/show_bug.cgi?id=979740

The Postgres cartridge was using $HOME in some places, but it should be using $OPENSHIFT_HOMEDIR.
This is causing an unbound variable error.

Comment 3 Meng Bo 2013-07-11 09:16:53 UTC
Checked on devenv_3482,

Add "unset HOME" to the top of the bin/install script for the postgresql cartridge.
Try to add the postgresql to my app.
It will not report errors.
And the .psqlrc and .pgpass exist under the gear dir.

[pythonws-bmeng.dev.rhcloud.com dc6b15feea0711e2b3c022000a8a0ade]\> ls -a
.  ..  app-root  .env  .gem  git  .gitconfig  mongodb  .pgpass	postgresql  .psqlrc  python  .sandbox  .ssh  .tmp