1

I have a problem with adding a new NetCDF store. I use NetCDF plugin for GeoServer. The error is displayed below:

GeoServer error

Message text is like (same problem on a different system):

Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:coverages/Nstor/nstor-cf.nc and hints Hints: EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@6d656d0c[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] REPOSITORY = org.geoserver.catalog.CatalogRepository@2db8b90e System defaults: COMPARISON_TOLERANCE = 1.0E-8 GRID_COVERAGE_FACTORY = GridCoverageFactory TILE_ENCODING = null FEATURE_FACTORY = org.geotools.feature.LenientFeatureFactoryImpl@54728f47 LENIENT_DATUM_SHIFT = true FORCE_LONGITUDE_FIRST_AXIS_ORDER = true STYLE_FACTORY = StyleFactoryImpl FILTER_FACTORY = FilterFactoryImpl FORCE_AXIS_ORDER_HONORING = http

From the error I can conclude that there is a problem with coordinate system or coordinate order. But at the same time I can open the same file in QGIS. QGIS reads coordinate system correctly (see figure below):

QGIS reads NetCDF correctly

I don't have enough experience to inspect NetCDF file structure in detail with Python and cannot provide more details about the file structure.

Could someone explain how to correct this error?

GeoServer log:

2020-05-08 10:13:46,461 WARN [io.netcdf] - Unable to connect
org.geotools.data.DataSourceException: Unable to connect
    at org.geotools.coverage.io.netcdf.NetCDFReader.<init>(NetCDFReader.java:161)
    at org.geotools.coverage.io.netcdf.NetCDFFormat.getReader(NetCDFFormat.java:94)
    at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1556)
    at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1502)
    at org.geoserver.catalog.impl.CoverageStoreInfoImpl.getGridCoverageReader(CoverageStoreInfoImpl.java:53)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)

Caused by: org.geotools.data.DataSourceException: java.lang.IllegalArgumentException: Couldn't determine time units from unit string 'day as %Y%m%d.%f'
    at org.geotools.coverage.io.netcdf.NetCDFAccess.<init>(NetCDFAccess.java:139)
    at org.geotools.coverage.io.netcdf.NetCDFDriver.connect(NetCDFDriver.java:92)
    at org.geotools.coverage.io.impl.DefaultFileDriver.process(DefaultFileDriver.java:228)
    at org.geotools.coverage.io.netcdf.NetCDFReader.<init>(NetCDFReader.java:158)
    ... 156 more
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: Couldn't determine time units from unit string 'day as %Y%m%d.%f'
    at org.geotools.imageio.netcdf.NetCDFImageReader.setInput(NetCDFImageReader.java:287)
    at javax.imageio.ImageReader.setInput(ImageReader.java:380)
    at org.geotools.coverage.io.netcdf.NetCDFAccess.<init>(NetCDFAccess.java:128)
    ... 159 more
Caused by: java.lang.IllegalArgumentException: Couldn't determine time units from unit string 'day as %Y%m%d.%f'
    at org.geotools.imageio.netcdf.cv.TimeCoordinateVariable.<init>(TimeCoordinateVariable.java:71)
    at org.geotools.imageio.netcdf.cv.CoordinateVariable.create(CoordinateVariable.java:264)
    at org.geotools.imageio.netcdf.NetCDFGeoreferenceManager.initCoordinates(NetCDFGeoreferenceManager.java:616)
    at org.geotools.imageio.netcdf.NetCDFGeoreferenceManager.<init>(NetCDFGeoreferenceManager.java:575)
    at org.geotools.imageio.netcdf.NetCDFImageReader.init(NetCDFImageReader.java:506)
    at org.geotools.imageio.netcdf.NetCDFImageReader.setInput(NetCDFImageReader.java:285)
    ... 161 more
