Bug 849543

Summary: Should remind user about password changing for phpmyadmin and rockmongo after re-adding mysql and mongodb
Product: OKD Reporter: Wei Sun <wsun>
Component: ContainersAssignee: Rob Millner <rmillner>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 2.xCC: dmace, johnp, mfisher, xtian
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-06 18:48:26 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 Wei Sun 2012-08-20 07:21:15 UTC
Description of problem:
When I embed phpmyadmin or rockmongo to my application,I could get information of login about user name and user password.Then I remove mysql or mongodb,and embedded them again,I can't use name and password that were prompted when embedding phpmyadmin or rockmongo to login phpmyadmin or rockmongo .

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

How reproducible:
always

Steps to Reproduce:
1.add mysql or mongodb to an application
[sunwei@dhcp-8-229 dev]$ rhc app cartridge add -a php1 -c mysql-5.1 -d -p x
Contacting https://ec2-23-22-147-56.compute-1.amazonaws.com
Response from server:
DEBUG:
Embedded app details: Connection URL: mysql://127.0.254.1:3306/

Exit Code: 0
broker_c: ["namespace", "rhlogin", "ssh", "app_uuid", "debug", "alter", "cartridge", "cart_type", "action", "app_name", "api"]
api_c: ["placeholder"]
API version:    1.1.3

RESULT:

MySQL 5.1 database added.  Please make note of these credentials:

   Root User: admin
   Root Password: wU7bviFnZ-1r
   Database Name: php1

Connection URL: mysql://127.0.254.1:3306/

You can manage your new MySQL database by also embedding phpmyadmin-3.4.

2.add phpmyadmin-3.4 to application

[sunwei@dhcp-8-229 dev]$ rhc app cartridge add -a php1 -c phpmyadmin-3.4 -d -p x
Contacting https://ec2-23-22-147-56.compute-1.amazonaws.com
Response from server:
DEBUG:
Embedded app details: URL: https://php1-wsundev820.dev.rhcloud.com/phpmyadmin/

Exit Code: 0
broker_c: ["namespace", "rhlogin", "ssh", "app_uuid", "debug", "alter", "cartridge", "cart_type", "action", "app_name", "api"]
api_c: ["placeholder"]
API version:    1.1.3

RESULT:

phpMyAdmin 3.4 added.  Please make note of these MySQL credentials again:

   Root User: admin
   Root Password: wU7bviFnZ-1r

URL: https://php1-wsundev820.dev.rhcloud.com/phpmyadmin/

3.use the information of phpMyAdmin(Root User: admin  Root Password:wU7bviFnZ-1r) to login URL:https://php1-wsundev820.dev.rhcloud.com/phpmyadmin/

4.remove mysql or mongodb
5.embed mysql or mongodb
  [sunwei@dhcp-8-229 dev]$ rhc app cartridge add -a php1 -c mysql-5.1 -d -p x
Contacting https://ec2-23-22-147-56.compute-1.amazonaws.com
Response from server:
DEBUG:
Embedded app details: Connection URL: mysql://127.0.254.1:3306/

Exit Code: 0
broker_c: ["namespace", "rhlogin", "ssh", "app_uuid", "debug", "alter", "cartridge", "cart_type", "action", "app_name", "api"]
api_c: ["placeholder"]
API version:    1.1.3

RESULT:

MySQL 5.1 database added.  Please make note of these credentials:

   Root User: admin
   Root Password: msv-HfHQcc7_
   Database Name: php1

Connection URL: mysql://127.0.254.1:3306/

You can manage your new MySQL database by also embedding phpmyadmin-3.4.

6. login phpmyadmin-3.4 using the username and password of phpmyadmin

Actual results:

Can't login using the username and password of phpmyadmin

Expected results:

User should be able to login using the username and password of phpmyadmin,or prompt user to use name and password of mysql

Additional info:
use mysql's user and password ,can login

Comment 1 Dan Mace 2012-08-20 14:52:12 UTC
This is as designed:

- Phpmyadmin is configured to use the 'http' authentication style, which means users are authenticated against the underlying database, NOT a Phpmyadmin user database

- Rockmongo is configured to use 'mongo_auth', which behaves the same as Phpmyadmin in thise case, authenticating users against the Mongo database

So, if the users in the underlying databases are changed (either manually or because the db itself has been recreated), the new credentials will be used to log in to the respective web interfaces.

There may be grounds here to open a UI bug to make it more clear when a database cartridge is added and rockmongo/phpmyadmin is present to present a note to the user reminding them that they'll use the new credentials to log in.

Comment 2 John (J5) Palmieri 2012-10-09 14:32:57 UTC
We need a dependency story so we don't special case databases.  If there is some sort of dependency that the user should be aware of we should have infrastructure for grabbing that info and notifying the user.  Simply special casing the DB's is not scalable if we start to add a lot more cartridges.

Comment 3 Clayton Coleman 2012-10-17 18:49:52 UTC
Why can't the cartridge return this info as part of the cartridge add in text?

Comment 4 Rob Millner 2012-10-26 21:48:43 UTC
Added an informative message to the MySQL and MongoDB cartridges.

https://github.com/openshift/origin-server/pull/777

Comment 5 Xiaoli Tian 2012-10-29 02:36:37 UTC
(In reply to comment #4)
> Added an informative message to the MySQL and MongoDB cartridges.
> 
> https://github.com/openshift/origin-server/pull/777

Move it to ON_QA since above pull request is already merged in master

Comment 6 Wei Sun 2012-10-29 08:37:25 UTC
verified on devenv_2397

Step:
1.create an application
2.add mysql to application

Result:
[sunwei@dhcp-8-229 client]$  rhc app cartridge add -a phptest -c mysql-5.1 -d -p x
Contacting https://ec2-107-20-129-203.compute-1.amazonaws.com
Response from server:
DEBUG:
Embedded app details: Connection URL: mysql://127.1.5.129:3306/

Exit Code: 0
api_c: ["placeholder"]
broker_c: ["namespace", "rhlogin", "ssh", "app_uuid", "debug", "alter", "cartridge", "cart_type", "action", "app_name", "api"]
API version:    1.1.3

RESULT:

MySQL 5.1 database added.  Please make note of these credentials:

   Root User: admin
   Root Password: VRm447Qb8RPT
   Database Name: phptest

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.