I use tile cache for my raster layers, but my configuration was probably not perfect because recently my GeoServer stopped working. I think it was due to a lack of available disk space. To get access to GeoServer again, I had to manually delete a raster cache. Since then I've had an error that I can't fix.
I get the following error:
Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unique index or primary key violation: PRIMARY_KEY_B ON PUBLIC.TILEPAGE(KEY); SQL statement: CREATE PRIMARY KEY ON PUBLIC.TILEPAGE(KEY) [23001-119])
Which is shown on the home page as soon as I log in as admin:
I also get it on the disk quota page:
My geoserver.log looks like this:
26 025 09:25:34 CONFIG [diskquota.ConfigLoader] - Quota config is: gwc/geowebcache-diskquota.xml 26 025 09:25:35 ERROR [geoserver.gwc] - Failed to get a quota store, the GeoWebCache disk quota subsystem will stop working now org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unique index or primary key violation: PRIMARY_KEY_B ON PUBLIC.TILEPAGE(KEY); SQL statement: CREATE PRIMARY KEY ON PUBLIC.TILEPAGE(KEY) [23001-119]) at
and this:
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unique index or primary key violation: PRIMARY_KEY_B ON PUBLIC.TILEPAGE(KEY); SQL statement: CREATE PRIMARY KEY ON PUBLIC.TILEPAGE(KEY) [23001-119]) at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:261) ... 133 more Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: PRIMARY_KEY_B ON PUBLIC.TILEPAGE(KEY); SQL statement: CREATE PRIMARY KEY ON PUBLIC.TILEPAGE(KEY) [23001-119] at ... 136 more 26 025 09:25:36 CONFIG [diskquota.ConfigLoader] - Quota config is: gwc/geowebcache-diskquota.xml 26 025 09:25:36 INFO
[diskquota.DiskQuotaMonitor] - Shutting down clean up executor service... 26 025 09:25:36 CONFIG [diskquota.DiskQuotaMonitor] - Setting up disk quota periodic enforcement task 26 025 09:25:36 CONFIG [diskquota.DiskQuotaMonitor] - 0 layers configured with their own quotas. 26 025 09:25:36 CONFIG [diskquota.DiskQuotaMonitor] - 0 layers attached to global quota 1,0 GB 26 025 09:25:36 CONFIG [diskquota.DiskQuotaMonitor] - Disk quota periodic enforcement task set up every 10 SECONDS 26 025 09:25:36 ERROR [pageStore.DiskDataStore] - /opt/tomcat/work/Catalina/localhost/geoserver/wicket-filestore/4361/7388/47D04DF3AB2454477729C63332286386/data (Aucun fichier ou dossier de ce type) java.io.FileNotFoundException: /opt/tomcat/work/Catalina/localhost/geoserver/wicket-filestore/4361/7388/47D04DF3AB2454477729C63332286386/data (Aucun fichier ou dossier de ce type) at java.base/java.io.RandomAccessFile.open0(Native Method) at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:345) at java.base/java.io.RandomAccessFile.(RandomAccessFile.java:259) at java.base/java.io.RandomAccessFile.(RandomAccessFile.java:214) at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.getFileChannel(DiskDataStore.java:428) at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(DiskDataStore.java:346) at org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDataStore.java:185) at org.apache.wicket.pageStore.AsynchronousDataStore$PageSavingRunnable.run(AsynchronousDataStore.java:355) at java.base/java.lang.Thread.run(Thread.java:829) 26 025 09:25:36 WARN [pageStore.DiskDataStore] - Cannot save page with id '9' because the data file cannot be opened. 26 025 09:25:36 ERROR [pageStore.DiskDataStore] - /opt/tomcat/work/Catalina/localhost/geoserver/wicket-filestore/4361/7388/47D04DF3AB2454477729C63332286386/data (Aucun fichier ou dossier de ce type) java.io.FileNotFoundException: /opt/tomcat/work/Catalina/localhost/geoserver/wicket-filestore/4361/7388/47D04DF3AB2454477729C63332286386/data (Aucun fichier ou dossier de ce type) at java.base/java.io.RandomAccessFile.open0(Native Method) at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:345) at java.base/java.io.RandomAccessFile.(RandomAccessFile.java:259) at java.base/java.io.RandomAccessFile.(RandomAccessFile.java:214) at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.getFileChannel(DiskDataStore.java:428) at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(DiskDataStore.java:346) at org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDataStore.java:185) at org.apache.wicket.pageStore.AsynchronousDataStore$PageSavingRunnable.run(AsynchronousDataStore.java:355) at java.base/java.lang.Thread.run(Thread.java:829)
I tried to enable/disable disk quota and restarted Apache2 and Tomcat several times.
I use GeoServer 2.21.1 and it runs on Apache Tomcat 9 (running on Debian 11). How can I reconfigure my GeoServer so that it works as expected again?