-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GEODIFF: Error: Unable to prepare SQL statement #85
Comments
@jreinier can you please post how do you run db-sync, what is the configuration? (just make sure to remove any passwords) Also, if you delete the "modified" and "base" schemas in your postgresql database and restart db-sync, does it work? |
Here is what I run: docker run --name mergin_db_sync -it -e MERGIN__USERNAME=user -e MERGIN__PASSWORD="password" -e CONNECTIONS="[{driver='postgres', conn_info='host=host dbname=dbname user=db_user password=db_password', modified='wetland', base='sync_base', mergin_project='Cleveland-Metroparks/nr_test', sync_file='cm_wetlands.gpkg', If I test without using any existing schemas and run what is below, things seem to work. However, I very much want to use an existing table in an existing schema as above. docker run --name mergin_db_sync -it -e MERGIN__USERNAME=user -e MERGIN__PASSWORD="password" -e CONNECTIONS="[{driver='postgres', conn_info='host=host dbname=db_name user=db_user password=db_password', modified='sync_modified', base='sync_base', mergin_project='Cleveland-Metroparks/nr_test', sync_file='cm_wetlands.gpkg'}]" lutraconsulting/mergin-db-sync:latest python3 dbsync_daemon.py --init-from-gpkg |
And here is the table schema for the existing table I want to use. I was curious if there was maybe something about the default value for polygon_number since it's not a straightforward sequence. CREATE TABLE wetland.cm_wetlands ( UPDATE: The sequence issue I mention above is not the problem. I tried a test run without that polygon_number field and I got the same error that I opened the issue about. |
After lots of troubleshooting, I've gotten an error I can't seem to work around.
== starting mergin-db-sync daemon == version 1.1.2 ==
Logging in to Mergin...
Processing Mergin Maps project 'Cleveland-Metroparks/nr_test'
Connecting to the database...
Modified and base schemas already exist
Downloading version v1 of Mergin Maps project Cleveland-Metroparks/nr_test to /tmp/dbsync/nr_test
Error: diff failed!
GEODIFF: Error: Unable to prepare SQL statement in prepare() call (SQLITE3 error [1]: near ")": syntax error)
Error: Failed to create a copy of modified source for driver postgres
Traceback (most recent call last):
File "dbsync_daemon.py", line 63, in
main()
File "dbsync_daemon.py", line 33, in main
dbsync.dbsync_init(mc, from_gpkg=True)
File "/mergin-db-sync/dbsync.py", line 666, in dbsync_init
init(conn, mc, from_gpkg)
File "/mergin-db-sync/dbsync.py", line 551, in init
summary_modified = _compare_datasets("sqlite", "", gpkg_full_path, conn_cfg.driver,
File "/mergin-db-sync/dbsync.py", line 148, in _compare_datasets
_geodiff_create_changeset_dr(src_driver, src_conn_info, src, dst_driver, dst_conn_info, dst, tmp_changeset, ignored_tables)
File "/mergin-db-sync/dbsync.py", line 138, in _geodiff_create_changeset_dr
_run_geodiff([config.geodiff_exe, "diff", "--driver-1", src_driver, src_conn_info, "--driver-2", dst_driver, dst_conn_info, "--skip-tables", _tables_list_to_string(ignored_tables), src, dst, changeset])
File "/mergin-db-sync/dbsync.py", line 75, in _run_geodiff
raise DbSyncError("geodiff failed!\n" + str(cmd))
dbsync.DbSyncError: geodiff failed!
The text was updated successfully, but these errors were encountered: