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
An warning message should be thrown out instead of error message when restore...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Image (Show other bugs)
2.x
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Ben Parees
libra bugs
:
Depends On:
Blocks: 1035237
  Show dependency treegraph
 
Reported: 2013-09-02 05:48 EDT by Nan Wei
Modified: 2015-05-14 20:34 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1035237 (view as bug list)
Environment:
Last Closed: 2014-01-23 22:33:39 EST
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 Nan Wei 2013-09-02 05:48:31 EDT
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.
Comment 1 Ben Parees 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.
Comment 2 openshift-github-bot 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
Comment 4 Nan Wei 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

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