3

When I try to save a new imagemosaic store I get the following error:

Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:///home/jswitzer/postgis_rasters and hints null

In my postgis database a new table does get auto created with the following ddl:

create TABLE postgis_rasters (
    fid integer not null default nextval('postgis_rasters_fid_seq'::regclass),
    the_geom geometry(Polygon,4269),
    location varchar(255),
    ingestion timestamp,
    PRIMARY KEY (fid)
);
CREATE UNIQUE INDEX postgis_rasters_pkey ON postgis_rasters (fid);
CREATE INDEX spatial_postgis_rasters_the_geom ON postgis_rasters (the_geom);

Here are the contents of /home/jswitzer/postgis_rasters

-rwxrwxrwx 1 jswitzer jswitzer      167 Nov 23 15:10 datastore.properties
-rwxrwxrwx 1 jswitzer jswitzer      161 Nov 23 15:14 indexer.properties
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150101.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150102.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150103.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150104.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150105.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150106.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150107.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150108.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150109.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150110.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150111.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150112.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150113.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150114.tif
-rwxrwxrwx 1 jswitzer jswitzer 25621641 Nov 23 15:17 rtma_tmax_20150115.tif
-rwxrwxrwx 1 root     root            4 Nov 23 15:43 sample_image
-rwxrwxrwx 1 jswitzer jswitzer       15 Nov 23 15:15 timeregex.properties

datastore.properties:

SPI=org.geotools.data.postgis.PostgisNGDataStoreFactory
host=localhost
port=*****
database=****
schema=public
user=*****
passwd=*****
preparedStatements=true

indexer.properties:

TimeAttribute=ingestion
Schema=*the_geom:Polygon,location:String,ingestion:java.util.Date
PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](ingestion)

timeregex.properties:

regex=[0-9]{8}

geoserver log:

2015-11-23 15:43:40,266 WARN [gce.imagemosaic] - Unable to close indexing(none): (none): Name or service not known
java.lang.RuntimeException: (none): (none): Name or service not known
        at javax.media.jai.remote.SerializableRenderedImage.<init>(SerializableRenderedImage.java:567)
        at javax.media.jai.remote.SerializableRenderedImage.<init>(SerializableRenderedImage.java:454)
        at org.geotools.gce.imagemosaic.Utils.storeSampleImage(Utils.java:953)
        at org.geotools.gce.imagemosaic.ImageMosaicConfigHandler.createSampleImage(ImageMosaicConfigHandler.java:469)
        at org.geotools.gce.imagemosaic.ImageMosaicConfigHandler.indexingPostamble(ImageMosaicConfigHandler.java:412)
        at org.geotools.gce.imagemosaic.ImageMosaicDirectoryWalker$MosaicDirectoryWalker.<init>(ImageMosaicDirectoryWalker.java:132)
        at org.geotools.gce.imagemosaic.ImageMosaicDirectoryWalker.run(ImageMosaicDirectoryWalker.java:196)
        at org.geotools.gce.imagemosaic.Utils.createMosaic(Utils.java:359)
        at org.geotools.gce.imagemosaic.Utils.checkSource(Utils.java:1237)
        at org.geotools.gce.imagemosaic.ImageMosaicReader.initReaderFromURL(ImageMosaicReader.java:516)
        at org.geotools.gce.imagemosaic.ImageMosaicReader.<init>(ImageMosaicReader.java:468)
        at org.geotools.gce.imagemosaic.ImageMosaicFormat.getReader(ImageMosaicFormat.java:483)
        at org.geotools.gce.imagemosaic.ImageMosaicFormat.getReader(ImageMosaicFormat.java:103)
        at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1441)
        at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1369)
        at org.geoserver.catalog.impl.CoverageStoreInfoImpl.getGridCoverageReader(CoverageStoreInfoImpl.java:59)
