Bug 849035 - Env variable of Mongdb/postgresql/mysql aren't be removed after removing the db cartridge from scalable app
Env variable of Mongdb/postgresql/mysql aren't be removed after removing the ...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
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: 2012-08-17 03:00 EDT by Rony Gong
Modified: 2015-05-14 18:58 EDT (History)
4 users (show)

See Also:
Fixed In Version: devenv_2055+
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-17 17:29:36 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 Rony Gong 2012-08-17 03:00:00 EDT
Description of problem:
This error only happened for scalable app embed with mongodb-2.0, other senior(with mysql, non-scalable) can't happened.


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

How reproducible:
always

Steps to Reproduce:
1.Create a scalable app, embed mongodb-2.0
2.Remove mongodb, then ssh to this app, check env|grep NOSQL
3.
  
Actual results:
[qsphp-qgong10.dev.rhcloud.com ~]\> env|grep NOSQL
OPENSHIFT_NOSQL_DB_USERNAME=admin
OPENSHIFT_NOSQL_DB_TYPE=mongodb
OPENSHIFT_NOSQL_DB_URL=mongodb://admin:igXvpY8_77cr@81ab2b2048-qgong10.dev.rhcloud.com:38161/
OPENSHIFT_NOSQL_DB_GEAR_DNS=81ab2b2048-qgong10.dev.rhcloud.com
OPENSHIFT_NOSQL_DB_PASSWORD=igXvpY8_77cr
OPENSHIFT_NOSQL_DB_MONGODB_20_RESTORE=/usr/libexec/stickshift/cartridges/embedded/mongodb-2.0/info/bin/mongodb_restore.sh
OPENSHIFT_NOSQL_DB_MONGODB_20_DUMP_CLEANUP=/usr/libexec/stickshift/cartridges/embedded/mongodb-2.0/info/bin/mongodb_cleanup.sh
OPENSHIFT_NOSQL_DB_PORT=38161
OPENSHIFT_NOSQL_DB_MONGODB_20_EMBEDDED_TYPE=mongodb-2.0
OPENSHIFT_NOSQL_DB_GEAR_UUID=81ab2b20485549dab60c855ac11392bc
OPENSHIFT_NOSQL_DB_HOST=81ab2b2048-qgong10.dev.rhcloud.com
OPENSHIFT_NOSQL_DB_CTL_ONGEAR_SCRIPT=/var/lib/stickshift/81ab2b20485549dab60c855ac11392bc//mongodb-2.0/81ab2b2048_mongodb_ctl.sh
OPENSHIFT_NOSQL_DB_MONGODB_20_DUMP=/usr/libexec/stickshift/cartridges/embedded/mongodb-2.0/info/bin/mongodb_dump.sh
[qsphp-qgong10.dev.rhcloud.com ~]\> mongo
MongoDB shell version: 2.0.2
connecting to: 81ab2b2048-qgong10.dev.rhcloud.com:38161/admin
Fri Aug 17 02:53:26 Error: couldn't connect to server 81ab2b2048-qgong10.dev.rhcloud.com:38161 shell/mongo.js:86
exception: connect failed



Expected results:
should not show any env for output of env|grep NOSQL  
and could connect mongo by type "mongo"


Additional info:
Comment 1 Rony Gong 2012-08-17 06:05:23 EDT
Since if an app never embed mongodb before, we could type mongo and connect the mongodb of the product, like:
[qperl-qgong10.dev.rhcloud.com ~]\> mongo
MongoDB shell version: 2.0.2
connecting to: test

