Skip to content

KeyError: 'version' in pull() and push() after server update (May 25, 2026) #180

@robinbonnefoy

Description

@robinbonnefoy

Bug: KeyError: 'version' in pull() and push() after server update (May 25, 2026)

Description

Since the Mergin Maps server update on May 25, 2026, mergin-db-sync (both the pre-compiled exe v2.1.1 and the Python sources) fails with a KeyError: 'version' during pull and push operations.

The root cause is that mc.get_projects_by_names() now returns {'project/name': {'error': 404}} instead of the expected project info dict containing a 'version' key. This appears to be a breaking change in the server API response format.

Steps to reproduce

  1. Use mergin-db-sync v2.1.1 (exe or Python sources)
  2. Run with --single-run against a valid Mergin Maps project
  3. Init completes successfully, but pull (and push) fail immediately after

Error

Traceback (most recent call last):
  File "dbsync_daemon.py", line 203, in <module>
  File "dbsync_daemon.py", line 154, in main
  File "dbsync.py", line 1465, in dbsync_pull
  File "dbsync.py", line 762, in pull
    server_version = projects[project_path]["version"]
KeyError: 'version'

Debug output

Adding a print before line 762 shows:

DEBUG: {'FREDON-Occitanie/project_name': {'error': 404}}

Workaround

Replacing get_projects_by_names() with mc.project_info() fixes the issue:

# Before (broken)
projects = mc.get_projects_by_names([mp.project_full_name()])
server_version = projects[mp.project_full_name()]["version"]

# After (working)
project_info = mc.project_info(mp.project_full_name())
server_version = project_info["version"]

The same fix needs to be applied in both pull() (line ~762) and push() (line ~1018).

Environment

  • mergin-db-sync: 2.1.1
  • OS: Windows 10
  • Broke after Mergin Maps server update on May 25, 2026
  • Was working correctly the day before

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