Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1866709

Summary: database restore fails if non-default extensions are included in the backup
Product: [oVirt] ovirt-engine Reporter: Yedidyah Bar David <didi>
Component: Backup-Restore.EngineAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: high Docs Contact:
Priority: urgent    
Version: 4.4.1CC: aperotti, bugs, dfodor, fgarciad, michal.skrivanek, mkalinin
Target Milestone: ovirt-4.4.2Keywords: ZStream
Target Release: 4.4.2.3Flags: pm-rhel: ovirt-4.4+
sbonazzo: planning_ack?
sbonazzo: devel_ack+
lleistne: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.4.2.3 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-18 07:12:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yedidyah Bar David 2020-08-06 07:58:14 UTC
Description of problem:

A restore failed, with this in the log:

pg_restore: error: could not execute query: ERROR:  permission denied to create extension "pg_stat_statements"
pg_restore: error: could not execute query: ERROR:  extension "pg_stat_statements" does not exist

Version-Release number of selected component (if applicable):
Current 4.4, probably forever

How reproducible:
Always, I think

Steps to Reproduce:
1. Setup an engine
2. Add an extension to the engine database, e.g. pg_stat_statements
3. Try to backup and restore it

Actual results:
Fails as above

Expected results:
Succeeds, by ignoring these errors. The restored DB would not have this extension, it can be added later manually.

Additional info:

Comment 1 Yedidyah Bar David 2020-08-06 08:15:53 UTC
I wonder if it's safer to close notabug, and suggest removing the extension before taking the backup. For this, see e.g. bug 1509248 comment 5.

Comment 2 Marina Kalinin 2020-08-06 19:09:27 UTC
Can we stop the backup if we detect the extension? 
Or at least add a note to the backup procedure and give user the option to proceed or not.

Comment 3 Michal Skrivanek 2020-08-07 12:08:07 UTC
I prefer having backups and hen silently drop extension rather than annoy people on taking backups discouraging them up front.
it's not only for upgrades but also regular backup purposes

Comment 4 Lucie Leistnerova 2020-08-27 18:14:35 UTC
restore was successful, extension error ignored

verified in ovirt-engine-tools-backup-4.4.2.3-0.6.el8ev.noarch

Comment 5 Sandro Bonazzola 2020-09-18 07:12:00 UTC
This bugzilla is included in oVirt 4.4.2 release, published on September 17th 2020.

Since the problem described in this bug report should be resolved in oVirt 4.4.2 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.