I have published a NetCDF file (received on 2018-01-02, hourly data over the following 7 days) to GeoServer as WMS with Time enabled.

I was able to preview the layer with OpenLayers with the "time" attribute attached to the URL to the GetMap command.


The project I am working on requires the NetCDF file to be updated on GeoServer on a daily basis.

When I was doing some testing with the 2017-12-28 data (3 days older), I was not able to preview the image for 2017-12-28T01:00:00.0Z


I was not able to preview data for any date and time earlier than 2018-01-02T01:00:00.0Z.

I have turned off Tile Caching and did disable and enable the NetCDF data store.

Is there anything else I need to look at/adjust to get this working? Is this a good practice to update the data source on a regular basis on GeoServer.

Edit - time dimension from the GetCapabilities request

<Dimension name="time" default="2017-12-27T18:00:00Z" units="ISO8601">
... ...
  • can you add the time period list from the getcapabilities request to the question please
    – Ian Turton
    Jan 2, 2018 at 8:50
  • It is not bad practice to have a data source that regularly updates.
    – nmtoken
    Jan 2, 2018 at 8:58
  • How did you update the file? Jan 2, 2018 at 10:16
  • @AndreaAime. I copied the new NetCDF file to the data source folder and replaced the old one (they both have the same file name): file:workspaces/fdi/data/IDV71122_VIC_GFDI_SFC.nc. Then I disabled the data store and re-enabled it to update the time list for the Time dimension.
    – alextc
    Jan 2, 2018 at 11:19
  • does requesting 2017-12-28T02:00:00.000Z/2017-12-28T02:00:00.000Z work?
    – Ian Turton
    Jan 2, 2018 at 11:27

2 Answers 2


Just replacing the NetCDF file on disk, behind GeoServer's back, will not work in general for a couple of reasons:

  • Some information about the file is kept in memory, the new file might have a different set
  • To speed up access to the file contents a set of index files is kept on disk, which will become outdated vs the new file. The indexes are kept in a hiddent (starting with a ".") directory on the side of the NetCDF file.


  • Clean up the indexes along with the file and then force GeoServer to flush its cached information by summitting a reset command (e..g, from the UI, the "clear" button in the status page, or using the REST API)
  • Use the REST API to remove and re-create the file and associated layers
  • Thanks Andrea! Simply clearing the caching on the status page did not help. The way I got it working is disabling the NetCDF data store, deleting the directory (starting with a "." followed by the store name and unique identifier) alongside the NetCDF file, replacing the NetCDF file, and then re-enabling the data store.
    – alextc
    Jan 2, 2018 at 22:55
  • I found that overwriting the NetCDF file, and then disabling/re-enabling the store did the trick. Nov 12, 2019 at 20:01

Here is a script I made to refresh NetCDF coveragestores. It downloads the list of existing coveragestores, parses it using jq (a JSON commandline utility), downloads each one, and re-uploads each one.

srcdir="$(dirname "$0")"
source $srcdir/variables.sh
curl -u $username:$password $geoserver_base_url/geoserver/rest/workspaces/$workspace/coveragestores.json | jq '.coverageStores.coverageStore|.[]|map(.)|.[]'| while read name; read url
    name=`echo $name|sed 's!"!!g'`
    url=`echo $url |sed 's!"!!g'`
    curl -u $username:$password $url > $coveragestore
    curl -u $username:$password -XPUT -H "Content-type: application/json" -d @$coveragestore $url

variables.sh just contains things like $username, $password, $workspace and $geoserver_base_url (pretty self-explanatory variables).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.