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.
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.
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
https://github.com/openshift/origin-server/pull/4202
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