GeoNodeUserGroup-DE / geonode-dev-datapackage

Datapackage development setup based on Docker Blueprint for GeoNode
0 stars 0 forks source link

Cascading delete lets GeoServer throw exceptions #20

Open ridoo opened 4 months ago

ridoo commented 4 months ago

Python context geoserver/helpers.py: get_store() raises FailedRequestError when calling from geoserver/helpers.py: cascading_delete():

  try:
      store = get_store(cat, name, workspace=ws)
  except FailedRequestError:
      if ogc_server_settings.DATASTORE:
          try:
              layers = Dataset.objects.filter(alternate=dataset_name)
              for layer in layers:
                  store = get_store(cat, layer.store, workspace=ws)
          except FailedRequestError:
              logger.debug("the store was not found in geoserver")
      else:
          logger.debug("the store was not found in geoserver")
  if ws is None or store is None:
      logger.debug("cascading delete was called on a layer where the workspace was not found")

Not sure, if this will leave uncleaned artifacts.

Corresponding GeoServer log output:

geoserver4geonode_datapackage  | 25 Jun 13:32:13 ERROR  [geoserver.rest] - No such wms store: geonode,horizon_data
geoserver4geonode_datapackage  | org.geoserver.rest.ResourceNotFoundException 404 NOT_FOUND: No such wms store: geonode,horizon_data
geoserver4geonode_datapackage  |        at org.geoserver.rest.catalog.WMSStoreController.getExistingWMSStore(WMSStoreController.java:181)
geoserver4geonode_datapackage  |        at org.geoserver.rest.catalog.WMSStoreController.wmsStoreGet(WMSStoreController.java:93)
geoserver4geonode_datapackage  |        at jdk.internal.reflect.GeneratedMethodAccessor586.invoke(Unknown Source)
geoserver4geonode_datapackage  |        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
geoserver4geonode_datapackage  |        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
geoserver4geonode_datapackage  |        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)