db-sync enters an infinite drop/recreate loop when geodiff init fails on invalid source geometries
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start by tracing the sync initialization failure and the cleanup step that drops the target schemas, then reproduce it with invalid source geometries under the stated restart policy. Done means a deterministic geodiff initialization failure no longer causes an infinite destructive drop/recreate loop.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 53
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MerginMaps/db-sync
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MerginMaps/db-sync#184 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
MerginMaps/db-sync#185 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
MerginMaps/db-sync#181 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MerginMaps/db-sync#179 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
MerginMaps/db-sync#178 ·
All issues in MerginMaps/db-sync
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100