Bug 923442

Summary: existing embedded cartridges report URL with real IP, not with ENV VAR
Product: OKD Reporter: Andre Dietisheim <adietish>
Component: PodAssignee: Rajat Chopra <rchopra>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 2.xCC: dmcphers, jhou, xtian, zzhao
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-04-02 14:26:55 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:
Bug Depends On: 916268    
Bug Blocks:    

Description Andre Dietisheim 2013-03-19 20:37:11 UTC
Description of problem:
If you query the embedded cartridges of existing applications, the URL reported is using the real numeric IP and not a form that uses ENV VARIABLES

ex. for mongodb:

mongodb://myapp-mydomain.rhcloud.com:48681 

VS

mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT

While for new applications and cartridges, the latter form is what's always reported.

According to our chat on #libra this might be an issue for scalables apps with dbs:

(08:26:41 PM) mpatel: agupta: Older apps with scalable dbs will show incorrect port and hence the move to env vars instead.
(08:27:19 PM) rchopra: mpatel, then we should migrate, right? if there is a potential to show incorrect info
(08:31:49 PM) rchopra: yeah lets do it.. mpatel : i will sit with you for some details today.. and lets put it across
(08:32:15 PM) mpatel: adietish: No problem, we will fix it.

Version-Release number of selected component (if applicable):
latest PROD (2013-03-19)

How reproducible:
always

Steps to Reproduce:
1. Inspect the url that's reported for an existing embedded cartridge of an existing application
  
Actual results:
mongodb://myapp-mydomain.rhcloud.com:48681 

Expected results:
mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT


Additional info:

Comment 1 Abhishek Gupta 2013-03-19 20:39:56 UTC
Discussed on IRC with Andre, Rajat, and Mrunal. This will need a migration.

Comment 2 Rajat Chopra 2013-03-26 05:41:59 UTC
Fixed with migrate script li/misc/maintenance/bin/migrate-2.0.25.1

Comment 3 Jianwei Hou 2013-03-26 12:27:16 UTC
Verified with li/misc/maintenance/bin/migrate-2.0.25.1

Steps:
1. On an old devenv-stage_326 instance, create several scalable apps with mysql/mongo/postgresql cartridges
2. Go to https://broker/datastore , update the connection urls of these apps to the old fashioned way( eg: change mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT to mongodb://myapp-mydomain.rhcloud.com:48681 )
3. Upgrade server to latest
4. On broker execute the migrate-2.0.25.1 to fix the connection urls
5. On client, retrieve app info
The db connections are updated to format like:
mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/
postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT/
6. SSH into gear, connect to db cartridges
Was able to connect to all db cartridges.

Comment 4 Andre Dietisheim 2013-04-02 08:58:07 UTC
I'm not perfectly sure if the migration was completely successful. I checked with an old app I have running on PROD and could still see the embedded mysql reported with the plain IP instead of env-vars:

adietish+test/https://openshift.redhat.com:

application "aa", embeddded cartridge "mysql-5.1":

URL: mysql://127.11.54.1:3306/

Comment 5 Xiaoli Tian 2013-04-02 09:46:02 UTC
PROD has not yet been upgraded yet, this fix has been in STG now.

Comment 6 Xiaoli Tian 2013-04-02 09:46:03 UTC
PROD has not yet been upgraded yet, this fix has been in STG now.