GeoNode / geonode-project

A django template project for creating custom GeoNode projects.
http://geonode.org
80 stars 174 forks source link

Issue loading wms Remote Services from local geoserver - geonode-project 3.2.x #171

Closed Darkonyks closed 3 years ago

Darkonyks commented 3 years ago

Hi,

I'm facing with issue loading wms Remote Services from local Geoserver. I have geonode-project 3.2.x docker installation.

image

First I thought that wms service in geoserver is not well set. But when I try to add wms to QGIS it loads it without any problems (except ssl exception)

Also I added with no problems wms from server: https://maps.geo-solutions.it/geoserver/wms

image

local geoserver wms:

image

QGIS:

image

I looked in logs for geoserver, django, nginx and I could not find any message that can lead my to some problem and solution.

Did I had to add/change something in settings or .env ... ? I couldn't find anything in documentation also.

geoserver4geonode | 06-Mar-2021 21:09:50.313 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.20
geoserver4geonode | 06-Mar-2021 21:09:50.318 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          May 3 2019 22:26:00 UTC
geoserver4geonode | 06-Mar-2021 21:09:50.319 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.20.0
geoserver4geonode | 06-Mar-2021 21:09:50.319 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
geoserver4geonode | 06-Mar-2021 21:09:50.319 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            5.8.0-44-generic
geoserver4geonode | 06-Mar-2021 21:09:50.320 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
geoserver4geonode | 06-Mar-2021 21:09:50.320 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-8-openjdk-amd64/jre
geoserver4geonode | 06-Mar-2021 21:09:50.320 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_275-8u275-b01-1~deb9u1-b01
geoserver4geonode | 06-Mar-2021 21:09:50.321 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
geoserver4geonode | 06-Mar-2021 21:09:50.321 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
geoserver4geonode | 06-Mar-2021 21:09:50.322 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
geoserver4geonode | 06-Mar-2021 21:09:50.326 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
geoserver4geonode | 06-Mar-2021 21:09:50.327 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
geoserver4geonode | 06-Mar-2021 21:09:50.327 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
geoserver4geonode | 06-Mar-2021 21:09:50.327 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms2G
geoserver4geonode | 06-Mar-2021 21:09:50.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx4G
geoserver4geonode | 06-Mar-2021 21:09:50.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:PerfDataSamplingInterval=500
geoserver4geonode | 06-Mar-2021 21:09:50.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:SoftRefLRUPolicyMSPerMB=36000
geoserver4geonode | 06-Mar-2021 21:09:50.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:-UseGCOverheadLimit
geoserver4geonode | 06-Mar-2021 21:09:50.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseConcMarkSweepGC
geoserver4geonode | 06-Mar-2021 21:09:50.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseParNewGC
geoserver4geonode | 06-Mar-2021 21:09:50.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:ParallelGCThreads=4
geoserver4geonode | 06-Mar-2021 21:09:50.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF8
geoserver4geonode | 06-Mar-2021 21:09:50.331 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djavax.servlet.request.encoding=UTF-8
geoserver4geonode | 06-Mar-2021 21:09:50.332 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djavax.servlet.response.encoding=UTF-8
geoserver4geonode | 06-Mar-2021 21:09:50.332 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Duser.timezone=GMT
geoserver4geonode | 06-Mar-2021 21:09:50.333 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.geotools.shapefile.datetime=false
geoserver4geonode | 06-Mar-2021 21:09:50.333 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -DGEOSERVER_CSRF_DISABLED=true
geoserver4geonode | 06-Mar-2021 21:09:50.333 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -DPRINT_BASE_URL=http://geoserver:8080/geoserver/pdf
geoserver4geonode | 06-Mar-2021 21:09:50.334 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
geoserver4geonode | 06-Mar-2021 21:09:50.334 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
geoserver4geonode | 06-Mar-2021 21:09:50.334 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
geoserver4geonode | 06-Mar-2021 21:09:50.335 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
geoserver4geonode | 06-Mar-2021 21:09:50.335 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
geoserver4geonode | 06-Mar-2021 21:09:50.335 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
geoserver4geonode | 06-Mar-2021 21:09:50.336 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
geoserver4geonode | 06-Mar-2021 21:09:50.339 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.21] using APR version [1.5.2].
geoserver4geonode | 06-Mar-2021 21:09:50.340 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
geoserver4geonode | 06-Mar-2021 21:09:50.340 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
geoserver4geonode | 06-Mar-2021 21:09:50.345 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.0l  10 Sep 2019]
geoserver4geonode | 06-Mar-2021 21:09:50.764 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
geoserver4geonode | 06-Mar-2021 21:09:50.813 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
geoserver4geonode | 06-Mar-2021 21:09:50.818 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [967] milliseconds
geoserver4geonode | 06-Mar-2021 21:09:50.858 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
geoserver4geonode | 06-Mar-2021 21:09:50.858 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.20]
geoserver4geonode | 06-Mar-2021 21:09:50.876 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/examples]
geoserver4geonode | 06-Mar-2021 21:09:51.829 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/examples] has finished in [953] ms
geoserver4geonode | 06-Mar-2021 21:09:51.829 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/host-manager]
geoserver4geonode | 06-Mar-2021 21:09:51.876 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/host-manager] has finished in [46] ms
geoserver4geonode | 06-Mar-2021 21:09:51.877 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/manager]
geoserver4geonode | 06-Mar-2021 21:09:51.922 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/manager] has finished in [45] ms
geoserver4geonode | 06-Mar-2021 21:09:51.923 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/docs]
geoserver4geonode | 06-Mar-2021 21:09:51.944 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/docs] has finished in [22] ms
geoserver4geonode | 06-Mar-2021 21:09:51.945 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/ROOT]
geoserver4geonode | 06-Mar-2021 21:09:51.965 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/ROOT] has finished in [21] ms
geoserver4geonode | 06-Mar-2021 21:09:51.966 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/geoserver]
geoserver4geonode | 06-Mar-2021 21:10:09.483 INFO [main] 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.
geoserver4geonode | 06-Mar-2021 21:10:11.964 WARNING [main] it.geosolutions.imageio.gdalframework.GDALUtilities.loadGDAL Failed to load the GDAL native libs. This is not a problem unless you need to use the GDAL plugins: they won't be enabled.
geoserver4geonode | java.lang.UnsatisfiedLinkError: no gdaljni in java.library.path
geoserver4geonode | 06-Mar-2021 21:10:13.044 WARNING [main] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'XStreamPersisterInitializer', but ApplicationContext is unset.
geoserver4geonode | 06-Mar-2021 21:10:13.044 WARNING [main] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
geoserver4geonode | 06-Mar-2021 21:10:13.048 WARNING [main] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionProvider', but ApplicationContext is unset.
geoserver4geonode | 06-Mar-2021 21:10:13.048 WARNING [main] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
geoserver4geonode | log4j:WARN File option not set for appender [geoserverlogfile].
geoserver4geonode | log4j:WARN Are you using FileAppender instead of ConsoleAppender?
geoserver4geonode | 06-Mar-2021 21:10:24.112 WARNING [main] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'GeoServerSecurityProvider', but ApplicationContext is unset.
geoserver4geonode | 06-Mar-2021 21:10:24.112 WARNING [main] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
geoserver4geonode | 06-Mar-2021 21:10:24.112 WARNING [main] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionProvider', but ApplicationContext is unset.
geoserver4geonode | 06-Mar-2021 21:10:24.113 WARNING [main] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
geoserver4geonode | 06-Mar-2021 21:10:49.932 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/geoserver] has finished in [57,965] ms
geoserver4geonode | 06-Mar-2021 21:10:49.941 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
geoserver4geonode | 06-Mar-2021 21:10:49.975 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
geoserver4geonode | 06-Mar-2021 21:10:49.978 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [59,159] milliseconds
nginx4geonode    | $\n\n\n
nginx4geonode    | -----------------------------------------------------
nginx4geonode    | STARTING NGINX ENTRYPOINT ---------------------------
nginx4geonode    | Sat Mar  6 22:34:40 UTC 2021
nginx4geonode    | Creating autoissued certificates for HTTP host
nginx4geonode    | Autoissued certificate already exists
nginx4geonode    | Creating symbolic link for HTTPS certificate
nginx4geonode    | Certbot certificate does not exist, we symlink to autoissued
nginx4geonode    | Sanity checks on http/s ports configuration
nginx4geonode    | Replacing environement variables
nginx4geonode    | Enabling or not https configuration
nginx4geonode    | Loading nginx autoreloader
nginx4geonode    | -----------------------------------------------------
nginx4geonode    | FINISHED NGINX ENTRYPOINT ---------------------------
nginx4geonode    | -----------------------------------------------------
nginx4geonode    | Setting up watches.  Beware: since -r was given, this may take a while!
nginx4geonode    | Watches established.
nginx4geonode    | 2021/03/06 22:34:40 [warn] 1#1: conflicting server name "localhost" on 0.0.0.0:80, ignored
nginx4geonode    | nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:04 +0000] "GET / HTTP/1.1" 200 6041 "https://192.168.5.53/en/admin/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:05 +0000] "GET /jsi18n/ HTTP/1.1" 200 4202 "https://192.168.5.53/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:05 +0000] "GET /api/featured/ HTTP/1.1" 200 145 "https://192.168.5.53/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:24 +0000] "POST /account/login/?next=/ HTTP/1.1" 302 0 "https://192.168.5.53/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:25 +0000] "GET / HTTP/1.1" 200 6336 "https://192.168.5.53/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:25 +0000] "GET /jsi18n/ HTTP/1.1" 200 4202 "https://192.168.5.53/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:26 +0000] "GET /api/featured/ HTTP/1.1" 200 145 "https://192.168.5.53/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:29 +0000] "GET /services/register/ HTTP/1.1" 200 6298 "https://192.168.5.53/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:29 +0000] "GET /jsi18n/ HTTP/1.1" 200 4202 "https://192.168.5.53/services/register/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:40 +0000] "POST /services/register/ HTTP/1.1" 200 6380 "https://192.168.5.53/services/register/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:40 +0000] "GET /jsi18n/ HTTP/1.1" 200 4202 "https://192.168.5.53/services/register/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:51 +0000] "POST /services/register/ HTTP/1.1" 200 6376 "https://192.168.5.53/services/register/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:38:51 +0000] "GET /jsi18n/ HTTP/1.1" 200 4202 "https://192.168.5.53/services/register/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:39:04 +0000] "POST /services/register/ HTTP/1.1" 200 6377 "https://192.168.5.53/services/register/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
nginx4geonode    | 192.168.5.53 - - [06/Mar/2021:22:39:04 +0000] "GET /jsi18n/ HTTP/1.1" 200 4202 "https://192.168.5.53/services/register/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
db4geonode       | 2021-03-06 12:38:37.667 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db4geonode       | 2021-03-06 12:38:37.667 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db4geonode       | 2021-03-06 12:38:37.668 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db4geonode       | 2021-03-06 12:38:37.681 UTC [19] LOG:  database system was interrupted; last known up at 2021-03-06 12:35:07 UTC
db4geonode       | 2021-03-06 12:38:37.738 UTC [19] LOG:  database system was not properly shut down; automatic recovery in progress
db4geonode       | 2021-03-06 12:38:37.745 UTC [19] LOG:  redo starts at 0/4E363E0
db4geonode       | 2021-03-06 12:38:37.747 UTC [19] LOG:  invalid record length at 0/4E55A20: wanted 24, got 0
db4geonode       | 2021-03-06 12:38:37.747 UTC [19] LOG:  redo done at 0/4E559E8
db4geonode       | 2021-03-06 12:38:37.747 UTC [19] LOG:  last completed transaction was at log time 2021-03-06 12:38:12.963065+00
db4geonode       | 2021-03-06 12:38:37.816 UTC [20] FATAL:  the database system is starting up
db4geonode       | 2021-03-06 12:38:37.837 UTC [1] LOG:  database system is ready to accept connections
db4geonode       | 2021-03-06 12:49:58.229 UTC [102] FATAL:  database "geonode_database" does not exist
gannebamm commented 3 years ago

