Skip to content

A failed initial run of db-sync may leave broken project folder half-initialized #174

@wonder-sk

Description

@wonder-sk

It may happen that if db-sync failed during initialization, the project folder can exist, and then it blocks further db-sync runs. If we have a failure during init, we should make sure to clean up the project directory to avoid such issue:

PS C:\Users\ivana\Documents\DB SYNC> .\dbsync_daemon.exe config.yaml
== starting mergin-db-sync daemon == version 2.1.1 ==
Using config file: config.yaml
Email notifications for sync failures are not set up. It is recommended to use them. Please see documentation.
Logging in to Mergin...
Going to log in user [ivana.kuklicova@lutraconsulting.co.uk](mailto:ivana.kuklicova@lutraconsulting.co.uk)
User ivana.kuklicova successfully logged in.
Processing Mergin Maps project 'Iva Testing/test_db_sync'
Connecting to the database...
Modified and base schemas already exist
Error: Project metadata has not been created yet
Removing local working directory C:/Users/ivana/AppData/Local/Temp/dbsync\test_db_sync
Traceback (most recent call last):
  File "dbsync.py", line 1163, in init
  File "dbsync.py", line 549, in _get_project_version
  File "mergin\merginproject.py", line 138, in metadata
mergin.common.InvalidProject: Project metadata has not been created yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    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