...
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
2015-11-23 15:43:40,271 ERROR [imagemosaic.Utils] - (none): (none): Name or service not known
java.lang.RuntimeException: (none): (none): Name or service not known
        at javax.media.jai.remote.SerializableRenderedImage.<init>(SerializableRenderedImage.java:567)
        at javax.media.jai.remote.SerializableRenderedImage.<init>(SerializableRenderedImage.java:454)
        at org.geotools.gce.imagemosaic.Utils.storeSampleImage(Utils.java:953)
        at org.geotools.gce.imagemosaic.ImageMosaicConfigHandler.createSampleImage(ImageMosaicConfigHandler.java:469)
        at org.geotools.gce.imagemosaic.ImageMosaicConfigHandler.indexingPostamble(ImageMosaicConfigHandler.java:412)
        at org.geotools.gce.imagemosaic.ImageMosaicDirectoryWalker$MosaicDirectoryWalker.<init>(ImageMosaicDirectoryWalker.java:132)
        at org.geotools.gce.imagemosaic.ImageMosaicDirectoryWalker.run(ImageMosaicDirectoryWalker.java:196)
        at org.geotools.gce.imagemosaic.Utils.createMosaic(Utils.java:359)
        at org.geotools.gce.imagemosaic.Utils.checkSource(Utils.java:1237)
        at org.geotools.gce.imagemosaic.ImageMosaicReader.initReaderFromURL(ImageMosaicReader.java:516)
        at org.geotools.gce.imagemosaic.ImageMosaicReader.<init>(ImageMosaicReader.java:468)
        at org.geotools.gce.imagemosaic.ImageMosaicFormat.getReader(ImageMosaicFormat.java:483)
        at org.geotools.gce.imagemosaic.ImageMosaicFormat.getReader(ImageMosaicFormat.java:103)
        at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1441)
        at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1369)
        at org.geoserver.catalog.impl.CoverageStoreInfoImpl.getGridCoverageReader(CoverageStoreInfoImpl.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
2015-11-23 15:43:40,276 INFO [geoserver.web] - Getting list of coverages for saved store file:///home/jswitzer/postgis_rasters
java.lang.RuntimeException: Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:///home/jswitzer/postgis_rasters and hints null
        at org.geoserver.web.data.layer.NewLayerPageProvider.getItemsInternal(NewLayerPageProvider.java:151)
        at org.geoserver.web.data.layer.NewLayerPageProvider.getItems(NewLayerPageProvider.java:59)
        at org.geoserver.web.wicket.GeoServerDataProvider.fullSize(GeoServerDataProvider.java:242)
        at org.geoserver.web.wicket.GeoServerTablePanel$PagerDelegate.updateMatched(GeoServerTablePanel.java:566)
        at org.geoserver.web.wicket.GeoServerTablePanel$PagerDelegate.<init>(GeoServerTablePanel.java:559)
        at org.geoserver.web.wicket.GeoServerTablePanel.<init>(GeoServerTablePanel.java:171)
        at org.geoserver.web.wicket.GeoServerTablePanel.<init>(GeoServerTablePanel.java:96)
        at org.geoserver.web.data.layer.NewLayerPage$1.<init>(NewLayerPage.java:106)
        at org.geoserver.web.data.layer.NewLayerPage.<init>(NewLayerPage.java:106)
        at org.geoserver.web.data.store.CoverageStoreNewPage.onSuccessfulSave(CoverageStoreNewPage.java:79)
        at org.geoserver.web.data.store.CoverageStoreNewPage.onSave(CoverageStoreNewPage.java:70)
        at org.geoserver.web.data.store.AbstractCoverageStorePage$1.onSubmit(AbstractCoverageStorePage.java:116)
...
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Failed to create reader from file:///home/jswitzer/postgis_rasters and hints null
        at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1443)
        at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1369)
        at org.geoserver.catalog.impl.CoverageStoreInfoImpl.getGridCoverageReader(CoverageStoreInfoImpl.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.geoserver.catalog.impl.ModificationProxy.invoke(ModificationProxy.java:146)
        at com.sun.proxy.$Proxy9.getGridCoverageReader(Unknown Source)
        at org.geoserver.web.data.layer.NewLayerPageProvider.getItemsInternal(NewLayerPageProvider.java:90)
        ... 119 more

Any ideas?

1

I figured it out. In the following line of geoserver.log's stacktrace, (none) is referring to the hostname which wasn't set

java.lang.RuntimeException: (none): (none): Name or service not known

To resolve the issue I edited /etc/hostname to have a hostname and /etc/hosts to resolve the hostname to an IP. Then I rebooted the box and adding the image mosaic store worked correctly.

0

The solution when I encountered the issue was the declared projection within the raster was not defined in Geoserver. Once the projection parameters are available in the standard Geoserver format (http://docs.geoserver.org/latest/en/user/configuration/crshandling/customcrs.html) ,

  1. In your Geoserver directory and go to data_dir/user_projections
  2. In a text editor, open up the epsg.properties file
  3. Add a line at the end of the file with the projection parameters

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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