Backup error when GeoFence Resource Access Manager is configured

Description

When GeoFence Server is configured, Backup of settings sometimes causes the following exception

Caused by: java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
at org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes(RequestContextHolder.java:131)
at org.geoserver.geofence.GeofenceAccessManager.retrieveCallerIpAddress(GeofenceAccessManager.java:253)
at org.geoserver.geofence.GeofenceAccessManager.getAccessLimits(GeofenceAccessManager.java:367)
at org.geoserver.geofence.GeofenceAccessManager.getAccessLimits(GeofenceAccessManager.java:293)
at org.geoserver.security.ResourceAccessManagerWrapper.getAccessLimits(ResourceAccessManagerWrapper.java:214)
at org.geoserver.security.CatalogFilterAccessManager.getAccessLimits(CatalogFilterAccessManager.java:56)
at org.geoserver.security.SecureCatalogImpl.buildWrapperPolicy(SecureCatalogImpl.java:806)
at org.geoserver.security.SecureCatalogImpl.buildWrapperPolicy(SecureCatalogImpl.java:770)
at org.geoserver.security.SecureCatalogImpl.checkAccess(SecureCatalogImpl.java:593)
at org.geoserver.security.SecureCatalogImpl.getLayerByName(SecureCatalogImpl.java:294)
at org.geoserver.catalog.impl.AbstractFilteredCatalog.getLayerByName(AbstractFilteredCatalog.java:225)
at org.geoserver.catalog.impl.AbstractCatalogDecorator.getLayerByName(AbstractCatalogDecorator.java:384)
at org.geoserver.catalog.impl.LocalWorkspaceCatalog.getLayerByName(LocalWorkspaceCatalog.java:92)
at org.geoserver.backuprestore.tasklet.CatalogBackupRestoreTasklet.backupGWCSettings(CatalogBackupRestoreTasklet.java:768)
at org.geoserver.backuprestore.tasklet.CatalogBackupRestoreTasklet.doBackup(CatalogBackupRestoreTasklet.java:209)
... 5 more

Environment

None

Assignee

Unassigned

Reporter

Alessio Fabiani

Triage

None

Fix versions

Affects versions

None

Components

Priority

Medium
Configure