tomasanda / docker-noisemodelling

Docker repository for the NoiseModelling library
MIT License
1 stars 0 forks source link

Importing of OSM data into NoiseModelling running from Docker container fails #1

Closed olessko closed 3 years ago

olessko commented 3 years ago

NoiseModelling version 3.3.1

Describe the bug I am trying to run NoiseModelling from Docker container which I initialise as docker run -dt --name noisemodelling -p 9580:9580 --mount type=bind,source="$(pwd)"/data,target=/data tomasanda/noisemodelling:latest

The WPS Builder and GeoServer seem to run OK,  but when I try importing OSM data the container crashes with the error below. I am not proficient with debugging in Java environment, and would highly appreciate any advice on how to overcome this issue. From what I see GDAL is not available in the container.

To Reproduce Steps to reproduce the behavior:

  1. Download an region from OSM
  2. Import it using WPS
  3. WPS displays "Network error on WPS:Execute request", docker container crashes

Geoserver log

Container error log:


java.lang.UnsatisfiedLinkError: /tmp/spatialite-3.7.22.4-libspatialitejdbc.so: Error loading shared library libgeos_c.so.1: No such file or directory (needed by /tmp/spatialite-3.7.22.4-libspatialitejdbc.so)
20 Feb 11:20:41 DEBUG [data.ogr] - Error initializing GDAL/OGR library
java.lang.UnsatisfiedLinkError: no gdaljni in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1871)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1124)
        at org.geotools.data.ogr.jni.JniOGRDataStoreFactory.doIsAvailable(JniOGRDataStoreFactory.java:15)
        at org.geotools.data.ogr.OGRDataStoreFactory.isAvailable(OGRDataStoreFactory.java:161)
        at org.geotools.data.ogr.OGRDataStoreFactory.isAvailable(OGRDataStoreFactory.java:150)
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
        at java.util.Iterator.forEachRemaining(Iterator.java:116)
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
        at org.geotools.data.DataAccessFinder.getAvailableDataStores(DataAccessFinder.java:199)
        at org.geotools.data.DataStoreFinder.getAvailableDataStores(DataStoreFinder.java:94)
        at org.geotools.data.DataAccessFinder.getAvailableDataStores(DataAccessFinder.java:187)
        at org.vfny.geoserver.util.DataStoreUtils.getAvailableDataStoreFactories(DataStoreUtils.java:320)
        at org.vfny.geoserver.util.DataStoreUtils.aquireFactory(DataStoreUtils.java:142)
        at org.vfny.geoserver.util.DataStoreUtils.getDataAccess(DataStoreUtils.java:75)
        at org.geoserver.catalog.ResourcePool.getDataStore(ResourcePool.java:591)
        at org.geoserver.catalog.impl.DataStoreInfoImpl.getDataStore(DataStoreInfoImpl.java:33)
        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.getDataStore(Unknown Source)
        at org.geoserver.catalog.DataStoreInfo$getDataStore.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
        at org.noise_planet.noisemodelling.wps.Import_and_Export.Script36.openGeoserverDataStoreConnection(Script36.groovy:128)
        at org.noise_planet.noisemodelling.wps.Import_and_Export.Script36.run(Script36.groovy:141)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
        at groovy.lang.MetaClassImpl.invokeMethodClosure(MetaClassImpl.java:1050)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1092)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
        at groovy.lang.Closure.call(Closure.java:405)
        at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.callGlobal(GroovyScriptEngineImpl.java:394)
        at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.callGlobal(GroovyScriptEngineImpl.java:388)
        at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.invokeImpl(GroovyScriptEngineImpl.java:361)
        at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.invokeFunction(GroovyScriptEngineImpl.java:198)
        at org.geoserver.script.ScriptHook.doInvoke(ScriptHook.java:73)
        at org.geoserver.script.ScriptHook.invoke(ScriptHook.java:56)
        at org.geoserver.script.wps.WpsHook.run(WpsHook.java:173)
        at org.geoserver.script.groovy.GroovyWpsHook.run(GroovyWpsHook.java:39)
        at org.geoserver.script.wps.ScriptProcess.execute(ScriptProcess.java:114)
        at org.geoserver.wps.executor.ProcessStartupFilter$ProcessStartupWrapper.execute(ProcessStartupFilter.java:50)
        at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:227)
        at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:195)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Expected behavior I expect successful import of OSM data

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

