[Geoserver-devel] [JIRA] (GEOS-7858) Deleting nested LayerGroups via catalog.remove will break the catalog

Torben Barsballe created an issue

GeoServer / BugGEOS-7858

Deleting nested LayerGroups via catalog.remove will break the catalog

Issue Type:

BugBug

Assignee:

Unassigned

Created:

16/Nov/16 9:44 PM

Priority:

MediumMedium

Reporter:

Torben Barsballe

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.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v1000.552.1#100018-sha1:c06db68)

Atlassian logo