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

java.lang.UnsatisfiedLinkError: /tmp/librocksdbjni17844983601921261821.so: /tmp/librocksdbjni17844983601921261821.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64 .so on a AARCH64 platform) #12779

Closed
suddendust opened this issue Jun 18, 2024 · 4 comments

Comments

@suddendust
Copy link

I am trying to port my application to linux/aarch64 (AWS Graviton) and getting the following exception:

java.lang.UnsatisfiedLinkError: /tmp/librocksdbjni17844983601921261821.so: /tmp/librocksdbjni17844983601921261821.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64 .so on a AARCH64 platform)
	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
	at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2418)
--
	at org.apache.helix.messaging.handling.HelixTask.call(HelixTask.java:49) ~[helix-core-1.3.1.jar:1.3.1]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]

I am using rocksdbjni version 8.3.2. In the unzipped jar, I see that we do have this artifact librocksdbjni-linux-aarch64.so.

Expected behavior

This exception should not occur since we have the artifact required for linux/aarch64.

Actual behavior

The exception above.

Steps to reproduce the behavior

Build https://github.com/apache/pinot on an linux/aarch64 system using the command: mvn clean install -Dcheckstyle.skip -Dlicense.skip -Dos.arch=aarch_64 -Pbin-dist -U -fn

@adamretter
Copy link
Collaborator

What do the following Java properties return on your system?

  1. System.getProperty("os.name")
  2. System.getProperty("os.arch")
  3. System.getenv("ROCKSDB_MUSL_LIBC")

You can see how the native library is selected here -https://github.com/facebook/rocksdb/blob/main/java/src/main/java/org/rocksdb/util/Environment.java#L229

@suddendust
Copy link
Author

@adamretter Thanks for the response. Here's the result of what you requested:

System.getProperty("os.name"): Linux
System.getProperty("os.arch"): aarch64
System.getenv("ROCKSDB_MUSL_LIBC"): null

@adamretter
Copy link
Collaborator

@suddendust Okay that all looks good so far. We need to exclude Apache pinot here. Can you provide a minimal reproducible test-case using just RocksJava please?

@suddendust
Copy link
Author

@adamretter This is solved. I was mistakenly overrides os.arch to aarch_64 instead of aarch64 and this was messing things up 🤦 I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants