backup-container icon indicating copy to clipboard operation
backup-container copied to clipboard

Database backup validation of DB with PostGIS fails

Open rstens opened this issue 4 years ago • 2 comments

We have a PostgreSQL database with PostGIS installed. The back up validation fails with:

[!!ERROR!!] - Backup verification failed; /backups/daily/2020-07-29/invasivesbc-api-postgresql-test-InvasivesBC_2020-07-29_16-50-15.sql.gz

The following issues were encountered during backup verification;
ERROR:  could not open extension control file "/opt/rh/rh-postgresql10/root/usr/share/pgsql/extension/postgis.control": No such file or directory

Elapsed time: 0h:0m:40s - Status Code: 3

Other psql extensions might suffer from this as well.

rstens avatar Jul 30 '20 00:07 rstens

The default image for the backup container does not contain the PostGIS plugin. You would need to add the plugin to the image.

Refer to what @garywong-bc did for bcgov/openshift-postgresql-oracle_fdw, including the environment level controls to enable/disable the plug-in. This would be a nice contribution to the backup-container.

WadeBarnes avatar Jul 30 '20 13:07 WadeBarnes

I build my backup container using my application's database container image (with patroni, postgres 13, and PostGIS) as the base to ensure this kind of problem doesn't happen. This is based on https://github.com/BCDevOps/backup-container/blob/master/openshift/templates/backup/backup-build.yaml specifying BASE_IMAGE_FOR_BUILD.

basilv avatar Sep 02 '21 19:09 basilv