You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"I had a repo with two layers, removed one of them, and it was ok. But later I tried to reset the main branch to a few commits before (where it still had two layers), and got this error:
[12764] Failed to execute script kart_cli
Traceback (most recent call last):
File "lib\site-packages\sqlalchemy\engine\base.py", line 1707, in _execute_context
File "lib\site-packages\sqlalchemy\engine\default.py", line 716, in do_execute
pysqlite3.dbapi2.IntegrityError: UNIQUE constraint failed: gpkg_contents.table_name
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "kart_cli.py", line 4, in
File "kart\cli.py", line 333, in entrypoint
File "lib\site-packages\click\core.py", line 829, in __call__
File "lib\site-packages\click\core.py", line 782, in main
File "kart\cli.py", line 157, in invoke
File "lib\site-packages\click\core.py", line 1259, in invoke
File "lib\site-packages\click\core.py", line 1066, in invoke
File "lib\site-packages\click\core.py", line 610, in invoke
File "lib\site-packages\click\decorators.py", line 21, in new_func
File "kart\checkout.py", line 360, in reset
File "kart\checkout.py", line 48, in reset_wc_if_needed
File "kart\working_copy\base.py", line 1140, in reset
File "kart\working_copy\base.py", line 849, in write_full
File "kart\working_copy\gpkg.py", line 249, in _write_meta
File "lib\site-packages\sqlalchemy\orm\session.py", line 1670, in execute
File "lib\site-packages\sqlalchemy\engine\base.py", line 1521, in _execute_20
File "lib\site-packages\sqlalchemy\sql\elements.py", line 314, in _execute_on_connection
File "lib\site-packages\sqlalchemy\engine\base.py", line 1400, in _execute_clauseelement
File "lib\site-packages\sqlalchemy\engine\base.py", line 1750, in _execute_context
File "lib\site-packages\sqlalchemy\engine\base.py", line 1931, in _handle_dbapi_exception
File "lib\site-packages\sqlalchemy\util\compat.py", line 211, in raise_
File "lib\site-packages\sqlalchemy\engine\base.py", line 1707, in _execute_context
File "lib\site-packages\sqlalchemy\engine\default.py", line 716, in do_execute
sqlalchemy.exc.IntegrityError: (pysqlite3.dbapi2.IntegrityError) UNIQUE constraint failed: gpkg_contents.table_name
[SQL: INSERT INTO gpkg_contents (table_name, data_type, identifier, description, srs_id) VALUES (?, ?, ?, ?, ?)]
[parameters: ('buildings', 'features', 'buildings: buildings', None, 2193)]
(Background on this error at: http://sqlalche.me/e/14/gkpj)
We can make more careful updates so as not to violate unique constraints.
The text was updated successfully, but these errors were encountered:
More detail: the updates we make work as long as kart is the only one making them - in this case however the user has manually made an edit and not made it as cleanly as kart would. However, kart should still be robust enough to sort this out without crashing.
Kart updates a GPKG working copy, keeping user tables and metadata tables
such as gpkg_contents, spatial indexes, etc in sync. If the user edits
these metadata tables - or deletes a user table without updating the
metadata tables accordingly - then kart can fail when it tries to update
them next. Fix is to be less fussy when updating the metadata tables.
From koordinates/kart-qgis-plugin#18
"I had a repo with two layers, removed one of them, and it was ok. But later I tried to reset the main branch to a few commits before (where it still had two layers), and got this error:
We can make more careful updates so as not to violate unique constraints.
The text was updated successfully, but these errors were encountered: