Description of problem: Get error while using snapshot tarball of previous app to restore a new app. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.Create a nodejs app and embed postgresql to it 2.Write some data to the postgresql database <--------code snippets---------> // Handler for GET /data1 app.get('/data1.js', function(req, res){ var client = new pg.Client(conString); client.connect(); client.query("DROP TABLE IF EXISTS info"); client.query("CREATE TABLE info(id integer PRIMARY KEY, data text)"); client.query("INSERT INTO info VALUES(1, '#str_random1#')"); client.end(); <------------------------------> 3. Take snapshot of the app 4. Destroy the app 5. Create a new nodejs app and embed postgresql to it 6. Use the snapshot tarball to restore the new app. 7. Check the data of postgresql database <-----------code snippets-----------> // Handler for GET /show app.get('/show.js', function(req, res){ var client = new pg.Client(conString); client.connect(); var query = client.query("SELECT data FROM info"); query.on('row', function(row) { result = row.data; }); query.on('error', function(error) { client.end(); res.send('Failed to get data from database', {'Content-Type': 'text/plain'}); }); query.on('end', function() { client.end(); res.send(result, {'Content-Type': 'text/plain'}); }); }); <-----------------------------------> Actual results: 6. Get error message during restoring <---------output------------> Stopping application... Done Removing old git repo: ~/git/app2.git/ Removing old data dir: ~/app2/data/* Restoring ~/git/app2.git and ~/app2/data Running extra restore: postgresql_restore.sh ERROR: role "0068cce8b240437aa9524304b343b9bc" does not exist ERROR: role "0068cce8b240437aa9524304b343b9bc" does not exist ERROR: role "0068cce8b240437aa9524304b343b9bc" does not exist \connect: FATAL: database "app2" does not exist Error: Could not import PostgreSQL Database! Continuing... Running .openshift/action_hooks/pre_build Running .openshift/action_hooks/build PostgreSQL server instance already running Running .openshift/action_hooks/deploy Starting application... PostgreSQL server instance already running Done Running .openshift/action_hooks/post_deploy <---------------------------> 7. Get "Proxy Error" on the webpage. Here's log of the app <-----------log--------------> Fri Feb 24 2012 06:22:34 GMT-0500 (EST): Node server started on 127.0.250.1:8080 ... events.js:48 throw arguments[1]; // Unhandled 'error' event ^ Error: FATAL: password authentication failed for user "admin" at Connection.<anonymous> (/usr/lib/node_modules/pg/lib/native/index.js:138:17) at Connection.emit (events.js:67:17) <-------------------------------> Expected results: PostgreSQL data should be restored without error. Additional info:
Found this bug on devenv_1634.
Fixed postgresql snapshot and restore to handle new user/app names with git commit 78ea2686e500d1f141c990849507a59c4396a8c8
verify fixed on devenv_1642, with rhc-cartridge-postgresql-8.4-0.4.3-1.el6_2.noarch, issue has been fixed.