<html><body><div style="font-family: trebuchet ms,sans-serif; font-size: 12pt; color: #000000"><div>Yes, it happens in a clean machine. I try it twice and restore always fails.</div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>From: </b>"Yedidyah Bar David" <didi@redhat.com><br><b>To: </b>suporte@logicworks.pt, "Eli Mesika" <emesika@redhat.com><br><b>Cc: </b>"ovirt users" <users@ovirt.org><br><b>Sent: </b>Thursday, March 1, 2018 7:28:13 AM<br><b>Subject: </b>Re: [ovirt-users] Backup & Restore<br></div><div><br></div><div data-marker="__QUOTED_TEXT__">On Wed, Feb 28, 2018 at 4:44 PM, <suporte@logicworks.pt> wrote:<br>> If I run<br>><br>> # engine-backup --mode=restore --file=back_futur --log=log_futur<br>> --provision-db --restore-permissions --provision-dwh-db --log=/root/rest-log<br>><br>> to create a log, I found these errors:<br>><br>> 2018-02-28 14:36:31 6339: pg_cmd running: psql -w -U ovirt_engine_history -h<br>> localhost -p 5432 ovirt_engine_history -t -c show lc_messages<br>> 2018-02-28 14:36:31 6339: pg_cmd running: pg_dump -w -U ovirt_engine_history<br>> -h localhost -p 5432 ovirt_engine_history -s<br>> 2018-02-28 14:36:31 6339: OUTPUT: - Engine database 'engine'<br>> 2018-02-28 14:36:31 6339: Restoring engine database backup at<br>> /tmp/engine-backup.VVkcNuYAkV/db/engine_backup.db<br>> 2018-02-28 14:36:31 6339: restoreDB: backupfile<br>> /tmp/engine-backup.VVkcNuYAkV/db/engine_backup.db user engine host localhost<br>> port 5432 database engine orig_user compressor format custom jobsnum 2<br>> 2018-02-28 14:36:31 6339: pg_cmd running: pg_restore -w -U engine -h<br>> localhost -p 5432 -d engine -j 2<br>> /tmp/engine-backup.VVkcNuYAkV/db/engine_backup.db<br>> pg_restore: [archiver (db)] Error while PROCESSING TOC:<br>> pg_restore: [archiver (db)] Error from TOC entry 7314; 0 0 COMMENT EXTENSION<br>> plpgsql<br>> pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of<br>> extension plpgsql<br>> Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';<br>><br>><br>><br>> pg_restore: [archiver (db)] Error from TOC entry 693; 1255 211334 FUNCTION<br>> uuid_generate_v1() engine<br>> pg_restore: [archiver (db)] could not execute query: ERROR: function<br>> "uuid_generate_v1" already exists with same argument types<br><br>This is the error that fails you. I have a pending patch to make this more<br>visible in the log [1], need to find time to verify it...<br><br>Does this happen on a clean machine? Perhaps 'engine-cleanup' after such<br>a failed restore is not enough. Please try reinstalling the OS and trying<br>again.<br><br>If it's not an important machine (test/dev/etc), this will probably be<br>enough, as a faster replacement for a full OS reinstall:<br><br>engine-cleanup<br>systemctl stop postgresql<br>systemctl stop rh-postgresql95-postgresql<br>rm -rf /var/lib/pgsql/data /var/opt/rh/rh-postgresql95/lib/pgsql/data<br><br>Then try restore again.<br><br>[1] https://gerrit.ovirt.org/86395<br><br>> Command was: CREATE FUNCTION uuid_generate_v1() RETURNS uuid<br>> LANGUAGE plpgsql STABLE<br>> AS '<br>> DECLARE<br>> v_val BIGINT;<br>> v_4_1_par...<br>> pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of<br>> function uuid_generate_v1<br>> Command was: ALTER FUNCTION public.uuid_generate_v1() OWNER TO engine;<br><br>Adding also Eli. Eli - perhaps we need to patch engine-backup to ignore<br>also this error? I think the minimal flow to reproduce is:<br><br>engine-setup<br>engine-backup --mode=backup --file=f1 --log=l1<br>engine-cleanup<br>engine-backup --mode=restore --file=f1 --provision-db<br>--provision-dwh-db --log=l2<br><br>Didn't try this myself.<br><br>><br>><br>> pg_restore: WARNING: column "user_role_title" has type "unknown"<br>> DETAIL: Proceeding with relation creation anyway.<br>> pg_restore: WARNING: no privileges could be revoked for "public"<br>> pg_restore: WARNING: no privileges could be revoked for "public"<br>> pg_restore: WARNING: no privileges were granted for "public"<br>> pg_restore: WARNING: no privileges were granted for "public"<br>> WARNING: errors ignored on restore: 3<br>> 2018-02-28 14:37:23 6339: FATAL: Errors while restoring database engine<br>><br>> ________________________________<br>> De: suporte@logicworks.pt<br>> Para: "Yedidyah Bar David" <didi@redhat.com><br>> Cc: "ovirt users" <users@ovirt.org><br>> Enviadas: Quarta-feira, 28 De Fevereiro de 2018 12:45:04<br>><br>> Assunto: Re: [ovirt-users] Backup & Restore<br>><br>> Still no luck:<br>><br>> # engine-backup --mode=restore --file=back_futur --log=log_futur<br>> --provision-db --restore-permissions --provision-dwh-db<br>> Preparing to restore:<br>> - Unpacking file 'back_futur'<br>> Restoring:<br>> - Files<br>> Provisioning PostgreSQL users/databases:<br>> - user 'engine', database 'engine'<br>> - user 'ovirt_engine_history', database 'ovirt_engine_history'<br>> Restoring:<br>> - Engine database 'engine'<br>> FATAL: Errors while restoring database engine<br>><br>> I did a engine-cleanup, try it again but still the same error.<br>><br>> ________________________________<br>> De: "Yedidyah Bar David" <didi@redhat.com><br>> Para: suporte@logicworks.pt<br>> Cc: "ovirt users" <users@ovirt.org><br>> Enviadas: Quarta-feira, 28 De Fevereiro de 2018 12:24:50<br>> Assunto: Re: [ovirt-users] Backup & Restore<br>><br>> On Wed, Feb 28, 2018 at 2:10 PM, <suporte@logicworks.pt> wrote:<br>>> Hi,<br>>><br>>> I'm testing backup & restore on Ovirt 4.2.<br>>> I follow this doc<br>>><br>>> https://www.ovirt.org/documentation/admin-guide/chap-Backups_and_Migration/<br>>> Try to restore to a fresh installation but always get this error message:<br>>><br>>> restore-permissions<br>>> Preparing to restore:<br>>> - Unpacking file 'back_file'<br>>> Restoring:<br>>> - Files<br>>> Provisioning PostgreSQL users/databases:<br>>> - user 'engine', database 'engine'<br>>> Restoring:<br>>> FATAL: Can't connect to database 'ovirt_engine_history'. Please see<br>>> '/usr/bin/engine-backup --help'.<br>>><br>>> On the live engine I run # engine-backup --scope=all --mode=backup<br>>> --file=file_name --log=log_file_name<br>>><br>>> And try to restore on a fresh installation:<br>>> # engine-backup --mode=restore --file=file_name --log=log_file_name<br>>> --provision-db --restore-permissions<br>>><br>>> Any Idea?<br>><br>> Please try adding to restore command '--providion-dwh-db'. Thanks.<br>> --<br>> Didi<br>><br>> _______________________________________________<br>> Users mailing list<br>> Users@ovirt.org<br>> http://lists.ovirt.org/mailman/listinfo/users<br><br><br><br>-- <br>Didi<br></div></div></body></html>