[Geoserver-users] ImageMosaic + PostGIS query returns wrong file names

Hello,

My set-up consists of several ImageMosaic stores with PostGIS data store. Two dimensions are defined - a "time" and a "forecast". All stores are updated every hour with new geotiffs.

After about two days of runtime Geoserver starts to show wrong pictures - instead of expected "forecast" value, it uses value taken about 15-20 steps (hours) earlier. Moreover, all next step request are shifted the same amount of hours (offset) back (until server restart/clear).

I found that something happens after the ImageMosaic query PostGIS about file name. In the following example, the query itself looks correct, but file name is wrong - it is "0100" (forecast "100") instead of "1900".

I believe that PostGIS table is correct. The same query asked manually returns proper name.

All you need in that case is to clear resource cache in Geoserver - from that on everything works perfectly (since next failure after one or two days).

That looks like Geoserver starts to use some old (cached) responses or old connections to the database?

Regards

Maciej

2015-09-03 07:13:24,891 DEBUG [geotools.jdbc] - SELECT "fid",encode(ST_AsEWKB("the_geom"),'base64') as "the_geom","location","time","forecast" FROM "public"."UM1_HIGH_CLOUD_AMOUNT" WHERE ("the_geom" && ST_GeomFromWKB(?, 100101
) AND "time" <= ? AND "time" IS NOT NULL AND "time" >= ? AND "forecast" = ? AND "forecast" IS NOT NULL )
2015-09-03 07:13:24,891 DEBUG [geotools.jdbc] - 1 = POLYGON ((-1.7600189734073737 -3.7571876107040336, -1.7600189734073737 0.1875907849611185, 2.287338214041183 0.1875907849611185, 2.287338214041183 -3.7571876107040336, -1.7600
189734073737 -3.7571876107040336))
2015-09-03 07:13:24,891 DEBUG [geotools.jdbc] - 2 = 2015-09-03 00:00:00.999
2015-09-03 07:13:24,891 DEBUG [geotools.jdbc] - 3 = 2015-09-03 00:00:00.0
2015-09-03 07:13:24,891 DEBUG [geotools.jdbc] - 4 = 1900
2015-09-03 07:13:24,892 DEBUG [gce.imagemosaic] - Trying to resolve path:
type:RELATIVE
parentLocation:file:some_directory
location:some_field_2015090300+0100.tiff

***should be: some_field_2015090300+1900.tiff

Geoserver 2.7.2 on Ubuntu 14, Oracle Java 8.0.60 (version 7 tested also), PostgreSQL 9.3.