Closed etj closed 7 months ago
An heuristic check to find out if a layer is valid was already in pale, but commented out:
@mattiagiupponi reports that some valid layers were rejected by such check.
We may add a further heuristic check, and avoid ingestion if the geom type is null and the crs is not defined.
@etj it was also removed due this PR: https://github.com/GeoNode/geonode-importer/pull/159/ To allow Allow nonspatial layer import. We still make it more smart (at least for the gpkg) and remove the layers we dont want to import
The importer finds 2 layers:
aree
, which is properly importedlayer_styles
which failsThe GUI reports an error:
Celery log
``` [2024-04-09 15:49:29,459: INFO/ForkPoolWorker-8] STARTING NEXT STEP importer.import_resource [2024-04-09 15:49:35,113: INFO/ForkPoolWorker-8] Total number of layers available: 2 [2024-04-09 15:49:36,808: INFO/ForkPoolWorker-2] STARTING NEXT STEP importer.publish_resource [2024-04-09 15:49:36,808: INFO/ForkPoolWorker-2] STARTING NEXT STEP importer.publish_resource for resource: layer_styles, alternate layer_styles [2024-04-09 15:49:37,058: ERROR/ForkPoolWorker-12] error during publishing: must specify native_crs [2024-04-09 15:49:37,146: INFO/ForkPoolWorker-2] STARTING NEXT STEP importer.rollback [2024-04-09 15:49:37,146: INFO/ForkPoolWorker-2] STARTING NEXT STEP importer.rollback for resource: layer_styles, alternate layer_styles [2024-04-09 15:49:37,150: INFO/ForkPoolWorker-2] Calling rollback for execution_id b98fc0b8-cd6d-481e-90ec-398bee9ed5ad in progress [2024-04-09 15:49:37,264: WARNING/ForkPoolWorker-2] Starting rollback for execid: b98fc0b8-cd6d-481e-90ec-398bee9ed5ad resource published was: layer_styles [2024-04-09 15:49:37,264: INFO/ForkPoolWorker-2] Rollback publishing step in progress for execid: b98fc0b8-cd6d-481e-90ec-398bee9ed5ad resource published was: layer_styles [2024-04-09 15:49:37,320: ERROR/ForkPoolWorker-12] Task FAILED with ID: b98fc0b8-cd6d-481e-90ec-398bee9ed5ad, reason: must specify native_crs. Request: b98fc0b8-cd6d-481e-90ec-398bee9ed5ad [2024-04-09 15:49:37,361: INFO/ForkPoolWorker-2] Rollback dynamic model & ogr2ogr step in progress for execid: b98fc0b8-cd6d-481e-90ec-398bee9ed5ad resource published was: layer_styles [2024-04-09 15:49:37,361: INFO/ForkPoolWorker-2] Dynamic model does not exists, removing ogr2ogr table in progress [2024-04-09 15:49:38,101: WARNING/ForkPoolWorker-2] Rollback for execid: b98fc0b8-cd6d-481e-90ec-398bee9ed5ad resource published was: layer_styles completed [2024-04-09 15:49:38,135: ERROR/ForkPoolWorker-12] Task importer.publish_resource[1362c5ff-2480-41aa-9418-d6b704b976f4] raised unexpected: PublishResourceException() Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/importer/celery_tasks.py", line 236, in publish_resource _publisher.publish_resources(data) File "/usr/local/lib/python3.10/dist-packages/importer/publisher.py", line 67, in publish_resources result = self.handler.publish_resources( File "/usr/local/lib/python3.10/dist-packages/importer/handlers/common/vector.py", line 138, in publish_resources raise e File "/usr/local/lib/python3.10/dist-packages/importer/handlers/common/vector.py", line 126, in publish_resources catalog.publish_featuretype( File "/usr/local/lib/python3.10/dist-packages/geoserver/catalog.py", line 898, in publish_featuretype raise ValueError("must specify native_crs") ValueError: must specify native_crs During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/celery/app/trace.py", line 477, in trace_task R = retval = fun(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/celery/app/trace.py", line 760, in __protected_call__ return self.run(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/importer/celery_tasks.py", line 282, in publish_resource raise PublishResourceException(detail=error_handler(e, execution_id)) importer.api.exception.PublishResourceException: must specify native_crs. Request: b98fc0b8-cd6d-481e-90ec-398bee9ed5ad [2024-04-09 15:49:41,878: INFO/ForkPoolWorker-12] STARTING NEXT STEP importer.publish_resource [2024-04-09 15:49:41,878: INFO/ForkPoolWorker-12] STARTING NEXT STEP importer.publish_resource for resource: aree, alternate aree [2024-04-09 15:49:44,140: INFO/ForkPoolWorker-9] STARTING NEXT STEP importer.create_geonode_resource [2024-04-09 15:49:44,140: INFO/ForkPoolWorker-9] STARTING NEXT STEP importer.create_geonode_resource for resource: aree, alternate aree [2024-04-09 15:49:44,750: INFO/ForkPoolWorker-9] [2024-04-09 15:49:44,750: INFO/ForkPoolWorker-9] 0 batches, 0 sent [2024-04-09 15:49:44,750: INFO/ForkPoolWorker-9] done in 0.05 seconds [2024-04-09 15:49:50,120: DEBUG/ForkPoolWorker-12] Checking for permissions. [2024-04-09 15:49:50,138: DEBUG/ForkPoolWorker-12] There are no permissions for this object, setting default perms. [2024-04-09 15:49:50,206: DEBUG/ForkPoolWorker-12] Finalizing (permissions and notifications) on resource geonode:aree [2024-04-09 15:49:50,207: DEBUG/ForkPoolWorker-12] Setting permissions {'users': {}, 'groups': {HTTP Status 403 \u2013 Forbidden
Type Status Report
Message Can't delete style referenced by existing layers.
Description The server understood the request but refuses to authorize it.
Apache Tomcat/9.0.85
[2024-04-09 15:49:57,065: DEBUG/ForkPoolWorker-12] save_style: Retrieving style "geonode:aree" for layer "geonode:aree [2024-04-09 15:49:57,222: DEBUG/ForkPoolWorker-12] clean_styles: Retrieving style "aree" for cleanup [2024-04-09 15:49:57,248: DEBUG/ForkPoolWorker-12] clean_styles: Style does not exist: aree [2024-04-09 15:49:57,252: DEBUG/ForkPoolWorker-12] -- Resource Links[Legend link] for layer aree... [2024-04-09 15:49:57,262: DEBUG/ForkPoolWorker-12] -- Resource Links[Legend link]...done! [2024-04-09 15:50:01,410: DEBUG/ForkPoolWorker-12] ...Checking if image is a blank image [2024-04-09 15:50:01,684: ERROR/ForkPoolWorker-9] ['import'] ```Table
gpkg_contents
:Table
layer_styles
:ogrinfo