After migrating data from a development environment to production, I am encountering persistent issues with Flyway migrations in a DHIS2 instance deployed on Kubernetes (GCP). Despite following recommended steps and attempting repairs, the issues with migration checksum mismatches and unresolved migrations remain.
Environment:
- DHIS2 Version: dhis2/core-dev:latest (Docker image deployed on Kubernetes in GCP)
- Database Environment: PostGIS (CNPG) databases in both source and target environments
- Flyway Version: 10.10.0 OSS Edition by Redgate
Steps to Reproduce:
- Exported data from the development CNPG PostGIS database.
- Imported data into the production CNPG PostGIS database.
- Attempted to connect to the production database through DHIS2 running in Kubernetes.
- Encountered connectivity issues preventing normal application operations.
Issue Details:
- Checksum Mismatch for Migration Version 2.41.2:
- Applied to database: -662914890
- Resolved locally: 391816887
- Despite no alterations to the migration script post-application, a checksum mismatch is detected.
- Unresolved Migration for Version 2.41.46:
- This version is flagged as applied in the database but not found locally. However, no such migration was intentionally removed.
- Executed
flyway repair
with-outOfOrder=true
and-validateOnMigrate=false
options, expecting resolution of the checksum mismatch and reconciliation of the missing migration. - Reviewed migration scripts for version 2.41.2 to ensure no unintended changes were introduced.
Logs
Migration checksum mismatch for migration version 2.41.2
→ Applied to database : -662914890
→ Resolved locally : 391816887
Either revert the changes to the migration, or run repair to update the schema history.
Detected applied migration not resolved locally: 2.41.46.
If you removed this migration intentionally, run repair to mark the migration as deleted.
@dhis2-backend - DHIS2 Backend Dev Team
@dhis2-platform - DHIS2 Apps Dev Team
1 post - 1 participant