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:
Discussed on IRC with Andre, Rajat, and Mrunal. This will need a migration.
Fixed with migrate script li/misc/maintenance/bin/migrate-2.0.25.1
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.
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/
PROD has not yet been upgraded yet, this fix has been in STG now.