Why do you need to load your local GeoNode GeoServer into GeoNode as remote services? TBH I do not understand why such remote service should fail, but neither do I see a point in doing that. You can use the updatelayers management command to fetch layers which are present in GeoServer but not registered in GeoNode, yet. A use case for that is to create GeoNode layers for datatypes GeoNode is not able to ingest, eg. netCDF. See this documentation: https://docs.geonode.org/en/master/admin/mgmt_commands/index.html#management-command-updatelayers

Well, maybe it fails because of docker network routing? You could try this http://geoserver:8080/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities

which will use the geoserver service inside the docker network. But above is untested.

Darkonyks commented 3 years ago

I use Geoserver to serve layers from different sources. I'm not truing to add layers that are already uploaded in geonode_data database in Postgresql, than to add layers from MS SQL server in different Workspace/Source. Also, my Geonode instance is public and Geoserver also, they are not on localhost any more than on public host - production. I have tried WMS service's to add in several different GeoNode instances and I face the same problem. Also when I run command ./manage.sh sync_geonode_layers --updatepermissions Syncing layer 1/1: GRAD Syncing permissions... I got an error RuntimeError: Could not ADD GeoServer User 'admin' Rule for Layer ....... ./manage.sh sync_geonode_layers --updatethumbnails Syncing layer 1/1: GRAD Regenerating thumbnails... There are 0 layers which could not be updated because of errors.

I think than it might be something with GeoFences setings... Maybe !?