When init of a sync connection fails with "Initialization of db-sync failed due to a bug in geodiff", mergin-db-sync runs its cleanup step which drops the target schemas ( and _base). Because the container runs under restart: unless-stopped and the failure is deterministic (same source data every time), the daemon restarts, re-initializes, hits the same geodiff failure, drops the schemas again, and so on — an infinite, destructive loop.
Steps to reproduce
- Configure a sync connection (GPKG → PostGIS), schema does not exist yet (fresh init).
- The source GPKG contains at least one geometric defect, e.g.:
a MULTILINESTRING with a degenerate component ("Too few points in geometry component"),
empty geometries (ST_IsEmpty = true) in point/line tables,
(possibly) 3D (Z) geometries.
- Start the daemon under restart: unless-stopped.
Result: init fails in geodiff, db-sync drops + _base, the container restarts and repeats indefinitely.
When init of a sync connection fails with "Initialization of db-sync failed due to a bug in geodiff", mergin-db-sync runs its cleanup step which drops the target schemas ( and _base). Because the container runs under restart: unless-stopped and the failure is deterministic (same source data every time), the daemon restarts, re-initializes, hits the same geodiff failure, drops the schemas again, and so on — an infinite, destructive loop.
Steps to reproduce
a MULTILINESTRING with a degenerate component ("Too few points in geometry component"),
empty geometries (ST_IsEmpty = true) in point/line tables,
(possibly) 3D (Z) geometries.
Result: init fails in geodiff, db-sync drops + _base, the container restarts and repeats indefinitely.