Uploaded image for project: 'GeoServer'
  1. GeoServer
  2. GEOS-7858

Deleting nested LayerGroups via catalog.remove will break the catalog

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.3, 2.10.1, 2.11-beta
    • Component/s: None
    • Labels:
      None

      Description

      If you delete a layerGroup that is contained within another layerGroup by any method that uses Catalog.remove() (rather than CascadingDeleteVisitor), you will corrupt the catalog; The deleteion will succed but not update the containing layer group, meaning that any further events to access the remaining layer group will fail with the following error:

      Caused by: java.lang.NullPointerException
      	at org.geoserver.security.SecureCatalogImpl.checkAccess(SecureCatalogImpl.java:631)
      	at org.geoserver.security.SecureCatalogImpl.checkAccess(SecureCatalogImpl.java:490)
      	at org.geoserver.security.SecureCatalogImpl.checkAccess(SecureCatalogImpl.java:634)
      	at org.geoserver.security.SecureCatalogImpl.filterGroups(SecureCatalogImpl.java:959)
      	at org.geoserver.security.SecureCatalogImpl.getLayerGroupsByWorkspace(SecureCatalogImpl.java:328)
      	at org.geoserver.catalog.impl.AbstractFilteredCatalog.getLayerGroupsByWorkspace(AbstractFilteredCatalog.java:259)
      	at org.geoserver.catalog.impl.AbstractCatalogDecorator.getLayerGroupsByWorkspace(AbstractCatalogDecorator.java:466)
      	at org.geoserver.catalog.impl.LocalWorkspaceCatalog.getLayerGroupsByWorkspace(LocalWorkspaceCatalog.java:210)
      	at org.geoserver.catalog.rest.LayerGroupListResource.handleListGet(LayerGroupListResource.java:32)
      	at org.geoserver.catalog.rest.LayerGroupListResource.handleListGet(LayerGroupListResource.java:1)
      	at org.geoserver.catalog.rest.AbstractCatalogListResource.handleObjectGet(AbstractCatalogListResource.java:41)
      	at org.geoserver.rest.ReflectiveResource.handleGet(ReflectiveResource.java:89)
      	... 89 more
      

      This occurs because the LayerGroup still holds a reference to the deleted layer group, so we get stuck with a ResolvingProxy containing "null" in place of the deleted layerGroup.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                tbarsballe Torben Barsballe
                Reporter:
                tbarsballe Torben Barsballe
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: