Skip to content

tool fails to restart after its stopped #30

Closed

Description

@HugoP27

Hi guys

After building the docker container everything works great, but once its stopped and I restart the container using:
docker start container_name -a
I get the error shown in the screenshot. This is a test project so its only me working on it and I did not make any changes so there shouldn't be any differences between the gpkg and db.

tool-restart-error

Activity

  1. wonder-sk commented on Mar 9, 2021

    @wonder-sk
    Contributor

    hi @HugoP27 - I think this is an instance of #29 - our colleague @varmar05 is looking into that now.

    The error message is a bit misleading, actually the thing is that the "modified" schema has some pending changes which should be pushed to Mergin, but the db-sync does not like that. The fix (probably tomorrow) will relax the check and allow some pending modifications in "modified" schema when restarting the sync daemon.

  2. wonder-sk commented on Mar 10, 2021

    @wonder-sk
    Contributor

    hi @HugoP27 - #29 is now fixed, please could you update your local git repository and rebuild your container? The error should be gone now.

  3. HugoP27 commented on Mar 19, 2021

    @HugoP27
    Author

    Hi @wonder-sk
    thank you and apologies for the late response, unfortunately I still receive an error, I did the following:

    1. Removed existing docker containers and images

    2. removed cloned repo from ubuntu server

    3. cloned updated repo using 'git clone --repo url--'

    4. ran 'docker build --no-cache -t mergin_db_sync .'

    5. after the build succeeded I deleted the existing schemas from Postgres and ran the following command:
      sudo docker run -it
      -e DB_CONN_INFO="host=--db_url-- dbname=--db_name-- user=--user-- password=--user_password--
      -e DB_SCHEMA_MODIFIED=fca_main_test
      -e DB_SCHEMA_BASE=fca_base_test
      -e MERGIN_USERNAME=--mergin_user--
      -e MERGIN_PASSWORD=--Mergin_Password--
      -e MERGIN_PROJECT_NAME="--project_name--"
      -e MERGIN_SYNC_FILE="field_consult.gpkg"
      mergin_db_sync python3 dbsync_daemon.py --init-from-gpkg

    6. after it succeeds everything works:
      success

    7. I then stop the sync tool using ctrl + c and restart it using the command in point 5 and get this error:
      image

  4. wonder-sk commented on Mar 22, 2021

    @wonder-sk
    Contributor

    Sorry about that - another issue has showed up related to restart - it will be fixed within #34 soon...

  5. bartverhaar commented on Mar 25, 2021

    @bartverhaar

    Hi,

    I run into the same issue as HugoP27 at a restart and was glad to see your solution.
    This morning i pulled the latest master and get it up and running.
    But, now after a restart i get the following error:

    Logging in to Mergin...
    Connecting to the database...
    Download version v36 of Mergin project projectname to /tmp/dbsync
    Traceback (most recent call last):
      File "dbsync_daemon.py", line 62, in <module>
        main()
      File "dbsync_daemon.py", line 32, in main
        dbsync.dbsync_init(mc, from_gpkg=True)
      File "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/mergin-db-sync/dbsync.py", line 506, in dbsync_init
        mc.download_project(config.mergin_project_name, config.project_working_dir, db_proj_info["version"])
    TypeError: download_project() takes 3 positional arguments but 4 were given
    

    The startscript is:
    docker run -it -e DB_CONN_INFO="host=hostname dbname=dbname user=username password=password" -e DB_SCHEMA_MODIFIED=sync_main -e DB_SCHEMA_BASE=sync_base -e MERGIN_USERNAME=username -e MERGIN_PASSWORD=password -e MERGIN_PROJECT_NAME=projectname -e MERGIN_SYNC_FILE=package.gpkg mergin_db_sync python3 dbsync_daemon.py --init-from-gpkg

  6. wonder-sk commented on Mar 25, 2021

    @wonder-sk
    Contributor

    @bartverhaar please rebuild your container with --no-cache option... Or alternatively please use the now official lutraconsulting/mergin-db-sync container from docker hub: https://hub.docker.com/r/lutraconsulting/mergin-db-sync
    You may also need to remove your "base"+"modified" schemas in the database (but then restarting should work fine)

  7. wonder-sk commented on Mar 25, 2021

    @wonder-sk
    Contributor

    @HugoP27 We have just released version 1.0 - please could you try again? As noted in my comment above, we have now an official container in the docker hub, so there's no need to build the container manually anymore. The problem you have had should just go away - now the db-sync tool should be able to restart without problem even if the mergin project or the database have been modified in the meantime. Just note that you would need to delete your sync DB schemas - hopefully for the last time :-)

  8. bartverhaar commented on Mar 25, 2021

    @bartverhaar

    Thanks for the fast reply! Rebuilding makes the error go away.
    Except... I got the following error now.... both with the rebuild container as with the official mergin-db-sync container from hub.docker.com.

    Traceback (most recent call last): File "dbsync_daemon.py", line 62, in <module> main() File "dbsync_daemon.py", line 32, in main dbsync.dbsync_init(mc, from_gpkg=True) File "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/mergin-db-sync/dbsync.py", line 532, in dbsync_init raise DbSyncError("The db schemas already exist but 'base' schema is not synchronized with source GPKG") dbsync.DbSyncError: The db schemas already exist but 'base' schema is not synchronized with source GPKG

  9. wonder-sk commented on Apr 12, 2021

    @wonder-sk
    Contributor

    All these issues should be hopefully fixed in the new 1.0.2 release - please try the new 1.0.2 container from Docker Hub:
    https://hub.docker.com/r/lutraconsulting/mergin-db-sync/tags

    I am going to close this, please feel free to reopen if you still encounter any issues.

  10. HugoP27 commented on Apr 12, 2021

    @HugoP27
    Author

    Hi @wonder-sk
    Apologies for the late response. Great stuff, thank you!! I will test it by the end of this week/early next week and let you know if there are still issues. Really appreciate all your work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions