Bug 962657 - The RESULT content is not consistent when adding db cartridges which makes website can not display username and password when adding mongodb.
The RESULT content is not consistent when adding db cartridges which makes we...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Dan Mace
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-14 03:41 EDT by Yujie Zhang
Modified: 2015-05-14 19:18 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-11 00:03:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Yujie Zhang 2013-05-14 03:41:53 EDT
Description of problem:

Create an application using rhc and add mysql cartridge, then add postgresql cartridge, found that the result content is not consistent, for the result content when adding postgresql miss username and password, so there is no username and password info return when adding postgresql from website.

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

How reproducible:
always

Steps to Reproduce:
1.Create an application and add mysql cartridge using rhc
2.Add postgresql cartridge using rhc
3.Add postgresql catridge using website
  
Actual results:

The result content is as following when adding mysql cartridge:

testapp @ http://testapp-testnamespace.dev.rhcloud.com/
  (uuid: 5191dfdc602cec0766000001)
-------------------------------------------------------
  Created: 2:55 PM
  Gears:   1 (defaults to small)
  Git URL: ssh://5191dfdc602cec0766000001@testapp-testnamespace.dev.rhcloud.com/~/git/testapp.git/
  SSH:     5191dfdc602cec0766000001@testapp-testnamespace.dev.rhcloud.com

  php-5.3 (PHP 5.3)
  -----------------
    Gears: Located with mysql-5.1

  mysql-5.1 (MySQL Database 5.1)
  ------------------------------
    Gears:          Located with php-5.3
    Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
    Database Name:  testapp
    Password:       Ajt5aUcDN-aN
    Username:       adminCVXJJi9

RESULT:
Application testapp was created.
MySQL 5.1 database added.  Please make note of these credentials:
       Root User: adminCVXJJi9
   Root Password: Ajt5aUcDN-aN
   Database Name: testapp
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.

The result content is as following when adding postgresql:

testapp2 @ http://testapp2-testnamespace.dev.rhcloud.com/
  (uuid: 662209908578744923062272)
---------------------------------------------------------
  Created: 2:57 PM
  Gears:   1 (defaults to small)
  Git URL: ssh://662209908578744923062272@testapp2-testnamespace.dev.rhcloud.com/~/git/testapp2.git/
  SSH:     662209908578744923062272@testapp2-testnamespace.dev.rhcloud.com

  php-5.3 (PHP 5.3)
  -----------------
    Gears: Located with postgresql-8.4

  postgresql-8.4 (PostgreSQL Database 8.4)
  ----------------------------------------
    Gears:          Located with php-5.3
    Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT
    Database Name:  testapp2
    Password:       PdlzXFl7FJ4t
    Username:       adminaagjtin

RESULT:
Application testapp2 was created.
Connection URL:
postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT

Expected results:

The RESULT content should be consistent when adding db catridges, and adding postgresql from website should return username and password.

Additional info:
Comment 1 Jhon Honce 2013-05-14 12:09:49 EDT
Are you saying when using the web interface you do not see the second databases credentials?
Comment 2 Yujie Zhang 2013-05-14 20:22:56 EDT
Yes,there is no username and password of database after adding postgresql from website.
Comment 3 Jhon Honce 2013-05-15 20:24:29 EDT
Since the rhc commands provide the expected output, I believe this is a website issue rather than a node issue.
Comment 4 Clayton Coleman 2013-05-23 13:12:42 EDT
This is the values the REST API returns to us.
Comment 5 Lili Nader 2013-05-24 14:17:54 EDT
The client only displays what gets returned from node as "CLIENT_RESULT".  In case of postgres only connection URL is returned and needs to be fixed in the cartridge.

Returned from postgres cartridge
CLIENT_RESULT: Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT


Returned from mysql cartridge
CLIENT_RESULT: MySQL 5.1 database added.  Please make note of these credentials:
CLIENT_RESULT:    Root User: [HIDDEN]
CLIENT_RESULT:    Root Password: [HIDDEN]
CLIENT_RESULT:    Database Name: app
CLIENT_RESULT: Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
CLIENT_RESULT: You can manage your new MySQL database by also embedding phpmyadmin-3.4.
CLIENT_RESULT: The phpmyadmin username and password will be the same as the MySQL credentials above.
Comment 6 Dan Mace 2013-05-24 17:31:47 EDT
Fotios:

The postgresql install script needs the following:

client_result ""
client_result "PostgreSQL ${version} database added.  Please make note of these credentials:"
client_result ""
client_result "   Root User: ${username}"
client_result "   Root Password: ${password}"
client_result ""
client_result "Connection URL: ${conn_url}"
client_result ""

During the course of testing this, I noticed the initial postgres db is now coming from a statically built tarball. However, the expectation is that the initial database name will follow the app name; I see no code in install to account for this, and using `psql` from a shell in the new gear errors as it expects to connect to a database name matching the app name.

Please address both the credential reporting with client_result entries and also fix the database naming as part of this issue (ensuring to also report the database name in the client_result entries).
Comment 8 Dan Mace 2013-05-25 07:32:08 EDT
Fotios: I found the database setup code I had missed before, and corrected the remaining client_result issue.
Comment 9 openshift-github-bot 2013-05-25 08:49:09 EDT
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/6ddaff5ce1c41d4a7f452727097ea7cae1834b26
Bug 962657: Return db info to client during postgres install
Comment 10 Yujie Zhang 2013-05-27 06:22:48 EDT
Tested on devenv_3277, it can display username and password when adding postgresql and mysql, but can not display username and password of mongodb this time, could you please help to check again?Thanks!
Comment 12 openshift-github-bot 2013-05-28 12:14:18 EDT
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/5ab6507853f67e15098e4a22cc9c8282c34ee2cd
Bug 962657: Add client result for mongodb credentials during install
Comment 14 Yujie Zhang 2013-05-29 02:59:44 EDT
Tested on devenv_3282, the there is username and password when adding mysql,postgresql and mongo db to application, so verify this bug, thanks.

Note You need to log in before you can comment on or make changes to this bug.