tomasanda commented 3 years ago

Hi, I think you set the wrong path in the WPS Builder to your OSM file. Please try to modify the path to your OSM file using the /data folder in this way: _/data/myregion.osm. Let me know if it works.

osm_path
olessko commented 3 years ago

Thanks Tomáš, this is exactly how I set the path to the OSM file in the WPS Builder: /data/Pankow.osm . The OSM file is 1 km2 urban area in Berlin.

tomasanda commented 3 years ago

How big is that osm file? If you send me that file, I will try import it with WPS locally.

olessko commented 3 years ago

The OSM file is 7.3 MB, please find it attached (as ZIP) Pankow.osm.zip . I am mapping it to SRID 95833.

The last log message from the container is below, and then the container crashes:

20 Feb 20:14:11 DEBUG [geoserver.wps] - Saving status ExecutionStatus [processName=Import_and_Export:Import_OSM, executionId=363dfd6d-c531-48b3-8dfa-ad1ba285ef74, asynchronous=false, phase=RUNNING, progress=0.0, userName=admin, creationTime=Sat Feb 20 20:14:11 GMT 2021, completionTime=null, lastUpdated=Sat Feb 20 20:14:11 GMT 2021, expirationDate=Sat Feb 20 20:14:11 GMT 2021, estimatedCompletion=null, nextPoll=Sat Feb 20 20:14:11 GMT 2021, task=null, exception=null, nodeId=29f33652a8c5]

20 Feb 20:14:11 INFO [noise_planet.noisemodelling] - Start : Get Input Data from OSM

20 Feb 20:14:11 INFO [noise_planet.noisemodelling] - inputs {targetSRID=95833, pathFile=/data/Pankow.osm}

tomasanda commented 3 years ago

Try it with another SRID please, 4326 or 3857 and let me know if it works. See the results below for the included osm file.

Screenshot 2021-02-20 at 22 30 04
olessko commented 3 years ago

Thanks for looking into this! Unfortunately the same GEOS / GDAL error persists with other SRIDs:

