BCDevOps / backup-container

A simple container for a simple backup strategy.
Apache License 2.0
42 stars 56 forks source link

Database backup validation of DB with PostGIS fails #58

Open rstens opened 4 years ago

rstens commented 4 years ago

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.

WadeBarnes commented 4 years ago

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.

basilv commented 3 years ago

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.