2020-05-08 10:13:46,471 INFO [geoserver.web] - Getting list of coverages for saved store file:workspaces/geoikp/climate_projections_HZG/hotdays_eur11_rcp85_p10_abschg_2036_2065_i.nc
java.lang.RuntimeException: Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:workspaces/geoikp/climate_projections_HZG/hotdays_eur11_rcp85_p10_abschg_2036_2065_i.nc and hints Hints:
  EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@4b14e299[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
  REPOSITORY       = org.geoserver.catalog.CatalogRepository@1f2746ae                                                                                   
System defaults:
  FILTER_FACTORY                   = FilterFactoryImpl                                      
  FEATURE_FACTORY                  = org.geotools.feature.LenientFeatureFactoryImpl@67ffd911
  FORCE_LONGITUDE_FIRST_AXIS_ORDER = true                                                   
  FORCE_AXIS_ORDER_HONORING        = http                                                   
  STYLE_FACTORY                    = StyleFactoryImpl                                       
  GRID_COVERAGE_FACTORY            = GridCoverageFactory                                    
    TILE_ENCODING                  = null                                                   
  LENIENT_DATUM_SHIFT              = true                                                   
  COMPARISON_TOLERANCE             = 1.0E-8                                                 

    at org.geoserver.web.data.layer.NewLayerPageProvider.getItemsInternal(NewLayerPageProvider.java:170)
    at org.geoserver.web.data.layer.NewLayerPageProvider.getItems(NewLayerPageProvider.java:47)

...

Caused by: java.io.IOException: Failed to create reader from file:workspaces/geoikp/climate_projections_HZG/hotdays_eur11_rcp85_p10_abschg_2036_2065_i.nc and hints Hints:
  EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@4b14e299[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
  REPOSITORY       = org.geoserver.catalog.CatalogRepository@1f2746ae                                                                                   
System defaults:
  FILTER_FACTORY                   = FilterFactoryImpl                                      
  FEATURE_FACTORY                  = org.geotools.feature.LenientFeatureFactoryImpl@67ffd911
  FORCE_LONGITUDE_FIRST_AXIS_ORDER = true                                                   
  FORCE_AXIS_ORDER_HONORING        = http                                                   
  STYLE_FACTORY                    = StyleFactoryImpl                                       
  GRID_COVERAGE_FACTORY            = GridCoverageFactory                                    
    TILE_ENCODING                  = null                                                   
  LENIENT_DATUM_SHIFT              = true                                                   
  COMPARISON_TOLERANCE             = 1.0E-8                                                 

    at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1558)
    at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1502)
    at org.geoserver.catalog.impl.CoverageStoreInfoImpl.getGridCoverageReader(CoverageStoreInfoImpl.java:53)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.geoserver.catalog.impl.ModificationProxy.invoke(ModificationProxy.java:127)
    at com.sun.proxy.$Proxy28.getGridCoverageReader(Unknown Source)
    at org.geoserver.web.data.layer.NewLayerPageProvider.getItemsInternal(NewLayerPageProvider.java:86)
    ... 145 more
4
  • why can you conclude there is a projection problem? You need to add the relevant part of the log file to your question using edit and the gdalinfo results would be more convincing than QGIS in telling us about your files projection
    – Ian Turton
    May 8, 2020 at 10:06
  • @Ian, I added geoserver log. May 8, 2020 at 10:28
  • 1
    Please Edit the question so that the error text is text in the body of the question. Images are not legible on all devices or serachable. The relevant part of the log is unlikely to exceed posting limits. Few here follow links (which is good IT practice), so if you want the question answered, you'll need to place sufficient details in the body of the question.
    – Vince
    May 8, 2020 at 10:58
  • I have the same issue on GeoServer 2.17.1. I added my error message text to the question
    – nmtoken
    Jul 21, 2020 at 17:01

2 Answers 2

1

The error message in the log makes this clear

Couldn't determine time units from unit string 'day as %Y%m%d.%f'

Your time units are in the wrong format. May be you can use some other tool to convert or fix your file.

1

The file time unit cannot be parsed, the file is probably not CF compliant. See the error message:

"Caused by: java.lang.IllegalArgumentException: Couldn't determine time units from unit string 'day as %Y%m%d.%f'"

I'm guessing QGIS is ignoring the time, instead of trying to parse it.

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.