java.lang.UnsatisfiedLinkError: /tmp/spatialite-3.7.22.4-libspatialitejdbc.so: Error loading shared library libgeos_c.so.1: No such file or directory (needed by /tmp/spatialite-3.7.22.4-libspatialitejdbc.so) 20 Feb 21:37:36 DEBUG [data.ogr] - Error initializing GDAL/OGR library java.lang.UnsatisfiedLinkError: no gdaljni in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1871) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1124) at org.geotools.data.ogr.jni.JniOGRDataStoreFactory.doIsAvailable(JniOGRDataStoreFactory.java:15) at org.geotools.data.ogr.OGRDataStoreFactory.isAvailable(OGRDataStoreFactory.java:161) at org.geotools.data.ogr.OGRDataStoreFactory.isAvailable(OGRDataStoreFactory.java:150) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at java.util.Iterator.forEachRemaining(Iterator.java:116) at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) at org.geotools.data.DataAccessFinder.getAvailableDataStores(DataAccessFinder.java:199) at org.geotools.data.DataStoreFinder.getAvailableDataStores(DataStoreFinder.java:94) at org.geotools.data.DataAccessFinder.getAvailableDataStores(DataAccessFinder.java:187) at org.vfny.geoserver.util.DataStoreUtils.getAvailableDataStoreFactories(DataStoreUtils.java:320) at org.vfny.geoserver.util.DataStoreUtils.aquireFactory(DataStoreUtils.java:142) at org.vfny.geoserver.util.DataStoreUtils.getDataAccess(DataStoreUtils.java:75) at org.geoserver.catalog.ResourcePool.getDataStore(ResourcePool.java:591) at org.geoserver.catalog.impl.DataStoreInfoImpl.getDataStore(DataStoreInfoImpl.java:33) 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.getDataStore(Unknown Source) at org.geoserver.catalog.DataStoreInfo$getDataStore.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127) at org.noise_planet.noisemodelling.wps.Import_and_Export.Script36.openGeoserverDataStoreConnection(Script36.groovy:128) at org.noise_planet.noisemodelling.wps.Import_and_Export.Script36.run(Script36.groovy:141) 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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217) at groovy.lang.MetaClassImpl.invokeMethodClosure(MetaClassImpl.java:1050) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1092) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041) at groovy.lang.Closure.call(Closure.java:405) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.callGlobal(GroovyScriptEngineImpl.java:394) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.callGlobal(GroovyScriptEngineImpl.java:388) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.invokeImpl(GroovyScriptEngineImpl.java:361) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.invokeFunction(GroovyScriptEngineImpl.java:198) at org.geoserver.script.ScriptHook.doInvoke(ScriptHook.java:73) at org.geoserver.script.ScriptHook.invoke(ScriptHook.java:56) at org.geoserver.script.wps.WpsHook.run(WpsHook.java:173) at org.geoserver.script.groovy.GroovyWpsHook.run(GroovyWpsHook.java:39) at org.geoserver.script.wps.ScriptProcess.execute(ScriptProcess.java:114) at org.geoserver.wps.executor.ProcessStartupFilter$ProcessStartupWrapper.execute(ProcessStartupFilter.java:50) at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:227) at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:195) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 20 Feb 21:37:42 DEBUG [geotools.jdbc] - CLOSE CONNECTION 20 Feb 21:37:42 DEBUG [geotools.jdbc] - CREATE CONNECTION 20 Feb 21:37:42 DEBUG [geotools.jdbc] - CLOSE CONNECTION 20 Feb 21:37:42 INFO [noise_planet.noisemodelling] - Start : Get Input Data from OSM 20 Feb 21:37:42 INFO [noise_planet.noisemodelling] - inputs {targetSRID=3857, pathFile=/data/Pankow.osm}

tomasanda commented 3 years ago

Here are my logs. Try to wait maybe a few minutes, because the time of processing the OSM file also depends on your computer specs.

20 Feb 21:22:36 DEBUG [geotools.jdbc] - CLOSE CONNECTION
20 Feb 21:22:36 DEBUG [geotools.jdbc] - CREATE CONNECTION
20 Feb 21:22:36 DEBUG [geotools.jdbc] - CLOSE CONNECTION
20 Feb 21:22:36 INFO [noise_planet.noisemodelling] - Start : Get Input Data from OSM
20 Feb 21:22:36 INFO [noise_planet.noisemodelling] - inputs {targetSRID=3857, pathFile=/data/Pankow.osm}
20 Feb 21:22:52 WARN [cts.CRSHelper] - A grid has been found.
20 Feb 21:23:07 INFO [noise_planet.noisemodelling] - The table BUILDINGS has been created.
20 Feb 21:23:11 INFO [noise_planet.noisemodelling] - The table GROUND has been created.
20 Feb 21:23:17 INFO [noise_planet.noisemodelling] - The table ROADS has been created.
20 Feb 21:23:17 INFO [noise_planet.noisemodelling] -  <br> The table BUILDINGS has been created. <br> The table GROUND has been created. <br> The table ROADS has been created.<br> Calculation Done !
20 Feb 21:23:17 INFO [noise_planet.noisemodelling] - End : Osm To Input Data
tomasanda commented 3 years ago

If you send me here your mail, we can arrange a short zoom call and debug this issue. I will then delete the comment with your email.

olessko commented 3 years ago

The same container works OK when run by Docker unter Debian host system. It only crashes when run from MacOS Big Sur host. Hence the workaround is to use it under Debian host.