Bug 1035237 - An warning message should be thrown out instead of error message when restore a app with postgresql-8.4 (and postgresl-9.2) cartridge
Summary: An warning message should be thrown out instead of error message when restore...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 2.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1003531
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-27 11:04 UTC by Johnny Liu
Modified: 2017-03-08 17:35 UTC (History)
7 users (show)

Fixed In Version: openshift-origin-cartridge-postgresql-1.17.3.2
Doc Type: Bug Fix
Doc Text:
Clone Of: 1003531
Environment:
Last Closed: 2014-01-13 14:54:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0020 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.0.1 bug fix and enhancement update 2014-01-21 21:52:52 UTC

Description Johnny Liu 2013-11-27 11:04:45 UTC
+++ This bug was initially created as a clone of Bug #1003531 +++

Description of problem:
When restore an app with postgresql-8.4 cartridge, it can restore successfully but it reveal following error messages :
Restoring from snapshot jbos6.tar.gz...
Warning: Permanently added the RSA host key for IP address '107.22.51.207' to the list of known hosts.
Sending SIGTERM to jboss:7696 ...
Removing old git repo: ~/git/jbos6.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/jbos6.git and ~/app-root/data
Restoring snapshot for postgresql-8.4 gear
Removing old data dir: ~/app-root/data/*
Restoring ~/app-root/data
ERROR:  database "jbos6" already exists
RESULT:
Success
But if it is other database like mysql-5.1 , there is no such error messages.

Version-Release number of selected component (if applicable):
devenv-stage_435
devenv_3605

How reproducible:
100%

Steps to Reproduce:
1. Create a jbosseap-6.0 app 
#rhc app create jbos6 jbosseap-6.0 -s
2. Add postgresql to the jbosseap-6.0 app
#rhc cartridge add -c postgresql-8.4 -a jbos6
3. Write some data to ../data dir in the app gear and add some data to postgresql
4. Take snapshot for this app
#rhc snapshot save $app
5.Create a jbosseap-6.0 app 
6. Add postgresql to the jbosseap-6.0 app
7. snapshot restore this app with that saved $app.tar.gz
#rhc snapshot restore $app -f $app.tar.gz

Actual results:
App is restore successfully but it throw this error message - "ERROR:  database "jbos6" already exists".

Expected results:
App is restore successfully and it no error messages.
Additional info:
I think it should throw warning message instead of error message.

--- Additional comment from Ben Parees on 2013-11-18 17:32:28 EST ---

this appears to be because we are renaming the existing DB to the same name (eg "alter database jbos6 rename to jbos6" which triggers the error.

Will look into avoiding this rename when it is not needed.

--- Additional comment from openshift-github-bot on 2013-11-20 11:42:54 EST ---

Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/b6b0d1aadc1b5685b1d32976b31d0c674148929c
Bug 1003531: An warning message should be thrown out instead of error message when restore a app with postgresql-8.4 (and postgresl-9.2) cartridge

--- Additional comment from Ben Parees on 2013-11-20 12:33:09 EST ---

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

--- Additional comment from Nan Wei on 2013-11-21 00:52:47 EST ---

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

1. Create a ruby app and add db
#rhc app create ruby19 ruby-1.9 postgresql-9.2
2. Write some data to ../data dir in the app gear and add some data to postgresql
>psql
>create table perl (city varchar(80),temp_lo  int, temp_hi int, prcp real, date date);
3. Take snapshot for this app
#rhc snapshot save $app
4. Modify some data in the repo and git push 
5. snapshot restore this app with that saved $app.tar.gz
#rhc snapshot restore $app -f $app.tar.gz
Restoring from snapshot ruby19.tar.gz...
Warning: Permanently added 'ruby19-nweid.dev.rhcloud.com,23.22.167.73' (RSA) to the list of known hosts.
Removing old git repo: ~/git/ruby19.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/ruby19.git and ~/app-root/data
Activation status: success

Comment 2 Luke Meyer 2013-12-10 15:12:26 UTC
https://github.com/openshift/enterprise-server/pull/162

Author:     Ben Parees <bparees>
AuthorDate: Tue Nov 19 11:38:50 2013 -0500
Commit:     Luke Meyer <lmeyer>
CommitDate: Thu Dec 5 17:49:08 2013 -0500

    Bug 1003531: An warning message should be thrown out instead of error message when restore a app with postgresql-8.4 (and postgresl-9.2) cartridge

    bug 1035237
    https://bugzilla.redhat.com/show_bug.cgi?id=1035237
    b6b0d1aadc1b5685b1d32976b31d0c674148929c #cherrypick

Comment 3 Luke Meyer 2013-12-12 23:19:25 UTC
openshift-origin-cartridge-postgresql-1.17.3.2 actually built now and should be in next 2.0 puddle. On brew at  http://download.devel.redhat.com/brewroot/packages/openshift-origin-cartridge-postgresql/1.17.3.2/1.el6op/noarch/openshift-origin-cartridge-postgresql-1.17.3.2-1.el6op.noarch.rpm

Comment 4 Nan Wei 2013-12-16 05:23:32 UTC
OpenShift Enterprise puddle: 2.0/2013-12-09.3
[root@node1 ~]# rpm -qa|grep openshift-origin-cartridge-postgresql
openshift-origin-cartridge-postgresql-1.17.3-2.el6op.noarch

1. Create a jbosseap-6.0 app with db
#rhc app create js6 jbosseap postgresql-9.2 -s
2. Take snapshot for this app
#rhc snapshot save $app
3. Write some data to ../data dir in the app gear and add some data to postgresql
4. snapshot restore this app with that saved $app.tar.gz
#rhc snapshot restore $app -f $app.tar.gz
Restoring from snapshot js6.tar.gz...
Warning: Permanently added 'js6-nweidomain.ose-1209.com.cn,10.4.59.210' (RSA) to the list of known hosts.
Removing old git repo: ~/git/js6.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/js6.git and ~/app-root/data
Restoring snapshot for postgresql-9.2 gear
Removing old data dir: ~/app-root/data/*
Restoring ~/app-root/data
ERROR:  database "js6" already exists
Activation status: success

RESULT:
Success

Error message exists yet. And the code in "cartridges/openshift-origin-cartridge-postgresql/bin/control" file is old.

Comment 5 Luke Meyer 2013-12-23 21:27:34 UTC
Please try to verify again; openshift-origin-cartridge-postgresql-1.17.3-2.el6op.noarch is not as new as openshift-origin-cartridge-postgresql-1.17.3.2, and the latter is available now. Sorry for putting this ON_QA previously before the puddle was out.

Comment 6 Nan Wei 2013-12-24 05:09:53 UTC
OpenShift Enterprise 2.0.1 puddle: [2.0.z/2013-12-16.2] 
[root@node1 ~]# rpm -qa|grep openshift-origin-cartridge-postgresql
openshift-origin-cartridge-postgresql-1.17.3.3-1.el6op.noarch

1. Create a ruby app with db
#rhc app create ruby19 ruby-1.9 postgresql-9.2
2. Take snapshot for this app
#rhc snapshot save $app
3. Write some data to ../data dir in the app gear and add some data to postgresql
4. snapshot restore this app with that saved $app.tar.gz
#rhc snapshot restore $app -f $app.tar.gz
Restoring from snapshot ruby19.tar.gz...
Warning: Permanently added 'ruby19-nweidomain.ose20-1216-com.cn,10.4.59.171' (RSA) to the list of known hosts.
Removing old git repo: ~/git/ruby19.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/ruby19.git and ~/app-root/data


Activation status: success

RESULT:
Success

Comment 8 errata-xmlrpc 2014-01-13 14:54:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0020.html


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