Closed crabel99 closed 9 months ago
@crabel99 are you sure you need to download and extract the plugins again? The WAR from dropbox contains already the needed JARs
@afabian I included them more as an exercise for me to learn how geoserver
is set up. In the description of the process I show the conventional approach installing the prepared .war. Everything after ## then either
can be ignored. The prepared .war does not work with jdk 11 so you do have to roll back to jdk 8. The reason why I submitted this was that the documentation goes through a lot of unnecessary steps while leaving unmet dependencies, and configures things in a non-standard way. I just streamlined the geoserver
install to address these problems.
The error that I reported with the inability to access geofence-default-override.properties
holds for both the stock 2.18.3 prepared war and my adhoc 2.19.2 method. Additionally, I am not able to access the reset password link (I keep getting 400) with both the 2.18.3 and the 2.19.2 methods. I also can't change any fields, getting 400 when trying to save. I've been working on this for about a week. Once I get the problem isolated I'll post what I find.
Going through the verbose geoserver
logs there were a number of different things that weren't working using the stock Dropbox geoserver-2.18.3.war
First, there were a lot of ows
messages in the logs, checked the OWS Summary Page and saw that there was a missing package: java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper
entered apt install libatk-wrapper-java
which removed the ows messages in the logs, but the OWS Summary Page has the same error.
Second, none of the GDAL coverage format factories were loading and there was a message in journalctl
stating:
Oct 06 15:45:57 fermi tomcat9[4103004]: Native library load failed.
Oct 06 15:45:57 fermi tomcat9[4103004]: java.lang.UnsatisfiedLinkError: no gdaljni in java.library.path
This was partially fixed by apt install libgdal-java
. But loading the libraries was not fixed. I attempted adding an environment variable into the systemctl service Environment=CATALINA_OPTS='-Djava.library.path=/usr/share/java'
. This threw an error, so I included the configuration in JAVA_OPTS
instead. This allowed geoserver.war
to access the system's java gdal
and atk
libraries.
Third, there was an error with not finding the jpeg2000 jars. This was fixed by adding the jars from http://sourceforge.net/projects/geoserver/files/GeoServer/2.18.3/extensions/geoserver-2.18.3-jp2k-plugin.zip into WEB-INF
. The error cleared and the results of the second and third fixes resulted in a logged output of:
2021-10-06 15:46:06,271 WARN [gce.imagemosaic] - Unable to set ordering between tiff readers spi
2021-10-06 15:46:06,290 INFO [util.factory] - Factory implementations for category GridFormatFactorySpi:
org.geotools.coverageio.jp2k.JP2KFormatFactory
org.geotools.gce.image.WorldImageFormatFactory
org.geoserver.catalog.testreader.CustomFormatFactory
org.geotools.gce.geotiff.GeoTiffFormatFactorySpi
org.geotools.geopkg.mosaic.GeoPackageFormatFactorySpi
org.geotools.gce.arcgrid.ArcGridFormatFactory
org.geotools.gce.imagemosaic.ImageMosaicFormatFactory
org.geotools.coverageio.gdal.mrsid.MrSIDFormatFactory
org.geotools.coverageio.gdal.jp2kak.JP2KFormatFactory
org.geotools.coverageio.gdal.jp2mrsid.JP2MrSIDFormatFactory
org.geotools.coverageio.gdal.jp2ecw.JP2ECWFormatFactory
org.geotools.coverageio.gdal.ecw.ECWFormatFactory
org.geotools.coverageio.gdal.dted.DTEDFormatFactory
org.geotools.coverageio.gdal.erdasimg.ErdasImgFormatFactory
org.geotools.coverageio.gdal.idrisi.IDRISIFormatFactory
org.geotools.coverageio.gdal.nitf.NITFFormatFactory
org.geotools.coverageio.gdal.ehdr.EsriHdrFormatFactory
org.geotools.coverageio.gdal.envihdr.EnviHdrFormatFactory
org.geotools.coverageio.gdal.aig.AIGFormatFactory
org.geotools.coverageio.gdal.rpftoc.RPFTOCFormatFactory
org.geotools.coverageio.gdal.vrt.VRTFormatFactory
org.geotools.coverageio.gdal.srp.SRPFormatFactory
2021-10-06 15:46:06,291 DEBUG [coverageio.jp2k] - JP2KFormatFactory is available.
2021-10-06 15:46:06,291 DEBUG [gce.arcgrid] - ArcGridFormatFactory is available.
2021-10-06 15:46:06,291 DEBUG [gdal.mrsid] - MrSIDFormatFactory is not available.
2021-10-06 15:46:06,291 DEBUG [gdal.jp2kak] - JP2KFormatFactory is not available.
2021-10-06 15:46:06,291 DEBUG [gdal.jp2mrsid] - JP2MrSIDFormatFactory is not available.
2021-10-06 15:46:06,291 DEBUG [gdal.jp2ecw] - JP2ECWFormatFactory is not available.
2021-10-06 15:46:06,291 DEBUG [gdal.ecw] - ECWFormatFactory is not available.
2021-10-06 15:46:06,292 DEBUG [gdal.dted] - DTEDFormatFactory is available.
2021-10-06 15:46:06,292 DEBUG [gdal.erdasimg] - ErdasImgFormatFactory is available.
2021-10-06 15:46:06,292 DEBUG [gdal.idrisi] - IDRISIFormatFactory is available.
2021-10-06 15:46:06,292 DEBUG [gdal.nitf] - NITFFormatFactory is available.
2021-10-06 15:46:06,292 DEBUG [gdal.ehdr] - EsriHdrFormatFactory is available.
2021-10-06 15:46:06,292 DEBUG [gdal.envihdr] - EnviHdrFormatFactory is available.
2021-10-06 15:46:06,292 DEBUG [gdal.aig] - AIGFormatFactory is available.
2021-10-06 15:46:06,292 DEBUG [gdal.rpftoc] - RPFTOCFormatFactory is available.
2021-10-06 15:46:06,292 DEBUG [gdal.vrt] - VRTFormatFactory is available.
2021-10-06 15:46:06,292 DEBUG [gdal.srp] - SRPFormatFactory is available.
2021-10-06 15:46:06,298 DEBUG [coverageio.jp2k] - Creating a new JP2KFormat.
2021-10-06 15:46:06,301 DEBUG [gdal.aig] - Creating a new AIGFormat.
2021-10-06 15:46:06,301 DEBUG [gdal.vrt] - Creating a new VRTFormat.
2021-10-06 15:46:06,305 DEBUG [gce.arcgrid] - Creating a new ArcGriFormat.
2021-10-06 15:46:06,306 DEBUG [gdal.erdasimg] - Creating a new ErdasImgFormat.
2021-10-06 15:46:06,307 DEBUG [gdal.rpftoc] - Creating a new RPFTOCFormat.
2021-10-06 15:46:06,307 DEBUG [gdal.srp] - Creating a new SRPFormat.
2021-10-06 15:46:06,313 DEBUG [gdal.envihdr] - Creating a new EnviHdrFormat.
2021-10-06 15:46:06,313 DEBUG [gdal.ehdr] - Creating a new EsriHdrFormat.
2021-10-06 15:46:06,314 DEBUG [gdal.idrisi] - Creating a new IDRISIFormat.
2021-10-06 15:46:06,314 DEBUG [gdal.dted] - Creating a new DTEDFormat.
2021-10-06 15:46:06,316 DEBUG [gdal.nitf] - Creating a new NITFFormat.
This leaves the MrSIDFormatFactory, JP2KFormatFactory, JP2MrSIDFormatFactory , JP2ECWFormatFactory, and ECWFormatFactory unavailable. As I don't have a reference system is this expected or is this a sign of additional missing packages?
There is still a non fatal error:
2021-10-06 15:45:59,420 WARN [geoserver.config] - Error reading resource URL [jar:file:/var/lib/tomcat9/webapps/geoserver/WEB-INF/lib/gs-geofence-server-2.18.3.jar!/geofence-default-override.properties]
java.io.FileNotFoundException: URL [jar:file:/var/lib/tomcat9/webapps/geoserver/WEB-INF/lib/gs-geofence-server-2.18.3.jar!/geofence-default-override.properties] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/var/lib/tomcat9/webapps/geoserver/WEB-INF/lib/gs-geofence-server-2.18.3.jar!/geofence-default-override.properties
...
2021-10-06 15:45:59,427 TRACE [config.GeoFencePropertyPlaceholderConfigurer] - Loading properties file from org.geoserver.config.SpringResourceAdaptor@258f15c2
2021-10-06 15:45:59,436 TRACE [config.GeoServerPropertyOverrideConfigurer] - Loading properties file from URL [jar:file:/var/lib/tomcat9/webapps/geoserver/WEB-INF/lib/gs-geofence-server-2.18.3.jar!/geofence-default-override.properties]
Since the error ends up clearing. I'm not sure if this is worth chasing down other than to have clean logs.
There are a number of unresolved warnings:
2021-10-06 15:45:59,560 WARN [geoserver.monitor] - monitoring storage memory not found, falling back to 'memory'
2021-10-06 15:46:00,444 WARN [ejb.Ejb3Configuration] - hibernate.connection.autocommit = false break the EJB3 specification
2021-10-06 15:46:00,485 WARN [dialect.H2Dialect] - The 1.1.119 version of H2 implements temporary table creation such that it commits current transaction; multi-table, bulk hql/jpaql will not work properly
2021-10-06 15:46:00,689 WARN [dialect.H2Dialect] - The 1.1.119 version of H2 implements temporary table creation such that it commits current transaction; multi-table, bulk hql/jpaql will not work properly
2021-10-06 15:46:01,647 WARN [config.XMLConfiguration] - ********************************************************************************
2021-10-06 15:46:01,647 WARN [config.XMLConfiguration] - *** GWC configuration validation error: cvc-elt.1.a: Cannot find the declaration of element 'gwcConfiguration'.
2021-10-06 15:46:01,647 WARN [config.XMLConfiguration] - *** Will try to use configuration anyway. Please check the order of declared elements against the schema.
2021-10-06 15:46:01,647 WARN [config.XMLConfiguration] - ********************************************************************************
2021-10-06 15:46:06,271 WARN [gce.imagemosaic] - Unable to set ordering between tiff readers spi
2021-10-06 15:46:07,669 WARN [platform.resource] - There is code leaving resource input streams open, locks around them might not be cleared! Add -Dgs.lock.trace=true to your JVM options to get a full stack trace of the code that acquired the input stream
2021-10-06 15:46:08,167 WARN [servlet.BaseMapServlet] - Cannot delete file:/var/lib/tomcat9/work/Catalina/localhost/geoserver/wicket-filestore
I'm not sure if these are normal and expected or not.
None of what I did allowed me to change the admin user password, or access or change any of the settings and configurations, e.g. setting up Oauth2. What is everything supposed to look like?
Isolated the inability to change settings issue to a proxy header issue with nginx
. I was able to log in to port 8080 from my local subnet (configured ufw to open up 8080 on the internal ip) However, when accessing through the nginx
proxy there is a partial failure. It seems like geoserver
only protects certain parts with CORS (this is pure speculation). The walk through does not address the nginx
proxying. I borrowed a set of working proxy configs from another service to test to see if this fixed the issue. Unfortunately, it did not. The good news is that the problem is isolated to the nginx
server config. Does anyone have a working nginx
config that allows saving tables or changing passwords in geoserver?
server{
...
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
client_header_buffer_size 500k;
large_client_header_buffers 4 500k;
http2_max_field_size 500k;
http2_max_header_size 500k;
# Mitigate httpoxy attack (see README for details)
proxy_set_header Proxy "";
...
}
Is your feature request related to a problem? Please describe. Setting up
geoserver
is very cumbersome and relies on manual configuration and installation oftomcat
when there is a distribution package version that works. Additionally, the file structure is not well integrated with the Ubuntu style norms. I ran into java dependency issues when I followed the existing deployment guide on a clean Ubuntu 20.04 server. Which means that the development environment is not reproducible when deployed. Whentomcat
is installed through the repolibtomcat9-java
is automatically included which has the missing jar. I got the method below working with either thegeonode
stockgeoserver-2.18.3.war
or with the manually installedgeoserver-2.19.2.war
as implemented below.Describe the solution you'd like
Reproducible
geoserver
Deployment for Ubuntu 20.04 LTSThe purpose of this document is to show how to streamline and simplify the Ubuntu
geoserver
deployment and to make it conform more closely with the Ubuntu directory structure. The following commands are all executed as root. This can be done either by prependingsudo
to each command, or by entering the commandsudo su
at the beginning of the process.Install and Configure the
systemd
ServiceThis build environment relies upon and mimics the ubuntu package distribution structure. For the management of
tomcat
applications there are other options that can be installed. To see the list enterapt-cache search tomcat
in the command line.The
systemctl
configuration allows "overriding" the default distribution settings by usingsystemctl edit <service name>
. The method shown here will append the additional commands to the default distribution settings and prevent the loss of the configuration when the distribution is upgraded. Note, theedit
command automatically executesdaemon-reload
. You can see the change in the service settings by typingsystemctl cat <service name>
.In the now open
nano
terminal paste thegeoserver
settings:Create the Directory Structure and Install Needed Packages
Additional Logging (Optional)
If you desire additional stack trace outputs to be reported into the logs perform the following steps after deploying
geoserver
.classes/logging.properties
:Start
geoserver
Startup Log Files
/var/log/geoserver/geoserver.log
Following is the startup log entry, including the stacktrace for the only error that occurs. The same error was obtained also with
geoserver-2.18.3.war
using the similar framework. It does not appear to effect the operation of thegeoserver
.journalctl -u tomcat9