Comments (10)
I think the issue could be either due to the following
- A version of libjturbo that is not compatible with the current geoserver extention
- An upstream issue,
If you look at the logs you will see the following
![Screenshot 2024-05-25 at 14 40 39](https://private-user-images.githubusercontent.com/2510900/333800439-e568f081-2b98-4842-898e-c325a7dee1d8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgzMTQ5NTMsIm5iZiI6MTcxODMxNDY1MywicGF0aCI6Ii8yNTEwOTAwLzMzMzgwMDQzOS1lNTY4ZjA4MS0yYjk4LTQ4NDItODk4ZS1jMzI1YTdkZWUxZDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYxMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MTNUMjEzNzMzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjMwMTFhODg1NWViYjYyM2E2NWM0ZmNlNTNmNDhmOGI3MTQ4MmZjZmZhNWNjMzc4MTZlNGE5ZGY5Yzk4YmNiMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.jln0I6VzOqLjt4dpojcG2uDIqcNp49KWFDfk_dIw7jY)
This shows that the extension is loaded properly
from docker-geoserver.
@vidlb What CPU architecture are you running on?
@NyakudyaA The error in the trace indicates a linkage error, and is because the plugin is pulling in an older version of libjpeg-turbo
than what this Docker image provides.
The Docker image has turbojpeg-wrapper-1.2.1.5.jar
– this is quite old. I believe it is downloaded as a transitive dependency from gs-libjpeg-turbo-2.25.0.jar
. It does not include any native libraries.
It looks like the error thrown from here: https://github.com/libjpeg-turbo/libjpeg-turbo/blob/49f3485cb58c3c57a513fe0efe00de7cf319708c/java/org/libjpegturbo/turbojpeg/TJCompressor.java#L146
The line numbers don't match with the current upstream main branch, but do match with 1.2.x
.
The actual C implementation in JNI is one of the functions whose names start with Java_org_libjpegturbo_turbojpeg_TJCompressor_compress
(I don't know which – I forget JNI calling conventions); which is in turbojpeg-jni.c
, which is built as libturbojpeg.so
. That'll again be based on libjpeg-turbo
v1.2.x's JNI interface (which is 13 years old) – but the image is pulling in v3.0.3.
Also, according to the deployment build log, it looks like the first apt install
call pulls in libjpeg-turbo8
from Ubuntu as a transitive dependency:
https://github.com/kartoza/docker-geoserver/actions/runs/9140425983/job/25133771692#step:7:285
But then another part of the Dockerfile
installs libjpeg-turbo-official
from upstream packages:
docker-geoserver/scripts/setup.sh
Lines 86 to 94 in 7bcc741
On aarch64
:
-
LD_LIBRARY_PATH
ends up being/usr/local/tomcat/native-jni-lib:/usr/local/tomcat/native-jni-lib:/usr/lib/jni:/usr/local/apr/lib:/opt/libjpeg-turbo/lib64:/usr/lib:/usr/lib/x86_64-linux-gnu
./usr/lib/x86_64-linux-gnu
is not correct for non-x86_64
CPUs. -
Upstream's
libjpeg-turbo-official
SO ends up at/opt/libjpeg-turbo/lib64/libjpeg.so.62.4.0
(C library) and/opt/libjpeg-turbo/lib64/libturbojpeg.so.0.3.0
(JNI wrapper); and includes those Java classes at/opt/libjpeg-turbo/classes/turbojpeg.jar
. -
Ubuntu's
libjpeg-turbo8
SO ends up at/usr/lib/aarch64-linux-gnu/libjpeg.so.8.2.2
(C library), and doesn't install any Java components. I couldn't find a Java-specific Ubuntu package. -
Both create
libjpeg.so
symlinks in their respectivelib
folders, but that's only for C linkage.
So everything is a bit confused; it may only work properly on x86_64
(while my workstation in aarch64
, my production deployment is on x86_64
).
I think that the solution will be to rebuild gs-libjpeg-turbo
linked against the current version of libjpeg-turbo
Java libraries.
While you could roll back to libjpeg-turbo 1.2.x
to match what that plugin uses, it likely has security problems and is end of life and not supported by upstream.
from docker-geoserver.
@vidlb What CPU architecture are you running on?
My CPU is x86_64
from docker-geoserver.
My CPU is x86_64
Hmm, OK. My theories about library paths (while an issue) are probably not the cause.
I've just had a poke at my production instance (running a fork of this image) with GeoServer 2.25.1 on x86_64
using a vector layer (in PostGIS) over WMS.
Outputting as PNG is working fine there, but outputting as JPEG is returning the same error you're seeing.
I've also tried this out with on aarch64
and an ESRI ShapeFile (vector) layer, and seeing the same again.
The error you're seeing with PNG is while loading a raster JPEG layer, and I don't have any raster layers loaded there to try out.
I've done some more digging into the dependency chain, and it looks like GeoSolutions IT's fork of the libjpegturbo
Java libraries was made 11+ years ago, and I can't find any C code in that repository for what the JNI libraries are linking to... so they'll still be trying to hit interfaces that have broken ABI compatibility.
I've filed the issue upstream (with more detail): geosolutions-it/imageio-ext#305
As for what we could do here, I found removing the libjpeg-turbo
GeoServer plugin from the list of required plugins fixed it in my local fork.
My fork has #659 already applied; so I just removed the libjpeg-turbo-plugin
line from build_data/required_plugins.txt
, and added it to build_data/stable_plugins.txt
.
from docker-geoserver.
Can you try the 2.25.1 image, we now can disable the plugin if not needed by using the env ACTIVE_EXTENSIONS=
from docker-geoserver.
I just tried after adding the empty ACTIVE_EXTENSIONS=
env but when I remove the JVM opt the plugin is loaded as usual, am I supposed to start with an empty DATA_DIR ? Is there a way to avoid this ?
from docker-geoserver.
@vidlb you will need to adjust it to become
ACTIVE_EXTENSIONS=control-flow-plugin,csw-iso-plugin,csw-plugin,gdal-plugin,inspire-plugin,monitor-plugin,pyramid-plugin,vectortiles-plugin,wps-plugin
You will need to adjust the env to skip the default plugin
from docker-geoserver.
All right it seems to work !
Regarding the ACTIVE_EXTENSIONS env, people might expect to see every plugin disabled when empty, don't you think ?
Empty could be handled differently than unset.
from docker-geoserver.
If ACTIVE_EXTENSIONS
is empty it should install all default plugins, this is for backward compatibility. We just need to make it explicit that this variable is meant to give users the power to select which default plugins should not be activated. Any wording suggestions
from docker-geoserver.
I find it hard to explain for the empty case, would be simpler if the variable was DISABLED_EXTENSIONS
, but may be something like
Use this variable to specify a set of plugins to enable, if left empty or unset the following will be enabled : [list of default plugins]
Edit: libjpeg-turbo should be discouraged
from docker-geoserver.
Related Issues (20)
- Unable to set FILTER_COMPLIANCE property in Web Feature Server store through REST api HOT 5
- support for 2.24.1 HOT 4
- GeoServer Pod Restart Failure with Thread Local Errors in Kubernetes Environment HOT 1
- Not possible anymore to run as non-root HOT 12
- roles.xml & roles.xml.orig down to 0 bytes HOT 1
- Geoserver Cluster on AWS ECS not working HOT 9
- Dockerfile STABLE_EXTENSION gdal error ->Plugin URL does not exist:: https://sourceforge.net/projects/geoserver/files/GeoServer/2.24.1/extensions/geoserver-2.24.1-gdal.zip HOT 1
- gdal stable extension support needed. HOT 5
- random start-up crash HOT 10
- XFRAME_OPTIONS does not work as expected. HOT 1
- [geoserver.monitor] - Request Dumper exiting due to :Permission denied
- crash at start on arm64 HOT 1
- After crashing I couldn't run again HOT 2
- Write a security policy / nominate security contacts HOT 5
- validate_url and download_extension request every URL twice, and don't re-use connections, making builds really slow HOT 3
- Update base image to new image HOT 4
- GWC error "Problem communicating with GeoServer" HOT 13
- Custom Vector Dimensions don't work in 2.25.0 HOT 2
- JDBCconfig and JDBCstore configuration settings via ENV variables HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-geoserver.