Description of problem: When updating an existing environment were some VMs have snapshots, the engine-setup fails. The log contains error: 2019-07-30 14:24:31,117+0000 DEBUG otopi.context context._executeMethod:145 method exception Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/otopi/context.py", line 132, in _executeMethod method['method']() File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/db/schema.py", line 437, in _validation self._checkSnapshotCompatibilityVersion() File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/db/schema.py", line 212, in _checkSnapshotCompatibilityVersion 'v': snapshot_cl, UnboundLocalError: local variable 'snapshot_cl' referenced before assignment 2019-07-30 14:24:31,118+0000 ERROR otopi.context context._executeMethod:154 Failed to execute stage 'Setup validation': local variable 'snapshot_cl' referenced before assignment After some debugging, I have found the problem is in the xml namespace in the ovf of the snapshots. The snapshot uses namespace: xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1", but the code expects "http://schemas.dmtf.org/ovf/envelope/1/". The ovf namespace was changed in patch: https://gerrit.ovirt.org/#/c/84802/ Version-Release number of selected component (if applicable): ovirt-engine-setup 4.3.5.4-1.el7 ovirt-engine.noarch 4.3.2.1-1.el7
I think that a workaround can be, no idea about implications: update snapshots set vm_configuration=REPLACE(vm_configuration, 'http://schemas.dmtf.org/ovf/envelope/1', 'http://schemas.dmtf.org/ovf/envelope/1/')
QE: To reproduce/verify: 1. Install and setup older engine. I think 4.2 will reproduce, you can/should also try 4.1. 2. Create there storage, add a host, create a vm, create a snapshot on the vm. 3. If you started with 4.1, upgrade to 4.2. 4. Upgrade setup packages to 4.3 and run engine-setup. If you upgraded to 4.3 < 4.3.5, you should be ok. If you upgraded to 4.3.5 < 4.3.5.5, it would fail. If you upgraded to 4.3.5.5, you should be ok. No need to finish setup - you can run it until the preview and reply 'Cancel', then upgrade setup packages to your next attempted version and try again.
Verified on ovirt-engine-4.3.5.5-0.1.el7.noarch
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:2561
sync2jira
Only now took the time to look at an actual production engine with many snapshots, some rather old. It seems like all snapshots created at <= 3.5 are shown by engine-setup as UnknownDate/UnknownLevel. I guess it's probably not that hard to parse the data also from these times, but it's probably not worth it.