Quackster / Kepler

A server created in Java designed to revive Habbo Hotel v14 from the 2007 era.
GNU General Public License v3.0
230 stars 60 forks source link

V1.31 - Libsodium error #19

Closed Jordo-o closed 3 years ago

Jordo-o commented 3 years ago

When running the server from the precompiled jar in a Debian server, the following error occures on the server, when a users want to make a new account.

Netty error occurred: 
java.lang.UnsatisfiedLinkError: Unable to load library '/tmp/nativeutils1203363710640636/libsodium.so': Native library (tmp/nativeutils1203363710640636/libsodium.so) not found in resource path (kepler.jar).

Also a manual install of libsodium does not solve the problem. When a user wants to login, also an error will be raised:

Netty error occurred: 
java.lang.NoClassDefFoundError: Could not initialize class org.alexdev.kepler.dao.mysql.PlayerDao
Quackster commented 3 years ago

The problem is the mismatch somewhere on your install between 32-bit and 64-bit installation. I'm not sure where exactly, as it is your installation.

I've had this problem years ago, I just tried compiling it on a fresh VPS running Ubuntu 18.04 without trouble.

I used:

I'm sorry, you might have better luck recompiling it.

Jordo-o commented 3 years ago

Thanks for the reply! I rebuild the server with

Unfortunately, still the same error on register :( I hope that you can help me with the problem.

Quackster commented 3 years ago

Well I'm dumbfounded, there was a way to solve this but I literally cannot remember.

If you can wait, I can add an option to use a different type of password hashing.

Jordo-o commented 3 years ago

No hurry, I have the time! It's already very nice that want to look for a solution! :D

Quackster commented 3 years ago

Hello,

Can you check out v1.32 release? Delete your server.ini and then after its recreated, edit password.hashing.library from argon2 to bcrypt

https://github.com/Quackster/Kepler/releases/tag/v1.32

Please don't change it back to argon2 in future, otherwise no one will be able to login.

Jordo-o commented 3 years ago

I downloaded the pre-build version, and I rebuild the source again myself, but both give the same issue:

Error: Could not find or load main class org.alexdev.kepler.Kepler
Caused by: java.lang.ClassNotFoundException: org.alexdev.kepler.Kepler

Build using: Gradle 5.2.1 Kotlin DSL: 1.1.3 Kotlin: 1.3.20 Groovy: 2.5.4 Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018 JVM: 13.0.4 (Azul Systems, Inc. 13.0.4+8-MTS) OS: Linux 5.4.83-v8+ arm

Quackster commented 3 years ago

My apologies, can you try and build from source again? Also remember what I said about server.ini

I'll fix the compiled version soon.

Jordo-o commented 3 years ago

I cloned the master after your latest update and manage to compile it. But still the same error:

Error: Could not find or load main class org.alexdev.kepler.Kepler
Caused by: java.lang.ClassNotFoundException: org.alexdev.kepler.Kepler
emansom commented 3 years ago

How are you running Kepler specifically? In a container? What distro?

Unable to load library '/tmp/nativeutils1203363710640636/libsodium.so' That error compels me to think it's related to how that directory is mounted. It might not be allowed to execute programs from or open/write said directory.

Jordo-o commented 3 years ago

I am running Kepler on my raspberry pi 4B+ Linux raspberrypi 5.4.83-v8+ #1379 aarch64.

I cloned the repo into my etc folder with: git clone https://github.com/Quackster/Kepler.git

And run the command 'gradle fatJar' with the settings mentioned above. But the /tmp folder should be writable for every user.

emansom commented 3 years ago

What's the output of mount | grep '/tmp' and lsb_release -a?

Jordo-o commented 3 years ago

The output of mount | grep '/tmp', is nothing

the output of lsb_release -a, is

No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:    10
Codename:   buster
emansom commented 3 years ago

Try configuring a tmpfs in RAM and see if that changes things. Add following line to /etc/fstab: tmpfs /tmp tmpfs defaults,size=10M 0 0

Then execute sudo systemctl daemon-reload sudo systemctl restart local-fs.target

Jordo-o commented 3 years ago

I changed the settings according to @emansom his comment, and tested with the prebuild version 1.31 (because I could not build 1.32).

Unfortunately, I still have the same error:

ERROR [ErrorLogger] - Netty error occurred: 
java.lang.UnsatisfiedLinkError: Unable to load library '/tmp/nativeutils42354009545945/libsodium.so': Native library (tmp/nativeutils42354009545945/libsodium.so) not found in resource path (kepler.jar)

And an other question:

My apologies, can you try and build from source again? Also remember what I said about server.ini

I'll fix the compiled version soon.

@Quackster, did you already manage to fix the compiled version of V1.32? Maybe I can test that one with the changes I've made according to above information.

Quackster commented 3 years ago

The compiled version was fixed the same day as release. Anyways, as far as I'm concerned, there will have to be a special build for you to remove libsodium, but I am not going to do that.

Quackster commented 3 years ago

Add me on Discord my name is Quack#1337 and we can probably work something out.

Jordo-o commented 3 years ago

Add me on Discord my name is Quack#1337 and we can probably work something out.

Thank you! I'll search for you on discord!