Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
> On 06 Jul 2016, at 23:15, Matt . wrote: > > OK, due some not having done PgSQL for a long time I didn't select the > engine DB that well. > > Thanks, this is a good fix where I already noticed the same snapshot > ID already by searching through the tables and looking what's going on > there. > > > > 2016-07-06 14:41 GMT+02:00 Matt . : >> HI, >> >> Thanks for the solution, I actually get: >> >> postgres=# select vm_name, snapshots.description as snapshot_name, >> snapshot_id from snapshots join vm_static on vm_id=vm_guid where >> CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from >> storage_domain_static); >> ERROR: relation "snapshots" does not exist >> LINE 1: ...ts.description as snapshot_name, snapshot_id from snapshots .. >> >> 2016-07-06 12:11 GMT+02:00 : >>> Hi Arik, >>> >>> El 2016-07-06 10:27, Arik Hadas escribió: Hi, This is a bit aggressive solution to remove all snapshots with the memory. Can you confirm that a storage domain that was active while creating the snapshot with memory was removed from the system? This is something that was not covered and could lead to the reported issue. >>> >>> Some of them were available when we did remove a storage backend, indeed. >>> Some were newer, the problem is that I don't know which one actually failed >>> since when this happened we were in a hurry and needed to upgrade ASAP. >>> Until we come up with a proper solution, you can use the following tracked by https://bugzilla.redhat.com/show_bug.cgi?id=1353219 query to identify the exact problematic snapshots and remove them before upgrading: select vm_name, snapshots.description as snapshot_name, snapshot_id from snapshots join vm_static on vm_id=vm_guid where CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from storage_domain_static); >>> >>> Thanks. We have another oVirt infrastructure and I see this query is >>> returning one row. I'll report back when we upgrade this second >>> infrastructure and provide some details. >>> >>> Regards. >>> >>> Regards, Arik - Original Message - > > Hi, > > We have had a similar issue when upgrading, digging into it we found out > that this was caused by snapshots that had the "Save memory" option > enabled. We finally ended up deleting any snapshot that had this option > enabled and then we tried to upgrade, this time the process went smooth. > > Hope this helps. > > Regards. > > El 2016-07-05 18:49, Matt . escribió: >> OK some update on this. >> >> Removed the db-migrate-script package and reinstalled ovirt-engine and >> ovirt-engine-setup. >> >> I still have that error and this is the loggingpart: >> >> CONTEXT: SQL statement "DROP INDEX IF EXISTS >> idx_vm_static_template_version_name; CREATE INDEX >> idx_vm_static_template_version_nam$ >> PL/pgSQL function fn_db_create_index(character varying,character >> varying,text,text) line 12 at EXECUTE statement >> >> psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93: >> ERROR: >> insert or update on table "image_storage_domain_map" violates foreign >> key constraint >> "fk_image_storage_domain_map_storage_domain_static" >> DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) >> is not present in table "storage_domain_static". >> FATAL: Cannot execute sql command: >> >> --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql >> >> 2016-07-05 19:40:29 ERROR >> otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema >> schema._misc:313 schema.sh: FATAL: >> sql command: >> >> --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql >> 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142 >> 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 315, in _misc >>raise RuntimeError(_('Engine schema refresh failed')) >> RuntimeError: Engine schema refresh failed >> >> Any idea ? >> >> 2016-07-05 15:25 GMT+02:00 Matt . : >>> I just found out that the file >>> >>> 04_00_0140_convert_memory_snapshots_to_disks.sql >>> >>> is not located in: >>> >>> /usr/share/ovirt-engine/dbscripts/upgrade/ >> ___ >> Users mailing list >> Users@ovirt.org >> http://lists.ovirt.org/mailman/listinfo/users > __
Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
OK, due some not having done PgSQL for a long time I didn't select the engine DB that well. Thanks, this is a good fix where I already noticed the same snapshot ID already by searching through the tables and looking what's going on there. 2016-07-06 14:41 GMT+02:00 Matt . : > HI, > > Thanks for the solution, I actually get: > > postgres=# select vm_name, snapshots.description as snapshot_name, > snapshot_id from snapshots join vm_static on vm_id=vm_guid where > CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from > storage_domain_static); > ERROR: relation "snapshots" does not exist > LINE 1: ...ts.description as snapshot_name, snapshot_id from snapshots .. > > 2016-07-06 12:11 GMT+02:00 : >> Hi Arik, >> >> El 2016-07-06 10:27, Arik Hadas escribió: >>> >>> Hi, >>> >>> This is a bit aggressive solution to remove all snapshots with the memory. >>> >>> Can you confirm that a storage domain that was active while creating >>> the snapshot with memory was removed from the system? >>> This is something that was not covered and could lead to the reported >>> issue. >>> >> >> Some of them were available when we did remove a storage backend, indeed. >> Some were newer, the problem is that I don't know which one actually failed >> since when this happened we were in a hurry and needed to upgrade ASAP. >> >>> Until we come up with a proper solution, you can use the following >>> query to identify the exact problematic snapshots and remove them >>> before upgrading: >>> select vm_name, snapshots.description as snapshot_name, snapshot_id >>> from snapshots join vm_static on vm_id=vm_guid where >>> CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from >>> storage_domain_static); >>> >> >> Thanks. We have another oVirt infrastructure and I see this query is >> returning one row. I'll report back when we upgrade this second >> infrastructure and provide some details. >> >> Regards. >> >> >>> Regards, >>> Arik >>> >>> - Original Message - Hi, We have had a similar issue when upgrading, digging into it we found out that this was caused by snapshots that had the "Save memory" option enabled. We finally ended up deleting any snapshot that had this option enabled and then we tried to upgrade, this time the process went smooth. Hope this helps. Regards. El 2016-07-05 18:49, Matt . escribió: > OK some update on this. > > Removed the db-migrate-script package and reinstalled ovirt-engine and > ovirt-engine-setup. > > I still have that error and this is the loggingpart: > > CONTEXT: SQL statement "DROP INDEX IF EXISTS > idx_vm_static_template_version_name; CREATE INDEX > idx_vm_static_template_version_nam$ > PL/pgSQL function fn_db_create_index(character varying,character > varying,text,text) line 12 at EXECUTE statement > > psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93: > ERROR: > insert or update on table "image_storage_domain_map" violates foreign > key constraint > "fk_image_storage_domain_map_storage_domain_static" > DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) > is not present in table "storage_domain_static". > FATAL: Cannot execute sql command: > > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > > 2016-07-05 19:40:29 ERROR > otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema > schema._misc:313 schema.sh: FATAL: > sql command: > > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142 > 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 315, in _misc > raise RuntimeError(_('Engine schema refresh failed')) > RuntimeError: Engine schema refresh failed > > Any idea ? > > 2016-07-05 15:25 GMT+02:00 Matt . : >> I just found out that the file >> >> 04_00_0140_convert_memory_snapshots_to_disks.sql >> >> is not located in: >> >> /usr/share/ovirt-engine/dbscripts/upgrade/ > ___ > Users mailing list > Users@ovirt.org > http://lists.ovirt.org/mailman/listinfo/users ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users >> ___ Users mailing list Users@ovirt.org http://lists.ovirt.org
Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
- Original Message - > El 2016-07-06 11:11, nico...@devels.es escribió: > > Hi Arik, > > > > El 2016-07-06 10:27, Arik Hadas escribió: > >> Hi, > >> > >> This is a bit aggressive solution to remove all snapshots with the > >> memory. > >> > >> Can you confirm that a storage domain that was active while creating > >> the snapshot with memory was removed from the system? > >> This is something that was not covered and could lead to the reported > >> issue. > >> > > > > Some of them were available when we did remove a storage backend, > > indeed. Some were newer, the problem is that I don't know which one > > actually failed since when this happened we were in a hurry and needed > > to upgrade ASAP. > > > >> Until we come up with a proper solution, you can use the following > >> query to identify the exact problematic snapshots and remove them > >> before upgrading: > >> select vm_name, snapshots.description as snapshot_name, snapshot_id > >> from snapshots join vm_static on vm_id=vm_guid where > >> CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from > >> storage_domain_static); > >> > > > > Thanks. We have another oVirt infrastructure and I see this query is > > returning one row. I'll report back when we upgrade this second > > infrastructure and provide some details. > > > > We've upgraded our second oVirt infrastructure as well, here are the > steps: > > 1) I run the query you provided, it returned one row. > 2) I tried upgrading to 4.0 without deleting that snapshot: it failed > with the error below. > 3) I deleted the snapshot > 4) Now I tried upgrading again and everything went smoothly. > > I'd say this is the same issue, apparently. > > Thanks. Thanks for the update. I opened a bug for this issue [1]. We will probably just remove the memory from this kind of snapshots automatically during the upgrade. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1353219 > > > Regards. > > > >> Regards, > >> Arik > >> > >> - Original Message - > >>> Hi, > >>> > >>> We have had a similar issue when upgrading, digging into it we found > >>> out > >>> that this was caused by snapshots that had the "Save memory" option > >>> enabled. We finally ended up deleting any snapshot that had this > >>> option > >>> enabled and then we tried to upgrade, this time the process went > >>> smooth. > >>> > >>> Hope this helps. > >>> > >>> Regards. > >>> > >>> El 2016-07-05 18:49, Matt . escribió: > >>> > OK some update on this. > >>> > > >>> > Removed the db-migrate-script package and reinstalled ovirt-engine and > >>> > ovirt-engine-setup. > >>> > > >>> > I still have that error and this is the loggingpart: > >>> > > >>> > CONTEXT: SQL statement "DROP INDEX IF EXISTS > >>> > idx_vm_static_template_version_name; CREATE INDEX > >>> > idx_vm_static_template_version_nam$ > >>> > PL/pgSQL function fn_db_create_index(character varying,character > >>> > varying,text,text) line 12 at EXECUTE statement > >>> > psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93: > >>> > ERROR: > >>> > insert or update on table "image_storage_domain_map" violates foreign > >>> > key constraint > >>> > "fk_image_storage_domain_map_storage_domain_static" > >>> > DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) > >>> > is not present in table "storage_domain_static". > >>> > FATAL: Cannot execute sql command: > >>> > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > >>> > > >>> > 2016-07-05 19:40:29 ERROR > >>> > otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema > >>> > schema._misc:313 schema.sh: FATAL: > >>> > sql command: > >>> > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > >>> > 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142 > >>> > 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 315, in _misc > >>> > raise RuntimeError(_('Engine schema refresh failed')) > >>> > RuntimeError: Engine schema refresh failed > >>> > > >>> > Any idea ? > >>> > > >>> > 2016-07-05 15:25 GMT+02:00 Matt . : > >>> >> I just found out that the file > >>> >> > >>> >> 04_00_0140_convert_memory_snapshots_to_disks.sql > >>> >> > >>> >> is not located in: > >>> >> > >>> >> /usr/share/ovirt-engine/dbscripts/upgrade/ > >>> > ___ > >>> > Users mailing list > >>> > Users@ovirt.org > >>> > http://lists.ovirt.org/mailman/listinfo/users > >>> ___ > >>> Users mailing list > >>> Users@ovirt.org > >>> http://lists.ovirt.org/mailman/listinfo/users > >>> ___
Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
You need to do this in the 'engine' database instead of 'postgres'. El 2016-07-06 13:41, Matt . escribió: HI, Thanks for the solution, I actually get: postgres=# select vm_name, snapshots.description as snapshot_name, snapshot_id from snapshots join vm_static on vm_id=vm_guid where CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from storage_domain_static); ERROR: relation "snapshots" does not exist LINE 1: ...ts.description as snapshot_name, snapshot_id from snapshots .. 2016-07-06 12:11 GMT+02:00 : Hi Arik, El 2016-07-06 10:27, Arik Hadas escribió: Hi, This is a bit aggressive solution to remove all snapshots with the memory. Can you confirm that a storage domain that was active while creating the snapshot with memory was removed from the system? This is something that was not covered and could lead to the reported issue. Some of them were available when we did remove a storage backend, indeed. Some were newer, the problem is that I don't know which one actually failed since when this happened we were in a hurry and needed to upgrade ASAP. Until we come up with a proper solution, you can use the following query to identify the exact problematic snapshots and remove them before upgrading: select vm_name, snapshots.description as snapshot_name, snapshot_id from snapshots join vm_static on vm_id=vm_guid where CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from storage_domain_static); Thanks. We have another oVirt infrastructure and I see this query is returning one row. I'll report back when we upgrade this second infrastructure and provide some details. Regards. Regards, Arik - Original Message - Hi, We have had a similar issue when upgrading, digging into it we found out that this was caused by snapshots that had the "Save memory" option enabled. We finally ended up deleting any snapshot that had this option enabled and then we tried to upgrade, this time the process went smooth. Hope this helps. Regards. El 2016-07-05 18:49, Matt . escribió: > OK some update on this. > > Removed the db-migrate-script package and reinstalled ovirt-engine and > ovirt-engine-setup. > > I still have that error and this is the loggingpart: > > CONTEXT: SQL statement "DROP INDEX IF EXISTS > idx_vm_static_template_version_name; CREATE INDEX > idx_vm_static_template_version_nam$ > PL/pgSQL function fn_db_create_index(character varying,character > varying,text,text) line 12 at EXECUTE statement > > psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93: > ERROR: > insert or update on table "image_storage_domain_map" violates foreign > key constraint > "fk_image_storage_domain_map_storage_domain_static" > DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) > is not present in table "storage_domain_static". > FATAL: Cannot execute sql command: > > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > > 2016-07-05 19:40:29 ERROR > otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema > schema._misc:313 schema.sh: FATAL: > sql command: > > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142 > 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 315, in _misc > raise RuntimeError(_('Engine schema refresh failed')) > RuntimeError: Engine schema refresh failed > > Any idea ? > > 2016-07-05 15:25 GMT+02:00 Matt . : >> I just found out that the file >> >> 04_00_0140_convert_memory_snapshots_to_disks.sql >> >> is not located in: >> >> /usr/share/ovirt-engine/dbscripts/upgrade/ > ___ > Users mailing list > Users@ovirt.org > http://lists.ovirt.org/mailman/listinfo/users ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
El 2016-07-06 11:11, nico...@devels.es escribió: Hi Arik, El 2016-07-06 10:27, Arik Hadas escribió: Hi, This is a bit aggressive solution to remove all snapshots with the memory. Can you confirm that a storage domain that was active while creating the snapshot with memory was removed from the system? This is something that was not covered and could lead to the reported issue. Some of them were available when we did remove a storage backend, indeed. Some were newer, the problem is that I don't know which one actually failed since when this happened we were in a hurry and needed to upgrade ASAP. Until we come up with a proper solution, you can use the following query to identify the exact problematic snapshots and remove them before upgrading: select vm_name, snapshots.description as snapshot_name, snapshot_id from snapshots join vm_static on vm_id=vm_guid where CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from storage_domain_static); Thanks. We have another oVirt infrastructure and I see this query is returning one row. I'll report back when we upgrade this second infrastructure and provide some details. We've upgraded our second oVirt infrastructure as well, here are the steps: 1) I run the query you provided, it returned one row. 2) I tried upgrading to 4.0 without deleting that snapshot: it failed with the error below. 3) I deleted the snapshot 4) Now I tried upgrading again and everything went smoothly. I'd say this is the same issue, apparently. Thanks. Regards. Regards, Arik - Original Message - Hi, We have had a similar issue when upgrading, digging into it we found out that this was caused by snapshots that had the "Save memory" option enabled. We finally ended up deleting any snapshot that had this option enabled and then we tried to upgrade, this time the process went smooth. Hope this helps. Regards. El 2016-07-05 18:49, Matt . escribió: > OK some update on this. > > Removed the db-migrate-script package and reinstalled ovirt-engine and > ovirt-engine-setup. > > I still have that error and this is the loggingpart: > > CONTEXT: SQL statement "DROP INDEX IF EXISTS > idx_vm_static_template_version_name; CREATE INDEX > idx_vm_static_template_version_nam$ > PL/pgSQL function fn_db_create_index(character varying,character > varying,text,text) line 12 at EXECUTE statement > psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93: > ERROR: > insert or update on table "image_storage_domain_map" violates foreign > key constraint > "fk_image_storage_domain_map_storage_domain_static" > DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) > is not present in table "storage_domain_static". > FATAL: Cannot execute sql command: > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > > 2016-07-05 19:40:29 ERROR > otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema > schema._misc:313 schema.sh: FATAL: > sql command: > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142 > 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 315, in _misc > raise RuntimeError(_('Engine schema refresh failed')) > RuntimeError: Engine schema refresh failed > > Any idea ? > > 2016-07-05 15:25 GMT+02:00 Matt . : >> I just found out that the file >> >> 04_00_0140_convert_memory_snapshots_to_disks.sql >> >> is not located in: >> >> /usr/share/ovirt-engine/dbscripts/upgrade/ > ___ > Users mailing list > Users@ovirt.org > http://lists.ovirt.org/mailman/listinfo/users ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
HI, Thanks for the solution, I actually get: postgres=# select vm_name, snapshots.description as snapshot_name, snapshot_id from snapshots join vm_static on vm_id=vm_guid where CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from storage_domain_static); ERROR: relation "snapshots" does not exist LINE 1: ...ts.description as snapshot_name, snapshot_id from snapshots .. 2016-07-06 12:11 GMT+02:00 : > Hi Arik, > > El 2016-07-06 10:27, Arik Hadas escribió: >> >> Hi, >> >> This is a bit aggressive solution to remove all snapshots with the memory. >> >> Can you confirm that a storage domain that was active while creating >> the snapshot with memory was removed from the system? >> This is something that was not covered and could lead to the reported >> issue. >> > > Some of them were available when we did remove a storage backend, indeed. > Some were newer, the problem is that I don't know which one actually failed > since when this happened we were in a hurry and needed to upgrade ASAP. > >> Until we come up with a proper solution, you can use the following >> query to identify the exact problematic snapshots and remove them >> before upgrading: >> select vm_name, snapshots.description as snapshot_name, snapshot_id >> from snapshots join vm_static on vm_id=vm_guid where >> CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from >> storage_domain_static); >> > > Thanks. We have another oVirt infrastructure and I see this query is > returning one row. I'll report back when we upgrade this second > infrastructure and provide some details. > > Regards. > > >> Regards, >> Arik >> >> - Original Message - >>> >>> Hi, >>> >>> We have had a similar issue when upgrading, digging into it we found out >>> that this was caused by snapshots that had the "Save memory" option >>> enabled. We finally ended up deleting any snapshot that had this option >>> enabled and then we tried to upgrade, this time the process went smooth. >>> >>> Hope this helps. >>> >>> Regards. >>> >>> El 2016-07-05 18:49, Matt . escribió: >>> > OK some update on this. >>> > >>> > Removed the db-migrate-script package and reinstalled ovirt-engine and >>> > ovirt-engine-setup. >>> > >>> > I still have that error and this is the loggingpart: >>> > >>> > CONTEXT: SQL statement "DROP INDEX IF EXISTS >>> > idx_vm_static_template_version_name; CREATE INDEX >>> > idx_vm_static_template_version_nam$ >>> > PL/pgSQL function fn_db_create_index(character varying,character >>> > varying,text,text) line 12 at EXECUTE statement >>> > >>> > psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93: >>> > ERROR: >>> > insert or update on table "image_storage_domain_map" violates foreign >>> > key constraint >>> > "fk_image_storage_domain_map_storage_domain_static" >>> > DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) >>> > is not present in table "storage_domain_static". >>> > FATAL: Cannot execute sql command: >>> > >>> > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql >>> > >>> > 2016-07-05 19:40:29 ERROR >>> > otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema >>> > schema._misc:313 schema.sh: FATAL: >>> > sql command: >>> > >>> > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql >>> > 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142 >>> > 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 315, in _misc >>> > raise RuntimeError(_('Engine schema refresh failed')) >>> > RuntimeError: Engine schema refresh failed >>> > >>> > Any idea ? >>> > >>> > 2016-07-05 15:25 GMT+02:00 Matt . : >>> >> I just found out that the file >>> >> >>> >> 04_00_0140_convert_memory_snapshots_to_disks.sql >>> >> >>> >> is not located in: >>> >> >>> >> /usr/share/ovirt-engine/dbscripts/upgrade/ >>> > ___ >>> > Users mailing list >>> > Users@ovirt.org >>> > http://lists.ovirt.org/mailman/listinfo/users >>> ___ >>> Users mailing list >>> Users@ovirt.org >>> http://lists.ovirt.org/mailman/listinfo/users >>> > ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
Hi Arik, El 2016-07-06 10:27, Arik Hadas escribió: Hi, This is a bit aggressive solution to remove all snapshots with the memory. Can you confirm that a storage domain that was active while creating the snapshot with memory was removed from the system? This is something that was not covered and could lead to the reported issue. Some of them were available when we did remove a storage backend, indeed. Some were newer, the problem is that I don't know which one actually failed since when this happened we were in a hurry and needed to upgrade ASAP. Until we come up with a proper solution, you can use the following query to identify the exact problematic snapshots and remove them before upgrading: select vm_name, snapshots.description as snapshot_name, snapshot_id from snapshots join vm_static on vm_id=vm_guid where CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from storage_domain_static); Thanks. We have another oVirt infrastructure and I see this query is returning one row. I'll report back when we upgrade this second infrastructure and provide some details. Regards. Regards, Arik - Original Message - Hi, We have had a similar issue when upgrading, digging into it we found out that this was caused by snapshots that had the "Save memory" option enabled. We finally ended up deleting any snapshot that had this option enabled and then we tried to upgrade, this time the process went smooth. Hope this helps. Regards. El 2016-07-05 18:49, Matt . escribió: > OK some update on this. > > Removed the db-migrate-script package and reinstalled ovirt-engine and > ovirt-engine-setup. > > I still have that error and this is the loggingpart: > > CONTEXT: SQL statement "DROP INDEX IF EXISTS > idx_vm_static_template_version_name; CREATE INDEX > idx_vm_static_template_version_nam$ > PL/pgSQL function fn_db_create_index(character varying,character > varying,text,text) line 12 at EXECUTE statement > psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93: > ERROR: > insert or update on table "image_storage_domain_map" violates foreign > key constraint > "fk_image_storage_domain_map_storage_domain_static" > DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) > is not present in table "storage_domain_static". > FATAL: Cannot execute sql command: > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > > 2016-07-05 19:40:29 ERROR > otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema > schema._misc:313 schema.sh: FATAL: > sql command: > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142 > 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 315, in _misc > raise RuntimeError(_('Engine schema refresh failed')) > RuntimeError: Engine schema refresh failed > > Any idea ? > > 2016-07-05 15:25 GMT+02:00 Matt . : >> I just found out that the file >> >> 04_00_0140_convert_memory_snapshots_to_disks.sql >> >> is not located in: >> >> /usr/share/ovirt-engine/dbscripts/upgrade/ > ___ > Users mailing list > Users@ovirt.org > http://lists.ovirt.org/mailman/listinfo/users ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
Hi, This is a bit aggressive solution to remove all snapshots with the memory. Can you confirm that a storage domain that was active while creating the snapshot with memory was removed from the system? This is something that was not covered and could lead to the reported issue. Until we come up with a proper solution, you can use the following query to identify the exact problematic snapshots and remove them before upgrading: select vm_name, snapshots.description as snapshot_name, snapshot_id from snapshots join vm_static on vm_id=vm_guid where CAST(split_part(memory_volume, ',', 1) AS UUID) not in (select id from storage_domain_static); Regards, Arik - Original Message - > Hi, > > We have had a similar issue when upgrading, digging into it we found out > that this was caused by snapshots that had the "Save memory" option > enabled. We finally ended up deleting any snapshot that had this option > enabled and then we tried to upgrade, this time the process went smooth. > > Hope this helps. > > Regards. > > El 2016-07-05 18:49, Matt . escribió: > > OK some update on this. > > > > Removed the db-migrate-script package and reinstalled ovirt-engine and > > ovirt-engine-setup. > > > > I still have that error and this is the loggingpart: > > > > CONTEXT: SQL statement "DROP INDEX IF EXISTS > > idx_vm_static_template_version_name; CREATE INDEX > > idx_vm_static_template_version_nam$ > > PL/pgSQL function fn_db_create_index(character varying,character > > varying,text,text) line 12 at EXECUTE statement > > psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93: > > ERROR: > > insert or update on table "image_storage_domain_map" violates foreign > > key constraint > > "fk_image_storage_domain_map_storage_domain_static" > > DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) > > is not present in table "storage_domain_static". > > FATAL: Cannot execute sql command: > > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > > > > 2016-07-05 19:40:29 ERROR > > otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema > > schema._misc:313 schema.sh: FATAL: > > sql command: > > --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql > > 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142 > > 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 315, in _misc > > raise RuntimeError(_('Engine schema refresh failed')) > > RuntimeError: Engine schema refresh failed > > > > Any idea ? > > > > 2016-07-05 15:25 GMT+02:00 Matt . : > >> I just found out that the file > >> > >> 04_00_0140_convert_memory_snapshots_to_disks.sql > >> > >> is not located in: > >> > >> /usr/share/ovirt-engine/dbscripts/upgrade/ > > ___ > > Users mailing list > > Users@ovirt.org > > http://lists.ovirt.org/mailman/listinfo/users > ___ > Users mailing list > Users@ovirt.org > http://lists.ovirt.org/mailman/listinfo/users > ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
Hi, We have had a similar issue when upgrading, digging into it we found out that this was caused by snapshots that had the "Save memory" option enabled. We finally ended up deleting any snapshot that had this option enabled and then we tried to upgrade, this time the process went smooth. Hope this helps. Regards. El 2016-07-05 18:49, Matt . escribió: OK some update on this. Removed the db-migrate-script package and reinstalled ovirt-engine and ovirt-engine-setup. I still have that error and this is the loggingpart: CONTEXT: SQL statement "DROP INDEX IF EXISTS idx_vm_static_template_version_name; CREATE INDEX idx_vm_static_template_version_nam$ PL/pgSQL function fn_db_create_index(character varying,character varying,text,text) line 12 at EXECUTE statement psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93: ERROR: insert or update on table "image_storage_domain_map" violates foreign key constraint "fk_image_storage_domain_map_storage_domain_static" DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) is not present in table "storage_domain_static". FATAL: Cannot execute sql command: --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql 2016-07-05 19:40:29 ERROR otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema schema._misc:313 schema.sh: FATAL: sql command: --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142 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 315, in _misc raise RuntimeError(_('Engine schema refresh failed')) RuntimeError: Engine schema refresh failed Any idea ? 2016-07-05 15:25 GMT+02:00 Matt . : I just found out that the file 04_00_0140_convert_memory_snapshots_to_disks.sql is not located in: /usr/share/ovirt-engine/dbscripts/upgrade/ ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
OK some update on this. Removed the db-migrate-script package and reinstalled ovirt-engine and ovirt-engine-setup. I still have that error and this is the loggingpart: CONTEXT: SQL statement "DROP INDEX IF EXISTS idx_vm_static_template_version_name; CREATE INDEX idx_vm_static_template_version_nam$ PL/pgSQL function fn_db_create_index(character varying,character varying,text,text) line 12 at EXECUTE statement psql:/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql:93: ERROR: insert or update on table "image_storage_domain_map" violates foreign key constraint "fk_image_storage_domain_map_storage_domain_static" DETAIL: Key (storage_domain_id)=(006552b0-cae3-4ccb-9baa-ee8c3b8e42cf) is not present in table "storage_domain_static". FATAL: Cannot execute sql command: --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql 2016-07-05 19:40:29 ERROR otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema schema._misc:313 schema.sh: FATAL: sql command: --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql 2016-07-05 19:40:29 DEBUG otopi.context context._executeMethod:142 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 315, in _misc raise RuntimeError(_('Engine schema refresh failed')) RuntimeError: Engine schema refresh failed Any idea ? 2016-07-05 15:25 GMT+02:00 Matt . : > I just found out that the file > > 04_00_0140_convert_memory_snapshots_to_disks.sql > > is not located in: > > /usr/share/ovirt-engine/dbscripts/upgrade/ ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
Re: [ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
I just found out that the file 04_00_0140_convert_memory_snapshots_to_disks.sql is not located in: /usr/share/ovirt-engine/dbscripts/upgrade/ ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
[ovirt-users] 3.6 -> 4.0 upgrade fails on schema refresh
Hi, I'm upgrading to oVirt 4.0 from 3.6.7 and I didn't found any usable solution for this error and rollback: [ ERROR ] schema.sh: FATAL: Cannot execute sql command: --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_00_0140_convert_memory_snapshots_to_disks.sql [ ERROR ] Failed to execute stage 'Misc configuration': Engine schema refresh failed I see one bugreport but it doesn't clear it out for me, is this a known thing ? Thanks, Matt ___ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users