Bug 1002804 - rhevm-setup uninstalls rhevm on failure if user chose to continue with inability to rollback
Summary: rhevm-setup uninstalls rhevm on failure if user chose to continue with inabil...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-setup
Version: 3.2.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: 3.3.0
Assignee: Alon Bar-Lev
QA Contact: sefi litmanovich
URL:
Whiteboard: integration
Depends On:
Blocks: 1007554
TreeView+ depends on / blocked
 
Reported: 2013-08-30 04:23 UTC by Tim Hildred
Modified: 2015-09-22 13:09 UTC (History)
9 users (show)

Fixed In Version: is14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
rhevm gets completely uninstalled after failed rhevm-setup. (11.19 KB, text/plain)
2013-08-30 04:23 UTC, Tim Hildred
no flags Details
requested log file. (440.36 KB, text/x-log)
2013-09-02 04:09 UTC, Tim Hildred
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 18808 0 None None None Never
oVirt gerrit 18958 0 None None None Never
oVirt gerrit 18979 0 None None None Never

Description Tim Hildred 2013-08-30 04:23:41 UTC
Created attachment 792008 [details]
rhevm gets completely uninstalled after failed rhevm-setup.

Description of problem:
I was messing around with manually configured db, and had the postgresql service running when I ran rhevm-setup. 

rhevm-setup discovered that there were new packages, and asked if I wanted to download them. I said yes.

rhevm-setup downloaded the new packages, verified them, and proceeded into the installation. I selected automatic db setup. 


rhevm-setup discovered couldn't start and connect to postgres service, because it was already running.

rhevm-setup did a yum-rollback (even though it had warned me previously that yum-rollback would not be possible) on the packages it tried to update, which actually uninstalled all of the rhevm packages. 


rhevm-setup should not result in your packages being removed.

Comment 1 Alon Bar-Lev 2013-09-01 09:59:40 UTC
Hi Tim,

I will love to get: /var/log/ovirt-engine/setup/ovirt-engine-setup-20130830140120.log, as I do want to understand why postgresql connection did not succeed, I hope there will be more information in the log.

For the packages...

          Setup will not be able to rollback new packages in case of a failure, because installed ones were not found in enabled repositories.
          Do you want to abort Setup? (Yes, No) [Yes]: No 

As it tries to rollback transaction, it erases the new packages but unable to install the previous ones.

Difficult one.

Should we leave the upgraded packages that are incompatible? Should we not allow continue if rollback is missing? Or should we attempt to rollback as much as possible?

Comment 2 Tim Hildred 2013-09-02 04:08:26 UTC
(In reply to Alon Bar-Lev from comment #1)
> Hi Tim,
> 
> I will love to get:
> /var/log/ovirt-engine/setup/ovirt-engine-setup-20130830140120.log, as I do
> want to understand why postgresql connection did not succeed, I hope there
> will be more information in the log.

Ok, I'll add an attachment

> As it tries to rollback transaction, it erases the new packages but unable
> to install the previous ones.
> 
> Difficult one.
> 
> Should we leave the upgraded packages that are incompatible? Should we not
> allow continue if rollback is missing? Or should we attempt to rollback as
> much as possible?

What about a message that says "An error during database creation interrupted rhevm-setup (is the postgresql service already running?). Correct the error, and run the rhevm-setup script again."

Or alternatively:
"rhevm-setup failed due to an error. Would you like to remove the updates you already downloaded? Yes or No [No]: Yes
 
WARNING, this may remove your previously installed Red Hat Enterprise Virtualization Manager packages. Are you sure you want to continue? Yes or No [No]:"

Comment 3 Tim Hildred 2013-09-02 04:09:10 UTC
Created attachment 792710 [details]
requested log file.

Comment 4 Alon Bar-Lev 2013-09-07 23:00:24 UTC
commit 54c67f91ad7cb3880812fb89834d273fd2cc42e4
Author: Alon Bar-Lev <alonbl>
Date:   Sun Sep 8 00:43:07 2013 +0300

    packaging: setup: disable yum transaction rollback if no rollback is available
    
    rhel yum does not downgrade on rollback but erase and install, this
    cause packages that cannot be rollbacked to be actually erased.
    
    Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1002804
    Change-Id: Ie3f868a84453e6e58de173e57a280fc51b5e9dd1
    Signed-off-by: Alon Bar-Lev <alonbl>

Comment 5 Alon Bar-Lev 2013-09-10 19:13:30 UTC
Itamar, I suggest to have this also in 3.2.z

Comment 6 rhev-integ 2013-09-12 18:30:58 UTC
This bug has been cloned to bug #1007554

Comment 7 Alon Bar-Lev 2013-10-10 08:02:14 UTC
QA note (RHEL only):

1. Prepare environment in which 3.2/3.1 are installed.

2. Disable the channel of current version.

3. Edit engine-upgrade.py, modify the following to ensure failure:
                # yum update
                runFunc(upgradeFunc, MSG_INFO_YUM_UPDATE)

+               raise RuntimeExcpetion('TESTING')

                # check if update is relevant to db update
                if updateRelatedToDB:


4. Run engine-upgrade, notice the 'unable to rollback' warning, and choose to continue.

5. After error the new packages that were installed/updated should be kept.

Comment 8 sefi litmanovich 2013-10-10 14:18:36 UTC
Verified according to the above mentioned flow.

Comment 9 Itamar Heim 2014-01-21 22:26:52 UTC
Closing - RHEV 3.3 Released

Comment 10 Itamar Heim 2014-01-21 22:30:09 UTC
Closing - RHEV 3.3 Released


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