-
Notifications
You must be signed in to change notification settings - Fork 41
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
Working copy checkout broken for dataset with no CRS #855
Comments
The basic issue is that one of your datasets lacks a CRS. In the meantime I have a workaround for you: the attached patch adds a CRS to the dataset, the same CRS as all your other datasets. Put the patch somewhere then run |
The patch solved my issue. Thanks a lot. |
FOREIGN KEY constraint issue above fixed by #866 |
Describe the bug
The provided kart repo appears to be clean. the kart fsck command doesn't report any issue but when trying to clone or recreate repo it throws a sqlalchemy exception.
How can I fix the faulty dataset?
To Reproduce
Steps to reproduce the behaviour:
0. download and unzip repo from: https://pashare.comune.padova.it/index.php/s/LAc8pNkgWFo2sJk
kart --repo path_to/MASTER fsck
is OKkart --repo path_to/MASTER clone path_to/MASTER_new
throws exceptionkart --repo path_to/MASTER create-workingcopy --delete-existing
throws exceptionExpected behaviour
clone or create wc without issues
Output
....Writing features for dataset 15 of 26: a0102011_ConfiniComunali
kart helper: unhandled exception
Traceback (most recent call last):
File "sqlalchemy/engine/base.py", line 1900, in _execute_context
File "sqlalchemy/engine/default.py", line 736, in do_execute
pysqlite3.dbapi2.IntegrityError: FOREIGN KEY constraint failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "kart/helper.py", line 236, in helper
File "click/core.py", line 1130, in call
File "click/core.py", line 1055, in main
File "kart/cli_util.py", line 72, in invoke
File "click/core.py", line 1657, in invoke
File "click/core.py", line 1404, in invoke
File "click/core.py", line 760, in invoke
File "click/decorators.py", line 26, in new_func
File "kart/clone.py", line 181, in clone
File "kart/working_copy.py", line 250, in reset_to_head
File "kart/working_copy.py", line 292, in reset
File "kart/working_copy.py", line 184, in create_parts_if_missing
File "kart/tabular/working_copy/base.py", line 1348, in reset
File "kart/tabular/working_copy/base.py", line 1015, in write_full
File "kart/tabular/working_copy/gpkg.py", line 264, in _write_meta
File "sqlalchemy/orm/session.py", line 1714, in execute
File "sqlalchemy/engine/base.py", line 1705, in _execute_20
File "sqlalchemy/sql/elements.py", line 334, in _execute_on_connection
File "sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement
File "sqlalchemy/engine/base.py", line 1943, in _execute_context
File "sqlalchemy/engine/base.py", line 2124, in handle_dbapi_exception
File "sqlalchemy/util/compat.py", line 211, in raise
File "sqlalchemy/engine/base.py", line 1900, in _execute_context
File "sqlalchemy/engine/default.py", line 736, in do_execute
sqlalchemy.exc.IntegrityError: (pysqlite3.dbapi2.IntegrityError) FOREIGN KEY constraint failed
[SQL: INSERT OR REPLACE INTO gpkg_geometry_columns (table_name, column_name, geometry_type_name, srs_id, z, m) VALUES (?, ?, ?, ?, ?, ?)]
[parameters: ('a0102011_ConfiniComunali', 'geom', 'MULTIPOLYGON', 0, 0, 0)]
(Background on this error at: https://sqlalche.me/e/14/gkpj)
**Version Info **
» GDAL v3.6.3; PROJ v9.2.0; PDAL v2.4.3
» PyGit2 v1.9.0; Libgit2 v1.4.2; Git v2.38.1; Git LFS v3.3.0
» SQLAlchemy v1.4.45; pysqlite3 v2.6.0/v3.40.1; SpatiaLite v5.0.1; Libpq v15.0.2
The text was updated successfully, but these errors were encountered: