Unidata / tds

THREDDS Data Server
https://docs.unidata.ucar.edu/tds/5.0/userguide/index.html
BSD 3-Clause "New" or "Revised" License
65 stars 27 forks source link

thredds setup #412

Closed lucapaganotti closed 1 year ago

lucapaganotti commented 1 year ago

Providing:

I'm getting these kind of exceptions everytime I try to use the preview tab and go to the Godiva3 viewer.

2023-08-17T08:11:53.488 +0000 [ 578960238][   57307] INFO  - threddsServlet - Remote host: 10.10.116.93 - Request: "GET /thredds/wms/radar/FLERO_interp_CAPPI.nc?request=GetMetadata&item=menu HTTP/1.1"
2023-08-17T08:11:53.489 +0000 [ 578960239][   57307] ERROR - uk.ac.rdg.resc.edal.wms.WmsServlet - Problem with GET request
java.lang.NullPointerException: null
        at thredds.server.wms.config.LayerSettings.replaceNullValues(LayerSettings.java:156) ~[classes/:5.4]
        at thredds.server.wms.config.WmsDetailedConfig.getSettings(WmsDetailedConfig.java:196) ~[classes/:5.4]
        at thredds.server.wms.TdsEnhancedVariableMetadata.<init>(TdsEnhancedVariableMetadata.java:45) ~[classes/:5.4]
        at thredds.server.wms.ThreddsWmsCatalogue.getLayerMetadata(ThreddsWmsCatalogue.java:423) ~[classes/:5.4]
        at uk.ac.rdg.resc.edal.wms.util.WmsUtils.getLayerMetadata(WmsUtils.java:285) ~[edal-wms-1.5.0.5-SNAPSHOT.jar:?]
        at uk.ac.rdg.resc.edal.wms.WmsServlet.addVariablesToArray(WmsServlet.java:1111) ~[edal-wms-1.5.0.5-SNAPSHOT.jar:?]
        at uk.ac.rdg.resc.edal.wms.WmsServlet.showMenu(WmsServlet.java:1082) ~[edal-wms-1.5.0.5-SNAPSHOT.jar:?]
        at uk.ac.rdg.resc.edal.wms.WmsServlet.getMetadata(WmsServlet.java:1034) ~[edal-wms-1.5.0.5-SNAPSHOT.jar:?]
        at uk.ac.rdg.resc.edal.wms.WmsServlet.dispatchWmsRequest(WmsServlet.java:391) ~[edal-wms-1.5.0.5-SNAPSHOT.jar:?]
        at thredds.server.wms.ThreddsWmsServlet.dispatchWmsRequest(ThreddsWmsServlet.java:120) ~[classes/:5.4]
        at uk.ac.rdg.resc.edal.wms.WmsServlet.doGet(WmsServlet.java:303) [edal-wms-1.5.0.5-SNAPSHOT.jar:?]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:489) [servlet-api.jar:?]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:583) [servlet-api.jar:?]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:212) [catalina.jar:8.5.91]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:156) [catalina.jar:8.5.91]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) [tomcat-websocket.jar:8.5.91]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:181) [catalina.jar:8.5.91]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:156) [catalina.jar:8.5.91]
        at org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:330) [catalina.jar:8.5.91]
        at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:155) [catalina.jar:8.5.91]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:181) [catalina.jar:8.5.91]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:156) [catalina.jar:8.5.91]
        at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:129) [catalina.jar:8.5.91]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:181) [catalina.jar:8.5.91]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:156) [catalina.jar:8.5.91]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327) [spring-security-web-5.6.5.jar:5.6.5]
        at thredds.servlet.filter.RequestBracketingLogMessageFilter.doFilter(RequestBracketingLogMessageFilter.java:50) [classes/:5.4]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) [spring-security-web-5.6.5.jar:5.6.5]
        at thredds.servlet.filter.RequestQueryFilter.doFilter(RequestQueryFilter.java:90) [classes/:5.4]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) [spring-security-web-5.6.5.jar:5.6.5]
        at thredds.servlet.filter.HttpHeadFilter.doFilter(HttpHeadFilter.java:47) [classes/:5.4]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) [spring-security-web-5.6.5.jar:5.6.5]
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211) [spring-security-web-5.6.5.jar:5.6.5]
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183) [spring-security-web-5.6.5.jar:5.6.5]
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) [spring-web-5.3.20.jar:5.3.20]
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) [spring-web-5.3.20.jar:5.3.20]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:181) [catalina.jar:8.5.91]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:156) [catalina.jar:8.5.91]
        at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71) [log4j-web-2.17.1.jar:2.17.1]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:181) [catalina.jar:8.5.91]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:156) [catalina.jar:8.5.91]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) [catalina.jar:8.5.91]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) [catalina.jar:8.5.91]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483) [catalina.jar:8.5.91]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) [catalina.jar:8.5.91]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) [catalina.jar:8.5.91]
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:682) [catalina.jar:8.5.91]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:8.5.91]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:8.5.91]
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:617) [tomcat-coyote.jar:8.5.91]
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) [tomcat-coyote.jar:8.5.91]
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:932) [tomcat-coyote.jar:8.5.91]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1694) [tomcat-coyote.jar:8.5.91]
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) [tomcat-coyote.jar:8.5.91]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-util.jar:8.5.91]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-util.jar:8.5.91]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.5.91]
        at java.lang.Thread.run(Thread.java:829) [?:?]

I was also asked to provide my wmsConfig.xml file, my catalog.xml file and the .nc files I'm using. Find the two plain files below and attached the .nc files I'm using compressed in a .tar.gz.

wmsConfig.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wmsConfig SYSTEM "https://www.unidata.ucar.edu/schemas/thredds/dtd/ncwms/wmsConfig.dtd">
<!--
Detailed configuration of the WMS service.  This config file can be used to
set default styling parameters for each dataset/variable, and to enable or disable
the GetFeatureInfo operation.
-->
<wmsConfig>
    <global>
        <!-- These settings apply to all datasets unless overridden below -->
        <defaults>
            <!-- The global defaults. All elements are mandatory -->
            <allowFeatureInfo>true</allowFeatureInfo>
            <defaultColorScaleRange>-50 50</defaultColorScaleRange>
            <defaultPaletteName>psu-viridis</defaultPaletteName>
            <defaultNumColorBands>20</defaultNumColorBands>
            <logScaling>false</logScaling>
            <intervalTime>false</intervalTime>
        </defaults>
        <standardNames>
            <!-- Use this section to set defaults per standard name -->
            <!-- Units must come from the UDUNITS vocabulary -->
            <standardName name="sea_water_potential_temperature" units="K">
                <defaultColorScaleRange>268 308</defaultColorScaleRange>
            </standardName>
            <standardName name="sea_water_temperature" units="K">
                <defaultColorScaleRange>268 308</defaultColorScaleRange>
            </standardName>
            <standardName name="mass_concentration_of_chlorophyll_in_sea_water" units="kg m-3">
                <logScaling>true</logScaling>
            </standardName>
        </standardNames>
    </global>
    <overrides>
        <datasetPath pathSpec="testAll/20040503*_eta_211.nc">
            <!-- Will apply to all paths that match the path spec above -->
            <pathDefaults>
                <!-- These will apply to all variables in this path unless overridden below -->
                <allowFeatureInfo>false</allowFeatureInfo>
                <defaultPaletteName>x-Occam</defaultPaletteName>
            </pathDefaults>

            <variables>
                <!-- Configure variables individually according to their internal ID.
                     This is the most specific setting and will override any others -->
                <variable id="Z_sfc">
                    <defaultColorScaleRange>0 2920</defaultColorScaleRange>
                </variable>
            </variables>
        </datasetPath>
        <datasetPath pathSpec="testAll/20040504*_eta_211.nc">
            <!-- Will apply to all paths that match the path spec above -->
            <pathDefaults>
                <!-- These will apply to all variables in this path unless overridden below -->
                <allowFeatureInfo>true</allowFeatureInfo>
                <defaultPaletteName>seq-Reds</defaultPaletteName>
            </pathDefaults>
            <variables>
                <!-- Configure variables individually according to their internal ID.
                     This is the most specific setting and will override any others -->
                <variable id="Z_sfc">
                    <defaultColorScaleRange>0 3170</defaultColorScaleRange>
                </variable>
            </variables>
        </datasetPath>
    </overrides>
</wmsConfig>

catalog.xml

<?xml version="1.0" encoding="UTF-8"?>
<catalog name="THREDDS Server Default Catalog : You must change this to fit your server!"
         xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0
           https://schemas.unidata.ucar.edu/thredds/InvCatalog.1.0.6.xsd">

  <service name="all" base="" serviceType="compound">
    <service name="odap" serviceType="OpenDAP" base="/thredds/dodsC/"/>
    <service name="dap4" serviceType="DAP4" base="/thredds/dap4/"/>
    <service name="http" serviceType="HTTPServer" base="/thredds/fileServer/"/>
    <service name="wcs" serviceType="WCS" base="/thredds/wcs/"/>
    <service name="wms" serviceType="WMS" base="/thredds/wms/"/>
    <service name="ncssGrid" serviceType="NetcdfSubset" base="/thredds/ncss/grid/"/>
    <service name="ncssPoint" serviceType="NetcdfSubset" base="/thredds/ncss/point/"/>
    <service name="cdmremote" serviceType="CdmRemote" base="/thredds/cdmremote/"/>
    <service name="iso" serviceType="ISO" base="/thredds/iso/"/>
    <service name="ncml" serviceType="NCML" base="/thredds/ncml/"/>
    <service name="uddc" serviceType="UDDC" base="/thredds/uddc/"/>
  </service>

  <!--<datasetRoot path="test" location="content/testdata/" />

  <dataset name="Test Grid Dataset" ID="testGrid"
           serviceName="all"  urlPath="test/crossSeamProjection.nc" dataType="Grid"/>

  <dataset name="Test Point Dataset" ID="testPoint"
           serviceName="all" urlPath="test/H.1.1.nc" dataType="Point"/>

  <dataset name="Test Station Dataset" ID="testStation"
  serviceName="all" urlPath="test/H.2.1.1.nc" dataType="Point"/>

  <datasetScan name="Test all files in a directory" ID="testDatasetScan"
               path="testAll" location="content/testdata">
    <metadata inherited="true">
      <serviceName>all</serviceName>
    </metadata>
  </datasetScan>-->

  <datasetRoot path="radar" location="content/data/arpa/" />

  <dataset name="Test PPI Dataset" ID="PPIGrid"
          serviceName="all"  urlPath="radar/FLERO_interp_PPI.nc" dataType="Grid"/>

  <dataset name="Test CAPPI Dataset" ID="CAPPIGrid"
          serviceName="all"  urlPath="radar/FLERO_interp_CAPPI.nc" dataType="Grid"/>

  <datasetScan name="All radar files" ID="radarDatasetScan"
          path="allradar" location="content/data/arpa">
    <metadata inherited="true">
      <serviceName>all</serviceName>
    </metadata>
  </datasetScan>

  <!--<catalogRef xlink:title="Test Enhanced Catalog" xlink:href="enhancedCatalog.xml" name=""/>-->
</catalog>

I've also checked the tomcat serverStartup.log file and found this warnings (I've added *** wrapping them):

2023-08-31T09:10:56.562+0000 [     23564][        ] INFO  serverStartup: TdsInit: getContentRootPathAbsolute= /usr/local/tomcat/content/
2023-08-31T09:10:56.676+0000 [     23678][        ] INFO  serverStartup: ThreddsConfigReader reading xml file = /usr/local/tomcat/content/thredds/threddsConfig.xml
2023-08-31T09:13:08.642+0000 [    155644][        ] ***WARN***  serverStartup: Cannot read wmsConfig.xml:
2023-08-31T09:13:08.643+0000 [    155645][        ] ***WARN***  serverStartup: Connection timed out (Connection timed out)
2023-08-31T09:13:08.694+0000 [    155696][        ] INFO  serverStartup: TdsInit: catalogWriting.useBytesForDataSize= false
2023-08-31T09:13:08.960+0000 [    155962][        ] INFO  serverStartup: Nc4Iosp: NetCDF-4 C library loaded (jna_path='null', libname='netcdf' version='4.9.2 of Jul 18 2023 03:25:46 $').
2023-08-31T09:13:08.961+0000 [    155963][        ] INFO  serverStartup: NetcdfLoader: set log level: old=0 new=0
2023-08-31T09:13:08.961+0000 [    155963][        ] INFO  serverStartup: Nc4Iosp: set log level: old=0 new=0
2023-08-31T09:13:08.965+0000 [    155967][        ] INFO  serverStartup: TdsInit: Aggregation.setTypicalDatasetMode= penultimate
2023-08-31T09:13:09.039+0000 [    156041][        ] INFO  serverStartup: TdsInit: CdmCache= /usr/local/tomcat/content/thredds/cache/cdm scour = 3600 maxSize = 1000000000
2023-08-31T09:13:09.050+0000 [    156052][        ] INFO  serverStartup: TdsInit: AggregationCache= /usr/local/tomcat/content/thredds/cache/agg scour = 86400 maxAgeSecs = 7776000
2023-08-31T09:13:09.051+0000 [    156053][        ] INFO  serverStartup: TdsInit: GribIndex=DiskCache2{cachePathPolicy=NestedDirectory, alwaysUseCache=false, cachePathPolicyParam='null', root='/usr/local/tomcat/content/thredds/cache/grib/', scourEveryMinutes=0, persistMinutes=129600, fail=false}
2023-08-31T09:13:09.242+0000 [    156244][        ] INFO  serverStartup: thredds.server.ncss.controller.NcssDiskCacheNcss.Cache= /usr/local/tomcat/content/thredds/cache/ncss scour = 900 maxAgeSecs = 1800
2023-08-31T09:13:10.044+0000 [    157046][        ] INFO  serverStartup: TdsInit: GridDatasetInv cache= /usr/local/tomcat/content/thredds/cache/collection/
2023-08-31T09:13:10.053+0000 [    157055][        ] INFO  serverStartup: TdsInit: RandomAccessFile.initPartitionCache= [400,500] scour = 660
2023-08-31T09:13:10.055+0000 [    157057][        ] INFO  serverStartup: TdsInit: NetcdfDatasets.initNetcdfFileCache= [100,150] scour = 720
2023-08-31T09:13:10.060+0000 [    157062][        ] INFO  serverStartup: TdsInit: NetcdfDataset.initNetcdfFileCache= [100,150] scour = 720
2023-08-31T09:13:10.070+0000 [    157072][        ] INFO  serverStartup: TdsInit: GribCdmIndex.initDefaultCollectionCache= [100,150] scour = 780
2023-08-31T09:13:13.566+0000 [    160568][        ] ***WARN***  serverStartup: TdsContext - Could not get latest version information from Unidata.
2023-08-31T09:13:13.566+0000 [    160568][        ] ***WARN***  serverStartup: Web Start has been deprecated for >Java 9 and is slated for removal - see http://www.oracle.com/technetwork/java/eol-135779.html)
2023-08-31T09:13:14.056+0000 [    161058][        ] INFO  serverStartup: TdsInit complete
2023-08-31T09:13:14.056+0000 [    161058][        ] INFO  serverStartup: thredds.server.opendap.OpendapServlet initialization start
2023-08-31T09:13:14.057+0000 [    161059][        ] INFO  serverStartup: thredds.server.opendap.OpendapServlet version= opendap/3.7 ascLimit = 50 binLimit = 500
2023-08-31T09:13:14.057+0000 [    161059][        ] INFO  serverStartup: thredds.server.opendap.OpendapServlet initialization done
2023-08-31T09:13:14.057+0000 [    161059][        ] INFO  serverStartup: WCS:allow= true
2023-08-31T09:13:14.060+0000 [    161062][        ] INFO  serverStartup: WCS service - init done - 
2023-08-31T09:13:14.061+0000 [    161063][        ] INFO  serverStartup: Metadata ISO - initialization start
2023-08-31T09:13:14.061+0000 [    161063][        ] INFO  serverStartup: NCISO.isoAllow = true
2023-08-31T09:13:14.061+0000 [    161063][        ] INFO  serverStartup: Metadata UDDC - initialization start
2023-08-31T09:13:14.062+0000 [    161064][        ] INFO  serverStartup: NCISO.uddcAllow = true

saying basicly that wmsConfig.xml is not found, so maybe I'm making mistakes in my docker volume binding paths, but the wmsConfig.xml file is in the same directory as the threddsConfig.xml one, the latter being correctly read. Am I missing something?

I change wmsConfig.xml permissions to 777 getting the same error, I then run my wmsConfig.xml through a XML validator (https://www.w3schools.com/xml/xml_validator.asp) that says me I've no syntax errors.

nc.tar.gz

Then later I checked also the catalina log file getting these warnings:

31-Aug-2023 14:49:32.499 INFO [Thread-5] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
31-Aug-2023 14:49:32.502 INFO [Thread-5] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
31-Aug-2023 14:49:34.970 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [thredds] appears to have started a thread named [background~resource~releaser] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.base@11.0.19/jdk.internal.misc.Unsafe.park(Native Method)
 java.base@11.0.19/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
 java.base@11.0.19/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
 java.base@11.0.19/java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:417)
 net.openhft.chronicle.core.io.BackgroundResourceReleaser.runReleaseResources(BackgroundResourceReleaser.java:27)
 net.openhft.chronicle.core.io.BackgroundResourceReleaser$$Lambda$357/0x00000008405cdc40.run(Unknown Source)
 java.base@11.0.19/java.lang.Thread.run(Thread.java:829)
31-Aug-2023 14:49:34.989 INFO [Thread-5] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
31-Aug-2023 14:49:34.999 INFO [Thread-5] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
31-Aug-2023 14:49:53.656 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat
31-Aug-2023 14:49:53.659 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jul 6 2023 14:43:48 UTC
31-Aug-2023 14:49:53.660 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.91.0
31-Aug-2023 14:49:53.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
31-Aug-2023 14:49:53.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            5.4.0-153-generic
31-Aug-2023 14:49:53.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
31-Aug-2023 14:49:53.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /opt/java/openjdk
31-Aug-2023 14:49:53.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           11.0.19+7
31-Aug-2023 14:49:53.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Eclipse Adoptium
31-Aug-2023 14:49:53.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
31-Aug-2023 14:49:53.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
31-Aug-2023 14:49:53.663 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
31-Aug-2023 14:49:53.663 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
31-Aug-2023 14:49:53.663 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
31-Aug-2023 14:49:53.663 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dtds.content.root.path=/usr/local/tomcat/content/
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.prefs.systemRoot=/usr/local/tomcat/javaUtilPrefs
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.prefs.userRoot=/usr/local/tomcat/javaUtilPrefs
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms4G
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx4G
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+HeapDumpOnOutOfMemoryError
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djna.tmpdir=/tmp/
31-Aug-2023 14:49:53.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
31-Aug-2023 14:49:53.665 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
31-Aug-2023 14:49:53.665 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
31-Aug-2023 14:49:53.665 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
31-Aug-2023 14:49:53.665 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
31-Aug-2023 14:49:53.665 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
31-Aug-2023 14:49:53.665 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
31-Aug-2023 14:49:53.665 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.37] using APR version [1.7.0].
31-Aug-2023 14:49:53.665 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [{4}].
31-Aug-2023 14:49:53.666 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
31-Aug-2023 14:49:53.674 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.2 15 Mar 2022]
31-Aug-2023 14:49:53.840 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
31-Aug-2023 14:49:53.866 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1710 ms
31-Aug-2023 14:49:54.061 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
31-Aug-2023 14:49:54.061 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat]
31-Aug-2023 14:49:54.145 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/thredds]
31-Aug-2023 14:50:06.739 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
31-Aug-2023 14:52:29.066 WARNING [localhost-startStop-1] net.openhft.chronicle.core.cleaner.impl.reflect.ReflectionBasedByteBufferCleanerService.<clinit> Make sure you have set the command line option "--illegal-access=permit --add-exports java.base/jdk.internal.ref=ALL-UNNAMED" to enable ReflectionBasedByteBufferCleanerService
31-Aug-2023 14:52:34.160 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/thredds] has finished in [160,015] ms
31-Aug-2023 14:52:34.162 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
31-Aug-2023 14:52:34.239 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 160372 ms

Thank you for any answer, have a nice day.

haileyajohnson commented 1 year ago

Hello! I will take a look at the files you shared. Is your TDS instance publicly available by any chance?

tdrwenski commented 1 year ago

Thank you for sending the extra info! From these log messages:

2023-08-31T09:13:08.642+0000 [ 155644][ ] WARN serverStartup: Cannot read wmsConfig.xml: 2023-08-31T09:13:08.643+0000 [ 155645][ ] WARN serverStartup: Connection timed out (Connection timed out)

it looks like the wmsConfig.xml isn't getting parsed due to a connection timeout. This is later causing null pointer exceptions when you try to use Godiva.

I do recommend that you update your wms schema as explained here, however, I don't think your errors are due to that. Otherwise I don't see anything wrong with the files you sent.

Do you have any proxies or firewalls that might be causing connection issues?

Can you test the docker quickstart just to see if that works for you? That should use the default wmsConfig.xml and a simple test catalog and some test datasets. For instance,

docker run -d -p 80:8080 unidata/thredds-docker:5.4

And then try Godiva on one of the example datasets.

lucapaganotti commented 1 year ago

Hi @tdrwenski,

I issue this command:

$ docker run -d -p 5902:8080 unidata/thredds-docker:5.4

the container goes healthy after more than 2 minutes.

Schermata da 2023-09-08 10-26-55

I have to publish on a specific port 5902 as per specific network rule we have.

Unfortunately I'm getting the same error as with the production setup when I try to use the Godiva3 viewer. In this run I've not yet updated the wms schema as per your instructions.

Schermata da 2023-09-08 10-29-34

So then I changed the DOCTYPE of wmsConfig.xml file I use in the production run so to have this line:

<!DOCTYPE wmsConfig SYSTEM "https://schemas.unidata.ucar.edu/thredds/dtd/ncwms/wmsConfig.dtd">

I run the production environement again but I got the same error in the serverStartup.log file complaining the wmsConfig.xml could not be loaded because of a timeout error.

To answer to your question:

Yes we have firewalls and we are working behind a http/https proxy.

The box where the thredds container is running has these environment variables defined:

declare -x http_proxy="http://usr:pwd@a.b.c.d:pppp"
declare -x https_proxy="http://usr:pwd@a.b.c.d:pppp"

so I tried changing the compose.env file for the thredds container adding these two environment variables:

## proxy vars
http_proxy="http://usr:pwd@a.b.c.d:pppp"
https_proxy="http://usr:pwd@a.b.c.d:pppp"

and then run the container again:

after more than 12 minutes the container is still unhealthy ...

Schermata da 2023-09-08 11-05-39

was this the correct way to pass proxy variables to the docker compose environment?

Thank you for any answer.

Have a nice day.

lucapaganotti commented 1 year ago

Hi Hailey, unfortunately the current server is not publicly available, may be when we will be able to run something significative there will be a public server. For the time being our server is only for internal usage.

Have a nice day.


-- Dott. Ing. Luca Paganotti -- Via Baroffio 4 -- 21040 Vedano Olona (VA) -- 393 1346898

-- softech s.r.l. email: -- @. -- @. -- https://github.com/lucapaganotti -- sourceforge email: -- @.*** -- skype name: luca.paganotti [image: http://it.linkedin.com/in/lucapaganotti] http://it.linkedin.com/in/lucapaganotti


-- Mistakes are portals of discovery - JAAJ


On Thu, Aug 31, 2023 at 8:00 PM haileyajohnson @.***> wrote:

Hello! I will take a look at the files you shared. Is your TDS instance publicly available by any chance?

— Reply to this email directly, view it on GitHub https://github.com/Unidata/tds/issues/412#issuecomment-1701518510, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOYWHOXW5SGHA6VZQO42MLXYDGMNANCNFSM6AAAAAA4FZ3444 . You are receiving this because you authored the thread.Message ID: @.***>

lucapaganotti commented 1 year ago

Hi all,

I think that I may got some the reasons why thredds is behaving this way.

First of all I think that our docker environment has some issues per se. Attaching to the running thredds container I was not able to reach the outside network, a simple curl towards google.com server went in timeout.

So I defined in the docker-compose.yml the two environment variables http_proxy and https_proxy with suitable values and so I got external connectivity. An I also defined suitable dns in docker-compose.yml file.

Then curling towards the unidata servers that expose the wmsConfig.dtd gave me errors about unsecure certificates and I had to run curl with the -k switch in order to download locally the wmsConfig.dtd file.

I then changed my wmsConfig.xml file to point to the local dtd file instead of that on the unidata servers.

I finally mounted the two files (wmsConfig.dtd and wmsConfig.xml) one by one in my docker compose yaml file after understanding that the wmsConfig.xml file has to be seen by the container inside the /usr/local/tomcat folder. My mount points were somewhere else.

I finally got my example map as this:

Schermata da 2023-09-08 15-38-25

Anyway after several minutes I'm still seeing the container as unhealthy after a docker ps -a command.

Schermata da 2023-09-08 15-39-39

Can you please explain why? I'm reaching the server and the file I have in the catalog but the container is anyway not healthy.

I think that the timeout was caused by tds not reaching unidata server to get the .dtd file and then wmsConfig.xml read went in error. A possible further cause of this behaviour could be also SSL related as curl needed to get the .dtd file using the -k switch. I do not know if I can reach the same results with some suitable thredds configuration files setup. For the time being I'm able to continue my tests.

Thank you all, have a nice day.

tdrwenski commented 1 year ago

Hi, thanks for the extra info and all the tests you performed! Glad to hear you have made some progress!

Glad you found a workaround for the schema issue. There was another maybe similar issue a while back that was also resolved using the same method of using a local schema for the wmsConfig.

About the health check, the default health check is in our Dockerfile:

HEALTHCHECK --interval=10s --timeout=3s \
    CMD curl --fail 'http://localhost:8080/thredds/catalog.html' || exit 1

Maybe this could be failing due to your proxy set up. You could try to entering the running container and curling the endpoint above and seeing what error code it returns. If this is indeed the issue, one solution would be to create your own Dockerfile that inherits FROM unidata/thredds-docker:5.4 and overrides the HEALTHCHECK with a health check that has the correct endpoint. We could also consider making the health check in our thredds-docker parameterizable if this would be useful.

Let us know if you have other questions!

lucapaganotti commented 1 year ago

Hi @tdrwenski,

I forgot to define in my docker-compose also the no_proxy environment variable. Letting it to be:

no_proxy=localhost,.my.local.domain,127.0.0.11,127.0.0.1

solved the issue of the container health, no need to change the Dockerfile. Also now the starting of the thredds server is much faster then before.

Schermata da 2023-09-09 08-30-21

As to me this issue can be closed. Thank you all for your help.

I will need, starting from the next week, some hints on how to customize the thredds server web interface, for example on how to have a different map provider and so on. I saw that there are some .css files that I can modify. Are the possible customizations described in thredds documentation?

Thank you again, have a nice day.

tdrwenski commented 1 year ago

Glad to hear that!

We have some info here about customizing the TDS with css. Here is some info about OGC/ISO services and for instance the godiva3 viewer that comes with TDS. If that doesn't answer your questions feel free to contact us again!