[ovirt-users] Backup & Restore

Yedidyah Bar David didi at redhat.com
Thu Mar 1 07:28:13 UTC 2018


On Wed, Feb 28, 2018 at 4:44 PM,  <suporte at logicworks.pt> wrote:
> If I run
>
> # engine-backup --mode=restore --file=back_futur --log=log_futur
> --provision-db --restore-permissions --provision-dwh-db --log=/root/rest-log
>
> to create a log, I found these errors:
>
> 2018-02-28 14:36:31 6339: pg_cmd running: psql -w -U ovirt_engine_history -h
> localhost -p 5432 ovirt_engine_history -t -c show lc_messages
> 2018-02-28 14:36:31 6339: pg_cmd running: pg_dump -w -U ovirt_engine_history
> -h localhost -p 5432 ovirt_engine_history -s
> 2018-02-28 14:36:31 6339: OUTPUT: - Engine database 'engine'
> 2018-02-28 14:36:31 6339: Restoring engine database backup at
> /tmp/engine-backup.VVkcNuYAkV/db/engine_backup.db
> 2018-02-28 14:36:31 6339: restoreDB: backupfile
> /tmp/engine-backup.VVkcNuYAkV/db/engine_backup.db user engine host localhost
> port 5432 database engine orig_user compressor format custom jobsnum 2
> 2018-02-28 14:36:31 6339: pg_cmd running: pg_restore -w -U engine -h
> localhost -p 5432 -d engine -j 2
> /tmp/engine-backup.VVkcNuYAkV/db/engine_backup.db
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 7314; 0 0 COMMENT EXTENSION
> plpgsql
> pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of
> extension plpgsql
> Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
>
>
>
> pg_restore: [archiver (db)] Error from TOC entry 693; 1255 211334 FUNCTION
> uuid_generate_v1() engine
> pg_restore: [archiver (db)] could not execute query: ERROR: function
> "uuid_generate_v1" already exists with same argument types

This is the error that fails you. I have a pending patch to make this more
visible in the log [1], need to find time to verify it...

Does this happen on a clean machine? Perhaps 'engine-cleanup' after such
a failed restore is not enough. Please try reinstalling the OS and trying
again.

If it's not an important machine (test/dev/etc), this will probably be
enough, as a faster replacement for a full OS reinstall:

engine-cleanup
systemctl stop postgresql
systemctl stop rh-postgresql95-postgresql
rm -rf /var/lib/pgsql/data /var/opt/rh/rh-postgresql95/lib/pgsql/data

Then try restore again.

[1] https://gerrit.ovirt.org/86395

> Command was: CREATE FUNCTION uuid_generate_v1() RETURNS uuid
> LANGUAGE plpgsql STABLE
> AS '
> DECLARE
> v_val BIGINT;
> v_4_1_par...
> pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of
> function uuid_generate_v1
> Command was: ALTER FUNCTION public.uuid_generate_v1() OWNER TO engine;

Adding also Eli. Eli - perhaps we need to patch engine-backup to ignore
also this error? I think the minimal flow to reproduce is:

engine-setup
engine-backup --mode=backup --file=f1 --log=l1
engine-cleanup
engine-backup --mode=restore --file=f1 --provision-db
--provision-dwh-db --log=l2

Didn't try this myself.

>
>
> pg_restore: WARNING: column "user_role_title" has type "unknown"
> DETAIL: Proceeding with relation creation anyway.
> pg_restore: WARNING: no privileges could be revoked for "public"
> pg_restore: WARNING: no privileges could be revoked for "public"
> pg_restore: WARNING: no privileges were granted for "public"
> pg_restore: WARNING: no privileges were granted for "public"
> WARNING: errors ignored on restore: 3
> 2018-02-28 14:37:23 6339: FATAL: Errors while restoring database engine
>
> ________________________________
> De: suporte at logicworks.pt
> Para: "Yedidyah Bar David" <didi at redhat.com>
> Cc: "ovirt users" <users at ovirt.org>
> Enviadas: Quarta-feira, 28 De Fevereiro de 2018 12:45:04
>
> Assunto: Re: [ovirt-users] Backup & Restore
>
> Still no luck:
>
> # engine-backup --mode=restore --file=back_futur --log=log_futur
> --provision-db --restore-permissions --provision-dwh-db
> Preparing to restore:
> - Unpacking file 'back_futur'
> Restoring:
> - Files
> Provisioning PostgreSQL users/databases:
> - user 'engine', database 'engine'
> - user 'ovirt_engine_history', database 'ovirt_engine_history'
> Restoring:
> - Engine database 'engine'
> FATAL: Errors while restoring database engine
>
> I did a engine-cleanup, try it again but still the same error.
>
> ________________________________
> De: "Yedidyah Bar David" <didi at redhat.com>
> Para: suporte at logicworks.pt
> Cc: "ovirt users" <users at ovirt.org>
> Enviadas: Quarta-feira, 28 De Fevereiro de 2018 12:24:50
> Assunto: Re: [ovirt-users] Backup & Restore
>
> On Wed, Feb 28, 2018 at 2:10 PM,  <suporte at logicworks.pt> wrote:
>> Hi,
>>
>> I'm testing backup & restore on Ovirt 4.2.
>> I follow this doc
>>
>> https://www.ovirt.org/documentation/admin-guide/chap-Backups_and_Migration/
>> Try to restore to a fresh installation but always get this error message:
>>
>> restore-permissions
>> Preparing to restore:
>> - Unpacking file 'back_file'
>> Restoring:
>> - Files
>> Provisioning PostgreSQL users/databases:
>> - user 'engine', database 'engine'
>> Restoring:
>> FATAL: Can't connect to database 'ovirt_engine_history'. Please see
>> '/usr/bin/engine-backup --help'.
>>
>> On the live engine I run # engine-backup --scope=all --mode=backup
>> --file=file_name --log=log_file_name
>>
>> And try to restore on a fresh installation:
>> # engine-backup --mode=restore --file=file_name --log=log_file_name
>> --provision-db --restore-permissions
>>
>> Any Idea?
>
> Please try adding to restore command '--providion-dwh-db'. Thanks.
> --
> Didi
>
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users



-- 
Didi


More information about the Users mailing list