kyngs / LibreLogin

Open-source, multiplatform, and highly customizable authentication plugin with outstanding features and API.
Mozilla Public License 2.0
165 stars 53 forks source link

Error(s) when moving premium users #222

Closed Sharedlines closed 6 months ago

Sharedlines commented 6 months ago

Expected behavior: Registered premium users should be able to move to the main server once automatically logged in.

Actual behavior: Premium users get stuck in the authentication server

Platform: Velocity, latest version, with auto register and login for premium users enabled Error shown:

[00:35:57 ERROR]: Couldn't pass PlayerChooseInitialServerEvent to librelogin java.lang.NullPointerException: Cannot invoke "xyz.kyngs.librelogin.api.database.User.autoLoginEnabled()" because "user" is null at xyz.kyngs.librelogin.common.listener.AuthenticListeners.chooseServer(AuthenticListeners.java:276) ~[?:?] at xyz.kyngs.librelogin.velocity.VelocityListeners.chooseServer(VelocityListeners.java:150) ~[?:?] at xyz.kyngs.librelogin.velocity.Lmbda$38.execute(Unknown Source) ~[?:?] at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:56) ~[velocity.jar:3.3.0-SNAPSHOT (git-408b420a-b316)] at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:597) ~[velocity.jar:3.3.0-SNAPSHOT (git-408b420a-b316)] at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:478) ~[velocity.jar:3.3.0-SNAPSHOT (git-408b420a-b316)] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:840) [?:?]

Something to note is that the user managed to get unstuck and enter the main server after leaving and rejoining for around 10-15 minutes, and when this happened their username also re-appeared in the user-data.db file. Due to the inconsistency of this error, I haven't been able to replicate it myself, however it has happened twice now on my server.

kyngs commented 6 months ago

Can you try switching to MySQL?

Sharedlines commented 6 months ago

Does this require me to convert anything, or can i just change it in config?

kyngs commented 6 months ago

Does this require me to convert anything, or can i just change it in config?

You need to extract the data from SQLite and put them into MySQL

Sharedlines commented 6 months ago

After doing this i haven't encountered the issue since, although it was already pretty random. ill just ask in the discord if it happens again.