Bug 972261

Summary: The connection url for mongodb cartridge does not get displayed behind the string "Embedded app details:" during installation
Product: OpenShift Online Reporter: chunchen <chunchen>
Component: ContainersAssignee: Dan Mace <dmace>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: dmace, wsun, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: devenv_3340+ Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-24 14:52:36 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 chunchen 2013-06-08 03:13:27 UTC
Description of problem:
When installing the mongodb cartridge into an app, the connection url does not get displayed.

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

How reproducible:
always

Steps to Reproduce:
1. Create an app
rhc app create cpl00 perl-5.10 --no-git
2. Add mongodb to this app
rhc cartridge add mongodb-2.2 -a cpl00

Actual results:
<---------snip---------->
RESULT:
Added mongodb-2.2 to application cpl00
Embedded app details:  #here lost connection url#  
<---------snip---------->

Expected results:
should display connection url like "Embedded app details: Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT"

Additional info:
For mysql and postgresql, they are all ok, please refer to the following messages:

RESULT:
Added mysql-5.1 to application cpl00
Embedded app details: Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT

RESULT:
Added postgresql-8.4 to application cpl00
Embedded app details: Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT

Comment 1 Dan Mace 2013-06-10 13:18:43 UTC
Already fixed in devenv_3340+:

$ rhc cartridge add mongodb-2.2 -a cpl00 -pp
Adding mongodb-2.2 to application 'cpl00' ... Success

mongodb-2.2 (MongoDB NoSQL Database 2.2)
----------------------------------------
  Gears:          Located with perl-5.10
  Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/
  Database Name:  cpl00
  Password:       _jewjP8Bdsvl
  Username:       admin

RESULT:
Added mongodb-2.2 to application cpl00
Embedded app details: 
MongoDB 2.2 database added.  Please make note of these credentials:
   Root User:     admin
   Root Password: _jewjP8Bdsvl
   Database Name: cpl00
Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/

Comment 2 chunchen 2013-06-13 06:09:57 UTC
It's reproduced on devenv_3354, there are still not Mongo IPs and Port variables behind the string "Embedded app details:". please refer to the following results:


$ rhc cartridge add mongodb-2.2 -a cpl00 -pp
Adding mongodb-2.2 to application 'cpl00' ... Success

mongodb-2.2 (MongoDB NoSQL Database 2.2)
----------------------------------------
  Gears:          Located with perl-5.10
  Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/
  Database Name:  cpl00
  Password:       48DWBT-fdzn-
  Username:       admin

RESULT:
Added mongodb-2.2 to application cpl00
Embedded app details: 
MongoDB 2.2 database added.  Please make note of these credentials:
   Root User:     admin
   Root Password: 48DWBT-fdzn-
   Database Name: cpl00
Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/

Comment 3 chunchen 2013-06-13 06:55:59 UTC
FYI, the mysql and postgresql installation messages are as below:

$ rhc cartridge add mysql-5.1 -a cpl00
Adding mysql-5.1 to application 'cpl00' ... Success

mysql-5.1 (MySQL Database 5.1)
------------------------------
  Gears:          Located with perl-5.10, mongodb-2.2
  Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
  Database Name:  cpl00
  Password:       3DqAGfig4IWW
  Username:       adminNjCm6kG

RESULT:
Added mysql-5.1 to application cpl00
Embedded app details: Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT   <<<<<<<<<<

MySQL 5.1 database added.  Please make note of these credentials:
       Root User: adminNjCm6kG
   Root Password: 3DqAGfig4IWW
   Database Name: cpl00
Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
You can manage your new MySQL database by also embedding phpmyadmin-3.4.
The phpmyadmin username and password will be the same as the MySQL credentials above.

$ rhc cartridge add postgresql -a cpl00
Using postgresql-8.4 (PostgreSQL Database 8.4) for 'postgresql'
Adding postgresql-8.4 to application 'cpl00' ... Success

postgresql-8.4 (PostgreSQL Database 8.4)
----------------------------------------
  Gears:          Located with perl-5.10, mongodb-2.2, mysql-5.1
  Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT
  Database Name:  cpl00
  Password:       K_kPLeSNYlja
  Username:       adminpl8jawi

RESULT:
Added postgresql-8.4 to application cpl00
Embedded app details: Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT <<<<<<<

PostgreSQL 8.4 database added.  Please make note of these credentials:
   Root User: adminpl8jawi
   Root Password: K_kPLeSNYlja
   Database Name: cpl00
Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT

Comment 4 Dan Mace 2013-06-13 12:43:29 UTC
(In reply to chunchen from comment #3)

This is as designed; we don't want to expose the actual IP and ports from any of the APIs or client interfaces, as they are not portable and not recommended for use directly. Applications should always rely on the environment variables for IP and port addressing.

To be clear: the original bug was that the MongoDB IP and port was shown. The fix was to show the environment variable names instead.

If there are any remaining instances of actual IP and ports being shown to the client, please re-open the bug.

Thanks, and sorry for the confusion!

Comment 5 chunchen 2013-06-14 02:41:12 UTC
According to  Comment 4 and verified again on devenv_3358, the bug is fixed.