So if remove mongodb, we could use mongo command to connect mongodb also.
Comment 2 joycezhang 2012-08-17 06:40:43 EDT
This bug is also reproduced of mysql, postgresql and mongodb on scalable app. 
Non-scalable app can work fine.
>env|grep OPENSHIFT_DB
OPENSHIFT_DB_HOST=2329aaf250-joyceint2.int.rhcloud.com
OPENSHIFT_DB_MYSQL_51_RESTORE=/usr/libexec/stickshift/cartridges/embedded/mysql-5.1/info/bin/mysql_restore.sh
OPENSHIFT_DB_MYSQL_51_DUMP=/usr/libexec/stickshift/cartridges/embedded/mysql-5.1/info/bin/mysql_dump.sh
OPENSHIFT_DB_PASSWORD=Z8me7iHNnvDe
OPENSHIFT_DB_GEAR_UUID=2329aaf25039479f9f28097db25bd20b
OPENSHIFT_DB_USERNAME=admin
OPENSHIFT_DB_POSTGRESQL_84_RESTORE=/usr/libexec/stickshift/cartridges/embedded/postgresql-8.4/info/bin/postgresql_restore.sh
OPENSHIFT_DB_POSTGRESQL_84_DUMP_CLEANUP=/usr/libexec/stickshift/cartridges/embedded/postgresql-8.4/info/bin/postgresql_cleanup.sh
OPENSHIFT_DB_POSTGRESQL_84_EMBEDDED_TYPE=postgresql-8.4
OPENSHIFT_DB_MYSQL_51_EMBEDDED_TYPE=mysql-5.1
OPENSHIFT_DB_CTL_ONGEAR_SCRIPT=/var/lib/stickshift/2329aaf25039479f9f28097db25bd20b//mysql-5.1/2329aaf250_mysql_ctl.sh
OPENSHIFT_DB_URL=mysql://admin:Z8me7iHNnvDe@2329aaf250-joyceint2.int.rhcloud.com:44451/
OPENSHIFT_DB_SOCKET=/var/lib/stickshift/2329aaf25039479f9f28097db25bd20b//mysql-5.1/socket/mysql.sock
OPENSHIFT_DB_POSTGRESQL_84_DUMP=/usr/libexec/stickshift/cartridges/embedded/postgresql-8.4/info/bin/postgresql_dump.sh
OPENSHIFT_DB_TYPE=mysql
OPENSHIFT_DB_PORT=44451
OPENSHIFT_DB_GEAR_DNS=2329aaf250-joyceint2.int.rhcloud.com
OPENSHIFT_DB_MYSQL_51_DUMP_CLEANUP=/usr/libexec/stickshift/cartridges/embedded/mysql-5.1/info/bin/mysql_cleanup.sh
[pyths2-joyceint2.int.rhcloud.com ~]\> psql
psql: could not connect to server: Connection refused
	Is the server running on host "2329aaf250-joyceint2.int.rhcloud.com" and accepting
	TCP/IP connections on port 44451?
Comment 3 Mrunal Patel 2012-08-21 11:19:32 EDT
Fixed - https://github.com/openshift/crankcase/pull/415
Comment 4 Rony Gong 2012-08-22 06:35:32 EDT
Reopen on devenv_2050, still show some env of DB, grep by db_uuid
mongodb:
[ ~]\> env|grep bb9
OPENSHIFT_NOSQL_DB_GEAR_DNS=bbb912f2ba-qgong2.dev.rhcloud.com
OPENSHIFT_NOSQL_DB_CTL_ONGEAR_SCRIPT=/var/lib/stickshift/bbb912f2ba1b4e35bf34d103b5b30694//mongodb-2.0/bbb912f2ba_mongodb_ctl.sh

mysql:
[ ~]\> env|grep 558
OPENSHIFT_DB_HOST=55825e9c79-qgong2.dev.rhcloud.com
OPENSHIFT_DB_GEAR_UUID=55825e9c79ef49bab0de3202e4b3c8f7
OPENSHIFT_DB_CTL_ONGEAR_SCRIPT=/var/lib/stickshift/55825e9c79ef49bab0de3202e4b3c8f7//mysql-5.1/55825e9c79_mysql_ctl.sh
OPENSHIFT_DB_URL=mysql://admin:y-mb1-xJNXx_@55825e9c79-qgong2.dev.rhcloud.com:35566/
OPENSHIFT_DB_SOCKET=/var/lib/stickshift/55825e9c79ef49bab0de3202e4b3c8f7//mysql-5.1/socket/mysql.sock
OPENSHIFT_DB_GEAR_DNS=55825e9c79-qgong2.dev.rhcloud.com

postgresql
env|grep e2e80
OPENSHIFT_DB_CTL_ONGEAR_SCRIPT=/var/lib/stickshift/e2e806b5dfdc420eb392775eae0ab911//postgresql-8.4/e2e806b5df_postgresql_ctl.sh
OPENSHIFT_DB_GEAR_DNS=e2e806b5df-qgong2.dev.rhcloud.com
Comment 5 Dan Mace 2012-08-22 10:51:56 EDT
Cannot reproduce the bug with devenv_2051. Please re-test with devenv_2051+.
Comment 6 Dan Mace 2012-08-22 10:52:35 EDT
Disregard comment #5, I reproduced some of the bugs and forgot to clear the comment box prior to taking the issue.
Comment 7 Dan Mace 2012-08-22 11:24:00 EDT
A new pull request is now pending to resolve the remaining issues:

https://github.com/openshift/crankcase/pull/423

Still waiting for external test/review before merging, but wanted to make sure everybody is aware it's already in progress.
Comment 8 Dan Mace 2012-08-22 15:53:49 EDT
Fixed in devenv_2055+.
Comment 9 Rony Gong 2012-08-22 22:54:06 EDT
Verified in INT(devenv_2058)
First embed mysql, mongodb, postgresql, then remove them.

[qsphp-qgong.int.rhcloud.com ~]\> env|grep DB
[qsphp-qgong.int.rhcloud.com ~]\>

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