'Geoserver GeoWebCache inconsistency

We are using geoserver 2.19.2 to publish the layer and have enabled Direct Integration with Geoserver WMS. But the layers are not getting cached when load. And main problem is its much inconsistent. It gets cached for some layer but for some, it is not. There is no specific cases for not creating the cache. Please help how can we resolve this. We have been extensively using geoserver hence need this webcache to be available else geoserver getting restart automatically.

We are using single instance of geoserver and when tried to hit the wms url from browser, gives the following error

<ServiceExceptionReport xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3.0" xsi:schemaLocation="http://www.opengis.net/ogc http://rallis.tcsdfi.tcsapps.in/geoserver1/schemas/wms/1.3.0/exceptions_1_3_0.xsd">
<ServiceException> java.lang.IllegalStateException: Could not locate a layer or layer group with id LayerInfoImpl--2a92d021:17ec882cc29:-4c28 within GeoServer configuration, the GWC configuration seems to be out of synch Could not locate a layer or layer group with id LayerInfoImpl--2a92d021:17ec882cc29:-4c28 within GeoServer configuration, the GWC configuration seems to be out of synch </ServiceException>
</ServiceExceptionReport>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source