Bug 879935

Summary: [rhevm-upgrade] rhevm-upgrade should remove newly created pgpass in case of upgrade fails
Product: Red Hat Enterprise Virtualization Manager Reporter: Haim <hateya>
Component: ovirt-engine-setupAssignee: Alex Lourie <alourie>
Status: CLOSED DUPLICATE QA Contact: Pavel Stehlik <pstehlik>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: bazulay, dyasny, iheim, mgoldboi, Rhev-m-bugs, sgrinber, yeylon, ykaul
Target Milestone: ---   
Target Release: 3.1.2   
Hardware: x86_64   
OS: Linux   
Whiteboard: integration
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-11 12:49:04 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
rhevm-upgrade logs none

Description Haim 2012-11-25 10:48:29 EST
Description of problem:

after failed upgrade, and manual rollback, rhevm uses wrong .pgpass file located under /etc/ovirt-engine/.pgpass and not under ~/.root/.pgpass which fails authentication to data-base on next upgrade.

Would you like to proceed? (yes|no): 
2012-11-25 16:46:57::DEBUG::common_utils::868::root:: user answered: yes
2012-11-25 16:46:58::DEBUG::common_utils::361::root:: running sql query 'SELECT compatibility_version FROM storage_pool;' on db server: 'localhost'.
2012-11-25 16:46:58::DEBUG::common_utils::302::root:: Executing command --> '/usr/bin/psql -h localhost -p 5432 -U postgres -d rhevm -c SELECT compatibility_version FROM storage_pool;'
2012-11-25 16:46:58::DEBUG::common_utils::340::root:: output = 
2012-11-25 16:46:58::DEBUG::common_utils::341::root:: stderr = psql: FATAL:  password authentication failed for user "postgres"

2012-11-25 16:46:58::DEBUG::common_utils::342::root:: retcode = 2
2012-11-25 16:46:58::ERROR::rhevm-upgrade::1323::root:: Traceback (most recent call last):
  File "/usr/bin/rhevm-upgrade", line 1316, in <module>
  File "/usr/bin/rhevm-upgrade", line 1139, in main
    if unsupportedVersionsPresent(dbName=currentDbName):
  File "/usr/bin/rhevm-upgrade", line 756, in unsupportedVersionsPresent
  File "/usr/share/ovirt-engine/scripts/common_utils.py", line 370, in execRemoteSqlCommand
    return execCmd(cmdList=cmd, failOnError=failOnError, msg=errMsg, envDict=getPgPassEnv())
  File "/usr/share/ovirt-engine/scripts/common_utils.py", line 345, in execCmd
    raise Exception(msg)
Exception: Error: Failed to connect to database
Comment 1 Haim 2012-11-25 10:54:17 EST
Created attachment 651560 [details]
rhevm-upgrade logs
Comment 2 Haim 2012-11-25 13:19:47 EST
*** Bug 879934 has been marked as a duplicate of this bug. ***
Comment 3 Moran Goldboim 2012-11-26 05:24:53 EST
flow need to be added to rollback KB
Comment 4 Moran Goldboim 2012-12-11 12:49:04 EST
added to roll-back kb

*** This bug has been marked as a duplicate of bug 879920 ***