Skip to content

db-sync enters an infinite drop/recreate loop when geodiff init fails on invalid source geometries #182

@MTrim

Description

@MTrim

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

  1. Configure a sync connection (GPKG → PostGIS), schema does not exist yet (fresh init).
  2. 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.
  3. Start the daemon under restart: unless-stopped.

Result: init fails in geodiff, db-sync drops + _base, the container restarts and repeats indefinitely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions