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
Summary: An warning message should be thrown out instead of error message when restore...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1035237
TreeView+ depends on / blocked
 
Reported: 2013-09-02 09:48 UTC by Nan Wei
Modified: 2015-05-15 00:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1035237 (view as bug list)
Environment:
Last Closed: 2014-01-24 03:33:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nan Wei 2013-09-02 09:48:31 UTC
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 22:32:28 UTC
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 16:42:54 UTC
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 05:52:47 UTC
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.