Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JNI error when launching on Endeavouros #440

Open
FourRand0m opened this issue Dec 12, 2024 · 12 comments
Open

JNI error when launching on Endeavouros #440

FourRand0m opened this issue Dec 12, 2024 · 12 comments
Labels
bug something isn't working fixed issue has been fixed but may not be released yet.

Comments

@FourRand0m
Copy link

FourRand0m commented Dec 12, 2024

When launching strongbox from terminal, gives the following error:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/.mount_strong7rGipX/usr/lib/libnio.so: /tmp/.mount_strong7rGipX/usr/lib/libnio.so: undefined symbol: reuseport_available
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(Unknown Source)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.base/java.lang.Runtime.loadLibrary0(Unknown Source)
at java.base/java.lang.System.loadLibrary(Unknown Source)
at java.base/sun.nio.fs.UnixNativeDispatcher$1.run(Unknown Source)
at java.base/sun.nio.fs.UnixNativeDispatcher$1.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.nio.fs.UnixNativeDispatcher.(Unknown Source)
at java.base/sun.nio.fs.UnixFileSystem.(Unknown Source)
at java.base/sun.nio.fs.LinuxFileSystem.(Unknown Source)
at java.base/sun.nio.fs.LinuxFileSystemProvider.newFileSystem(Unknown Source)
at java.base/sun.nio.fs.LinuxFileSystemProvider.newFileSystem(Unknown Source)
at java.base/sun.nio.fs.UnixFileSystemProvider.(Unknown Source)
at java.base/sun.nio.fs.LinuxFileSystemProvider.(Unknown Source)
at java.base/sun.nio.fs.DefaultFileSystemProvider.(Unknown Source)
at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(Unknown Source)
at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(Unknown Source)
at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(Unknown Source)
at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.(Unknown Source)
at java.base/java.nio.file.FileSystems.getDefault(Unknown Source)
at java.base/java.io.File.toPath(Unknown Source)
at java.base/java.util.zip.ZipFile$Source.get(Unknown Source)
at java.base/java.util.zip.ZipFile$CleanableResource.(Unknown Source)
at java.base/java.util.zip.ZipFile$CleanableResource.get(Unknown Source)
at java.base/java.util.zip.ZipFile.(Unknown Source)
at java.base/java.util.zip.ZipFile.(Unknown Source)
at java.base/java.util.jar.JarFile.(Unknown Source)
at java.base/java.util.jar.JarFile.(Unknown Source)
at java.base/java.util.jar.JarFile.(Unknown Source)
at java.base/sun.launcher.LauncherHelper.getMainClassFromJar(Unknown Source)
at java.base/sun.launcher.LauncherHelper.loadMainClass(Unknown Source)
at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Can be fixed by setting LD_LIBRARY_PATH to nothing and running in terminal again.
Might be an issue with my system configuration.

To reproduce:

  1. Install from Aur
  2. Run strongbox
  3. Get error

It will also not run from the desktop shortcut, unless Exec=/usr/bin/env LD_LIBRARY_PATH= /usr/bin/strongbox terminal=true, and TerminalOptions=\s--noclose

This is my first bugreport, plz be nice <3

@FourRand0m FourRand0m added the bug something isn't working label Dec 12, 2024
@torkus
Copy link
Contributor

torkus commented Dec 12, 2024

hey @FourRand0m , thanks for opening a bug report :) If you think about it, there is quite a barrier to using a program, finding the error, logging in to Github and writing up a report, etc so I'm always grateful for the efforts of bug reporters.

I've not come across EndeavourOS before but this seems like a helpful stacktrace.

@torkus
Copy link
Contributor

torkus commented Dec 12, 2024

OK, did a quick search and it could be the version of Java you have installed.

Strongbox requires Java JDK 11+ (not JRE) and I personally develop against the jdk11-openjdk.

You can see which version(s) of Java you have installed with:

$ pacman -Qs jdk
local/jdk11-openjdk 11.0.24.u8-1
    OpenJDK Java 11 development kit
local/jdk17-openjdk 17.0.12.u7-1
    OpenJDK Java 17 development kit

or

$ archlinux-java status
Available Java environments:
  java-11-openjdk (default)
  java-17-openjdk

and the version of java in use with:

$ java -version
openjdk version "11.0.24" 2024-07-16
OpenJDK Runtime Environment (build 11.0.24+8)
OpenJDK 64-Bit Server VM (build 11.0.24+8, mixed mode)

To switch between versions of installations you can go:

$ archlinux-java set java-11-openjdk

@torkus
Copy link
Contributor

torkus commented Dec 12, 2024

Install from Aur

this puzzles me though. The AUR installs the AppImage and not the .jar. There may be more to this problem.

@FourRand0m
Copy link
Author

Thanks for the swift response! I really appreciate your work on this addon manager.

My current openjdk is 23.
I have tried installing openjdk-11, and set it as the current env. It does not change anything when running strongbox.
The same behaviour as before is present.

I have also tried downloading and running just the Appimage from releases with same results.

@torkus
Copy link
Contributor

torkus commented Dec 13, 2024

On a fresh installation of EndeavourOS with no Java installed, installing Strongbox with yay works without issue:

[liveuser@eos-2024.09.22 ~]$ yay -Ss strongbox
aur/strongbox 7.5.0-1 (+5 0.00) 
    World of Warcraft addon manager. F/OSS, ad-free and privacy respecting.
[liveuser@eos-2024.09.22 ~]$ yay -S strongbox
AUR Explicit (1): strongbox-7.5.0-1
:: (1/1) Downloaded PKGBUILD: strongbox
  1 strongbox                        (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> A
:: Deleting (1/1): /home/liveuser/.cache/yay/strongbox
HEAD is now at 5b7982c release 7.5.0
  1 strongbox                        (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> N
:: Proceed with install? [Y/n] Y
==> Making package: strongbox 7.5.0-1 (Sat 14 Dec 2024 09:39:42 AM ACDT)
==> Retrieving sources...
  -> Downloading strongbox-7.5.0...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 46.0M  100 46.0M    0     0  8768k      0  0:00:05  0:00:05 --:--:-- 12.0M
  -> Found strongbox.desktop
==> WARNING: Skipping verification of source file PGP signatures.
==> Validating source files with sha256sums...
    strongbox-7.5.0 ... Passed
    strongbox.desktop ... Passed
:: (1/1) Parsing SRCINFO: strongbox
==> Making package: strongbox 7.5.0-1 (Sat 14 Dec 2024 09:39:52 AM ACDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found strongbox-7.5.0
  -> Found strongbox.desktop
==> Validating source files with sha256sums...
    strongbox-7.5.0 ... Passed
    strongbox.desktop ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
==> Sources are ready.
==> Making package: strongbox 7.5.0-1 (Sat 14 Dec 2024 09:40:00 AM ACDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "strongbox"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding changelog file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: strongbox 7.5.0-1 (Sat 14 Dec 2024 09:40:07 AM ACDT)
==> Cleaning up...
loading packages...
resolving dependencies...
looking for conflicting packages...

Package (1)  New Version  Net Change

strongbox    7.5.0-1       46.01 MiB

Total Installed Size:  46.01 MiB

:: Proceed with installation? [Y/n] y
warning: no /var/cache/pacman/pkg/ cache exists, creating...
(1/1) checking keys in keyring                                     [------------------------------------] 100%
(1/1) checking package integrity                                   [------------------------------------] 100%
(1/1) loading package files                                        [------------------------------------] 100%
(1/1) checking for file conflicts                                  [------------------------------------] 100%
:: Processing package changes...
(1/1) installing strongbox                                         [------------------------------------] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating the desktop file MIME type cache...
[liveuser@eos-2024.09.22 ~]$ strongbox 
09:40:23.554 [warn] [app] configuration file not found:  /home/liveuser/.config/strongbox/config.json
09:40:24.801 [report] [app] refresh
09:40:25.630 [info] [app] downloading 'short' catalogue
09:40:26.290 [info] [app] loading 'short' catalogue.
09:40:26.440 [info] [app] 3608 addons in final catalogue.
09:40:26.524 [info] [app] downloading strongbox version data
^C

Installing java and running strongbox also doesn't affect anything:

[liveuser@eos-2024.09.22 ~]$ java -version
bash: java: command not found
[liveuser@eos-2024.09.22 ~]$ pacman -Qs jdk
[liveuser@eos-2024.09.22 ~]$ pacman -Qs jre
[liveuser@eos-2024.09.22 ~]$ sudo pacman -Sy
:: Synchronizing package databases...
 endeavouros                            15.0 KiB  12.0 KiB/s 00:01 [------------------------------------] 100%
 core                                  115.6 KiB  79.5 KiB/s 00:01 [------------------------------------] 100%
 extra                                   7.6 MiB  2.59 MiB/s 00:03 [------------------------------------] 100%
 multilib                              132.1 KiB   109 KiB/s 00:01 [------------------------------------] 100%
[liveuser@eos-2024.09.22 ~]$ sudo pacman -S jdk11-openjdk
resolving dependencies...
looking for conflicting packages...

Package (4)                    New Version   Net Change  Download Size

extra/java-environment-common  3-5             0.00 MiB               
extra/java-runtime-common      3-5             0.01 MiB               
extra/libnet                   2:1.3-1         1.47 MiB               
extra/jdk11-openjdk            11.0.25.u9-1  480.90 MiB     343.20 MiB

Total Download Size:   343.20 MiB
Total Installed Size:  482.37 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 jdk11-openjdk-11.0.25.u9-1-x86_64     343.2 MiB  12.0 MiB/s 00:29 [------------------------------------] 100%
(4/4) checking keys in keyring                                     [------------------------------------] 100%
(4/4) checking package integrity                                   [------------------------------------] 100%
(4/4) loading package files                                        [------------------------------------] 100%
(4/4) checking for file conflicts                                  [------------------------------------] 100%
:: Processing package changes...
(1/4) installing java-runtime-common                               [------------------------------------] 100%
For the complete set of Java binaries to be available in your PATH,
you need to re-login or source /etc/profile.d/jre.sh
Please note that this package does not support forcing JAVA_HOME as former package java-common did
(2/4) installing libnet                                            [------------------------------------] 100%
(3/4) installing java-environment-common                           [------------------------------------] 100%
(4/4) installing jdk11-openjdk                                     [------------------------------------] 100%
Optional dependencies for jdk11-openjdk
    java-rhino: for some JavaScript support
    alsa-lib: for basic sound support [installed]
    gtk3: for the Gtk+ 3 look and feel - desktop usage [installed]
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating icon theme caches...
(3/3) Updating the desktop file MIME type cache...
[liveuser@eos-2024.09.22 ~]$ strongbox 
09:50:19.160 [report] [app] refresh
09:50:20.017 [info] [app] loading 'short' catalogue.
09:50:20.163 [info] [app] 3608 addons in final catalogue.
^C
[liveuser@eos-2024.09.22 ~]$ 

Can I confirm which CPU architecture you're using? For example:

$ uname -m
x86_64

Have you tried running the .jar from the releases directly? If it is an architecture issue the .jar file may just work.

@FourRand0m
Copy link
Author

Running the standalone .jar works without a hitch.
I don't know where my system is borked, but I think I'll just run the .jar until I can figure out whats wrong with my configuration.
Thanks for all your help! I'll keep trying to fix it, but it doesn't seem to be a problem with Strongbox, so I'll close this issue.

@torkus
Copy link
Contributor

torkus commented Dec 14, 2024

Could you run this command and let me know what the output is?

uname -m

@FourRand0m
Copy link
Author

Of course.
Output is x86_64

@torkus
Copy link
Contributor

torkus commented Dec 14, 2024

hrm. well, I'm stumped. If I can't recreate it I can't fix it. If you ever figure it out yourself please let me know.

Thanks again for opening a ticket!

@torkus
Copy link
Contributor

torkus commented Dec 29, 2024

LD_LIBRARY_PATH to nothing

I did some more looking and there is a bug report here and here around the MangoHUD app that set the LD_LIBRARY_PATH for a short while before removing it.

reuseport_available is provided by /usr/lib/jvm/java-17-openjdk/lib/libnet.so. That lib is not in the LD_LIBRARY_PATH. Unfortunately the pkg libnet also provides /usr/lib/libnet.so, which is known to ld. Since we changed from rpath to runpath in binutils, binaries are now linked with runpath by default which has no precedence over LD_LIBRARY_PATH anymore.
Setting LD_LIBRARY_PATH causes ld to load /usr/lib/libnet.so which fails to have the needed symbols.

I've unset that environment variable within the AppImage to make Strongbox more compatible:
ogri-la/strongbox-appimage#1

However I still can't replicate it so if you could try this AppImage and let me know if it works for you I'd be grateful:

https://ogri.la/static/strongbox/releases/issue--440/strongbox.AppImage
https://ogri.la/static/strongbox/releases/issue--440/strongbox.AppImage.sha256

(You'll need to make it executable with chmod +x etc)

@FourRand0m
Copy link
Author

This AppImage works without issue. Starts up perfectly, can see all of my addons, etc etc.
No errors or anything. :) Thanks!

@torkus torkus added the fixed issue has been fixed but may not be released yet. label Dec 29, 2024
@torkus
Copy link
Contributor

torkus commented Dec 29, 2024

I'm glad to hear it, thanks for testing.

I'll do a proper release in the next few days with this fix in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working fixed issue has been fixed but may not be released yet.
Projects
None yet
Development

No branches or pull requests

2 participants