Bug 980760
Summary: | [origin_runtime_157]Postgresql-8.4 and postgresql-9.2 shouldn't be added to the same app | ||
---|---|---|---|
Product: | OpenShift Online | Reporter: | Yan Du <yadu> |
Component: | Pod | Assignee: | Abhishek Gupta <abhgupta> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | libra bugs <libra-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 2.x | CC: | hasari, qiuzhang, yujzhang |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | devenv_3489 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-07-22 15:20:17 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: | |||
Bug Depends On: | |||
Bug Blocks: | 980739 |
Description
Yan Du
2013-07-03 08:00:53 UTC
From website console, it will fail when adding postgresql-8.4 and postgresql-9.2 with the following error message: Cartridge createdb: database creation failed: ERROR: database "python" already exists /var/lib/openshift/920236177523642741030912/postgresql/bin/post_install: line 18: error: command not found We should have a more friendly error message for the failure, at least reduce the code error. *** Bug 980739 has been marked as a duplicate of this bug. *** The addition of postgresql-8.4 succeeds presumably because $PATH is somehow amenable to such a maneuver in this scenario; CLI manages to connect to the new PostgreSQL 8.4 instance instead of the existing 9.2 installation. If 979442 cannot be fixed in a timely manner, we will need to get around this problem by fixing the CLI case. For a more friendly error message, I guess we can just trap the PostgreSQL error (duplicate schema name). *** Bug 979442 has been marked as a duplicate of this bug. *** Fixed with --> https://github.com/openshift/origin-server/pull/3024 Note to QE: We have now fixed this both during initial application creation as well as when adding a cartridge to an existing application. As part of the verification for this bug, in addition to the test cases related to this bug, please also run regression tests for: 1. Application creation with multiple cartridges 2. Adding a cartridge to an application 3. Adding downloadable (manifest URL) cartridges 4. Removing a cartridge from an application (both redhat carts as well as downloadable carts) Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/82fff217b1c0cac0258e695d0918091bb27a0c0b Fix for bug 980760 - Preventing multiple versions of a cartridge from being added to the application The message can be a little off: https://github.com/openshift/origin-server/pull/3024/files#r5114152 $ bx bin/rhc cartridge add postgresql-8.4 -a rack Adding postgresql-8.4 to application 'rack' ... postgresql-8.4 cannot co-exist with application cartridge postgresql-9.2 It's not a big problem, of course. Changed the error message to be more clear based on feedback received from Hiro. https://github.com/openshift/origin-server/pull/3049 Fixed in devenv_3480 verified on devenv_3481 rhc-1.11.4 postgresql-8.4 and postgresql-9.2 still can be added to same app, if added a download cartridge steps to reproduce: 1. prepare a postgresql-9.2 download cartridge 2. rhc app create r19 ruby-1.9 postgresql-8.4 3. cadd -a r19 https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml 4. rhc app show r19 [root@localhost ~]# rhc app show r19 r19 @ http://r19-aaa.dev.rhcloud.com/ (uuid: 222748430800175419621376) ---------------------------------------------------------------------- Created: 12:37 AM Gears: 1 (defaults to small) Git URL: ssh://222748430800175419621376.rhcloud.com/~/git/r19.git/ SSH: 222748430800175419621376.rhcloud.com ruby-1.9 (Ruby 1.9) ------------------- Gears: Located with postgresql-8.4, dy-dypostgresql-9.2 postgresql-8.4 (PostgreSQL Database 8.4) ---------------------------------------- Gears: Located with ruby-1.9, dy-dypostgresql-9.2 Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT Database Name: r19 Password: z7lzjHbNbqxR Username: adminpjztiks dy-dypostgresql-9.2 (PostgreSQL Database 9.2) --------------------------------------------- From: https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml Gears: Located with ruby-1.9, postgresql-8.4 Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT Database Name: r19 Password: M_3HMQz3FZxf Username: adminevxywgu show the confict infomation Application creation with multiple cartridges and Adding a cartridge to an application root@Daphne test]# rhc app create php php-5.3 postgresql-8.4 postgresql-9.2 Application Options ------------------- Namespace: 111 Cartridges: php-5.3, postgresql-8.4, postgresql-9.2 Gear Size: default Scaling: no Creating application 'php' ... postgresql-9.2 cannot co-exist with postgresql-8.4 in the same application [root@localhost test]# rhc cartridge add -a r18 -c postgresql-9.2 Adding postgresql-9.2 to application 'r18' ... postgresql-9.2 cannot co-exist with cartridge postgresql-8.4 in your application [root@localhost ~]# rhc cartridge add -a j2s -c postgresql-8.4 Adding postgresql-8.4 to application 'j2s' ... postgresql-8.4 cannot co-exist with cartridge postgresql-9.2 in your application pls. just ignore #Comment 11 Retest the issue on devenv_3483 and do regression test according #Comment 6 rhc-1.11.4 1. Application creation with multiple cartridges root@Daphne test]# rhc app create php php-5.3 postgresql-8.4 postgresql-9.2 Application Options ------------------- Namespace: 111 Cartridges: php-5.3, postgresql-8.4, postgresql-9.2 Gear Size: default Scaling: no Creating application 'php' ... postgresql-9.2 cannot co-exist with postgresql-8.4 in the same application 2. Adding a cartridge to an application [root@localhost test]# rhc cartridge add -a r18 -c postgresql-9.2 Adding postgresql-9.2 to application 'r18' ... postgresql-9.2 cannot co-exist with cartridge postgresql-8.4 in your application [root@localhost ~]# rhc cartridge add -a j2s -c postgresql-8.4 Adding postgresql-8.4 to application 'j2s' ... postgresql-8.4 cannot co-exist with cartridge postgresql-9.2 in your application 3. Adding downloadable (manifest URL) cartridges [root@Daphne test]# rhc cartridge add -a j2 https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml The cartridge 'https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml' will be downloaded and installed Adding https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml to application 'j2' ... done dy-dypostgresql-9.2 (PostgreSQL Database 9.2) --------------------------------------------- From: https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml Gears: Located with jbossews-2.0 Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT Database Name: j2 Password: kfKzt7TpEl5Z Username: adminlimhmtj PostgreSQL 9.2 database added. Please make note of these credentials: Root User: adminlimhmtj Root Password: kfKzt7TpEl5Z Database Name: j2 Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT [j2-111.dev.rhcloud.com 332107186515648966557696]\> psql psql (9.2.4) Type "help" for help. 4. Removing a cartridge from an application (both redhat carts as well as downloadable carts) [root@localhost ~]# rhc cartridge remove -a php -c postgresql-9.2 Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge. Are you sure you wish to remove postgresql-9.2 from 'php'? (yes|no): yes Removing postgresql-9.2 from 'php' ... removed [root@localhost ~]# rhc cartridge remove -a j2 -c dy-dypostgresql-9.2 Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge. Are you sure you wish to remove dy-dypostgresql-9.2 from 'j2'? (yes|no): yes Removing dy-dypostgresql-9.2 from 'j2' ... removed 5. still a little problem when add a download psql-9.2 to a app with redhat-psql-9.2 embedded. it will shown "dy-dypostgresql-9.2 cannot co-exist with cartridge dy-dypostgresql-9.2 in your application" [root@localhost ~]# rhc cartridge add -a phps -c postgresql-9.2 Adding postgresql-9.2 to application 'phps' ... done postgresql-9.2 (PostgreSQL Database 9.2) ---------------------------------------- Gears: 1 small Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT Database Name: phps Password: QdTceBsaS4US Username: adminb6dtusd PostgreSQL 9.2 database added. Please make note of these credentials: Root User: adminb6dtusd Root Password: QdTceBsaS4US Database Name: phps Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT [root@localhost ~]# rhc cartridge add -a phps https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml The cartridge 'https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml' will be downloaded and installed Adding https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml to application 'phps' ... dy-dypostgresql-9.2 cannot co-exist with cartridge dy-dypostgresql-9.2 in your application Fixed with --> https://github.com/openshift/origin-server/pull/3068 Also, we are now removing downloaded cart manifest entry from application document in mongo (downloaded_cart_map list) if adding a url based cart fails. Please verify this fix as well. Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/5aa387e1deb2a66410fb9a08502261d3bccff1b5 Fix for bug 980760 - fixing error message on validation failure - removing downloaded cart manifest entry from app if adding a url based cart fails Test on devenv_3489 rhc-1.11.4 [root@localhost ~]# rhc cartridge add -a j1 https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml The cartridge 'https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml' will be downloaded and installed Adding https://raw.github.com/duyanyan/dypostgresql/master/metadata/manifest.yml to application 'j1' ... dy-dypostgresql-9.2 cannot co-exist with cartridge postgresql-9.2 in your application move to verified. |