games647 / FastLogin

Checks if a minecraft player has a valid paid account. If so, they can skip offline authentication automatically. (premium auto login)
https://www.spigotmc.org/resources/fastlogin.14153
MIT License
494 stars 121 forks source link

SQLite IllegalStateException: Current state = RESET, new state = FLUSHED #596

Closed Cubox closed 3 years ago

Cubox commented 3 years ago

What happened?

Upon login, after trying the plugin, I get the following Stack Trace The not whitelisted message does not matter here, I disabled it and tried again and same issue

What did you expect?

No response

Steps to reproduce

No response

Plugin list

AutoReplant, ChestSort, CreeperHeal2, DamageIndicator, DeadChest, dynmap, FastLogin, MendingEnchant, ProtocolSupport, RetainXP, ServerRestorer, SilenceMobs, UserLogin*, VeinMiner

Configuration file

The default one

Server log

[20:50:40 INFO]: [UserLogin] Running latest version! (v2.10.2)
[20:50:47 INFO]: [FastLogin] Handling player Cubox42
[20:50:49 ERROR]: Could not pass event PlayerLoginStartEvent to FastLogin v1.11-SNAPSHOT-4d4ecf3
java.lang.IllegalStateException: Current state = RESET, new state = FLUSHED
        at java.nio.charset.CharsetDecoder.throwIllegalStateException(CharsetDecoder.java:996) ~[?:?]
        at java.nio.charset.CharsetDecoder.flush(CharsetDecoder.java:679) ~[?:?]
        at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:808) ~[?:?]
        at java.nio.charset.Charset.decode(Charset.java:811) ~[?:?]
        at org.sqlite.core.NativeDB.utf8ByteBufferToString(NativeDB.java:507) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.core.NativeDB.column_name(NativeDB.java:239) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.core.DB.column_names(DB.java:733) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.core.CorePreparedStatement.<init>(CorePreparedStatement.java:46) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.jdbc3.JDBC3PreparedStatement.<init>(JDBC3PreparedStatement.java:30) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.jdbc4.JDBC4PreparedStatement.<init>(JDBC4PreparedStatement.java:25) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.jdbc4.JDBC4Connection.prepareStatement(JDBC4Connection.java:35) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:241) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:205) ~[patched_1.17.1.jar:git-Paper-165]
        at fastlogin.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337) ~[FastLoginBukkit.jar:?]
        at fastlogin.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[FastLoginBukkit.jar:?]
        at com.github.games647.fastlogin.core.AuthStorage.loadProfile(AuthStorage.java:163) ~[FastLoginBukkit.jar:?]
        at com.github.games647.fastlogin.core.shared.JoinManagement.onLogin(JoinManagement.java:55) ~[FastLoginBukkit.jar:?]
        at com.github.games647.fastlogin.bukkit.listener.protocolsupport.ProtocolSupportListener.onLoginStart(ProtocolSupportListener.java:80) ~[FastLoginBukkit.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor43.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.17.1.jar:git-Paper-165]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[patched_1.17.1.jar:git-Paper-165]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.1.jar:git-Paper-165]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.17.1.jar:git-Paper-165]
        at protocolsupport.protocol.packet.handler.AbstractLoginListener.lambda$handleLoginStart$5(AbstractLoginListener.java:130) ~[ProtocolSupport.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[?:?]
        at java.lang.Thread.run(Thread.java:831) [?:?]
[20:50:49 INFO]: UUID of player Cubox42 is 83a0d9d0-ccb0-3185-8efc-19e279e1b5a0
[20:50:51 INFO]: Disconnecting protocolsupport.zplatform.impl.spigot.SpigotWrappedGameProfile(name: Cubox42, originalName: Cubox42, uuid: 83a0d9d0-ccb0-3185-8efc-19e279e1b5a0, originalUUID: 83a0d9d0-ccb0-3185-8efc-19e279e1b5a0, onlinemode: false) (/77.131.243.208:54032): You are not whitelisted on this server!

Plugin version

1.11-SNAPSHOT-4d4ecf3

Platform

Spigot

Relevance

Cubox commented 3 years ago

I just tried without any mod enabled (except Fastlogin, userlogin and protocolsupport), same error

games647 commented 3 years ago

This could be an issue of the MySQL driver embedded into the server.

games647 commented 3 years ago

I'll look into it.

Cubox commented 3 years ago

Hi,

Thanks for the commit, however I still have the issue.

[18:09:58 INFO]: protocolsupport.protocol.utils.authlib.LoginProfile(name: Cubox42, originalName: Cubox42, uuid: , onlinemode: false) (/) lost connection: 
[18:09:59 INFO]: [UserLogin] Running latest version! (v2.10.2)
[18:10:05 INFO]: [FastLogin] Handling player Cubox42 
[18:10:05 ERROR]: Could not pass event PlayerLoginStartEvent to FastLogin v1.11-SNAPSHOT-4d4ecf3  java.lang.IllegalStateException: Current state = RESET, new state = FLUSHED
 at java.nio.charset.CharsetDecoder.throwIllegalStateException(CharsetDecoder.java:996) ~[?:?]
        at java.nio.charset.CharsetDecoder.flush(CharsetDecoder.java:679) ~[?:?] 
 at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:808) ~[?:?] 
 at java.nio.charset.Charset.decode(Charset.java:811) ~[?:?]
at org.sqlite.core.NativeDB.utf8ByteBufferToString(NativeDB.java:507) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.core.NativeDB.column_name(NativeDB.java:239) ~[patched_1.17.1.jar:git-Paper-165]
 at org.sqlite.core.DB.column_names(DB.java:733) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.jdbc3.JDBC3Statement.getResultSet(JDBC3Statement.java:131) ~[patched_1.17.1.jar:git-Paper-165]
        at org.sqlite.jdbc3.JDBC3PreparedStatement.executeQuery(JDBC3PreparedStatement.java:82) ~[patched_1.17.1.jar:git-Paper-165]
        at fastlogin.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[FastLoginBukkit(2).jar:?]
        at fastlogin.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[FastLoginBukkit(2).jar:?]
        at com.github.games647.fastlogin.core.AuthStorage.loadProfile(AuthStorage.java:167) ~[FastLoginBukkit(2).jar:?]
        at com.github.games647.fastlogin.core.shared.JoinManagement.onLogin(JoinManagement.java:55) ~[FastLoginBukkit(2).jar:?]
        at com.github.games647.fastlogin.bukkit.listener.protocolsupport.ProtocolSupportListener.onLoginStart(ProtocolSupportListener.java:80) ~[FastLoginBukkit(2).jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor9.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.17.1.jar:git-Paper-165]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[patched_1.17.1.jar:git-Paper-165]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.1.jar:git-Paper-165]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.17.1.jar:git-Paper-165]
        at protocolsupport.protocol.packet.handler.AbstractLoginListener.lambda$handleLoginStart$5(AbstractLoginListener.java:130) ~[ProtocolSupport.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[?:?]
        at java.lang.Thread.run(Thread.java:831) [?:?]  [18:10:05 INFO]: UUID of player Cubox42 is9e1b5a0 [18:10:07 INFO]: Cubox42[/] logged in with entity id 294 at ([world]-80.0, 64.0, -192.0)
[18:10:08 INFO]: [FastLogin] No on-going login session for player: CraftPlayer{name=Cubox42} with ID
[18:10:30 INFO]: Cubox42 lost connection: Disconnected [18:10:30 INFO]: Cubox42 left the game

Also, I tried again shortly after and got this:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x0000000802a48d1a, pid=87920, tid=862296
#
# JRE version: OpenJDK Runtime Environment (16.0.1+9) (build 16.0.1+9-1)
# Java VM: OpenJDK 64-Bit Server VM (16.0.1+9-1, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g># Problematic frame:
# V  [libjvm.so+0xc48d1a]  JVM_RaiseSignal+0x15404a
#
# Core dump will be written. Default location: /usr/home/cubox/minecraft_test/java.core
#
# If you would like to submit a bug report, please visit:
#   https://bugs.freebsd.org/bugzilla/enter_bug.cgi?product=Ports%20%26%20Packages&component=Individual%20Port(s)&short>#

---------------  S U M M A R Y ------------

Command Line: -Xms512M -Xmx4096M paper-1.17.1.jar

Host: Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz amd64, 8 cores, 31G, FreeBSD 13.0-STABLE
Time: Sat Aug 14 18:05:48 2021 CEST elapsed time: 198.503051 seconds (0d 0h 3m 18s)

---------------  T H R E A D  ---------------

Current thread (0x000000080320cc00):  JavaThread "LoginProcessingThread" daemon [_thread_in_vm, id=862296, stack(0x0000>

Stack: [0x00007fffda783000,0x00007fffda883000],  sp=0x00007fffda881c40,  free space=1019k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xc48d1a]  JVM_RaiseSignal+0x15404a
V  [libjvm.so+0xc49f73]  JVM_RaiseSignal+0x1552a3
V  [libjvm.so+0xa3a6cd]  AsyncGetCallTrace+0x1058dd
V  [libjvm.so+0xa3ad15]  AsyncGetCallTrace+0x105f25
j  sun.nio.cs.UTF_8$Decoder.decodeBufferLoop(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;)Ljava/nio/charset/CoderResult;+>J 15493 c1 sun.nio.cs.UTF_8$Decoder.decodeLoop(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;)Ljava/nio/charset/CoderResult>J 15441 c1 java.nio.charset.CharsetDecoder.decode(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;Z)Ljava/nio/charset/CoderRe>j  java.nio.charset.CharsetDecoder.decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;+46 java.base@16.0.1
j  java.nio.charset.Charset.decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;+17 java.base@16.0.1
j  org.sqlite.core.NativeDB.utf8ByteBufferToString(Ljava/nio/ByteBuffer;)Ljava/lang/String;+12
j  org.sqlite.core.NativeDB.column_name(JI)Ljava/lang/String;+6
j  org.sqlite.core.DB.column_names(J)[Ljava/lang/String;+26
j  org.sqlite.jdbc3.JDBC3Statement.getResultSet()Ljava/sql/ResultSet;+64
j  org.sqlite.jdbc3.JDBC3PreparedStatement.executeQuery()Ljava/sql/ResultSet;+129
j  fastlogin.hikari.pool.ProxyPreparedStatement.executeQuery()Ljava/sql/ResultSet;+14
j  fastlogin.hikari.pool.HikariProxyPreparedStatement.executeQuery()Ljava/sql/ResultSet;+1
j  com.github.games647.fastlogin.core.AuthStorage.loadProfile(Ljava/lang/String;)Lcom/github/games647/fastlogin/core/St>j  com.github.games647.fastlogin.core.shared.JoinManagement.onLogin(Ljava/lang/String;Lcom/github/games647/fastlogin/co>j  com.github.games647.fastlogin.bukkit.listener.protocolsupport.ProtocolSupportListener.onLoginStart(Lprotocolsupport/>j  com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor43.execute(Lorg/bukkit/event/Listener;Lor>j  org.bukkit.plugin.EventExecutor.lambda$create$1(Ljava/lang/Class;Lorg/bukkit/plugin/EventExecutor;Lorg/bukkit/event/>j  org.bukkit.plugin.EventExecutor$$Lambda$4758+0x000000082ae82808.execute(Lorg/bukkit/event/Listener;Lorg/bukkit/event>j  co.aikar.timings.TimedEventExecutor.execute(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Event;)V+25
j  org.bukkit.plugin.RegisteredListener.callEvent(Lorg/bukkit/event/Event;)V+36
j  org.bukkit.plugin.SimplePluginManager.callEvent(Lorg/bukkit/event/Event;)V+138
j  protocolsupport.protocol.packet.handler.AbstractLoginListener.lambda$handleLoginStart$5(Ljava/lang/String;)V+29
j  protocolsupport.protocol.packet.handler.AbstractLoginListener$$Lambda$5874+0x000000082b411be0.run()V+8
j  java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+92 java.base@16>j  java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5 java.base@16.0.1
j  java.lang.Thread.run()V+11 java.base@16.0.1
v  ~StubRoutines::call_stub
V  [libjvm.so+0xa40aa2]  AsyncGetCallTrace+0x10bcb2
V  [libjvm.so+0xa3fda6]  AsyncGetCallTrace+0x10afb6
V  [libjvm.so+0xa3fe62]  AsyncGetCallTrace+0x10b072
V  [libjvm.so+0xae5ec4]  JVM_StartThread+0x384
V  [libjvm.so+0xf78210]  JVM_handle_bsd_signal+0xba940
V  [libjvm.so+0xf75dc1]  JVM_handle_bsd_signal+0xb84f1
V  [libjvm.so+0xda9cb7]  JVM_RaiseSignal+0x2b4fe7
C  [libthr.so.3+0x10899]  operator->+0x8c9

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.nio.cs.UTF_8$Decoder.decodeBufferLoop(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;)Ljava/nio/charset/CoderResult;+>J 15493 c1 sun.nio.cs.UTF_8$Decoder.decodeLoop(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;)Ljava/nio/charset/CoderResult>J 15441 c1 java.nio.charset.CharsetDecoder.decode(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;Z)Ljava/nio/charset/CoderRe>j  java.nio.charset.CharsetDecoder.decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;+46 java.base@16.0.1
j  java.nio.charset.Charset.decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;+17 java.base@16.0.1
j  org.sqlite.core.NativeDB.utf8ByteBufferToString(Ljava/nio/ByteBuffer;)Ljava/lang/String;+12
j  org.sqlite.core.NativeDB.column_name(JI)Ljava/lang/String;+6
j  org.sqlite.core.DB.column_names(J)[Ljava/lang/String;+26
j  org.sqlite.jdbc3.JDBC3Statement.getResultSet()Ljava/sql/ResultSet;+64
j  org.sqlite.jdbc3.JDBC3PreparedStatement.executeQuery()Ljava/sql/ResultSet;+129
j  fastlogin.hikari.pool.ProxyPreparedStatement.executeQuery()Ljava/sql/ResultSet;+14
j  fastlogin.hikari.pool.HikariProxyPreparedStatement.executeQuery()Ljava/sql/ResultSet;+1
j  com.github.games647.fastlogin.core.AuthStorage.loadProfile(Ljava/lang/String;)Lcom/github/games647/fastlogin/core/St>j  com.github.games647.fastlogin.core.shared.JoinManagement.onLogin(Ljava/lang/String;Lcom/github/games647/fastlogin/co>j  com.github.games647.fastlogin.bukkit.listener.protocolsupport.ProtocolSupportListener.onLoginStart(Lprotocolsupport/>j  com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor43.execute(Lorg/bukkit/event/Listener;Lor>j  org.bukkit.plugin.EventExecutor.lambda$create$1(Ljava/lang/Class;Lorg/bukkit/plugin/EventExecutor;Lorg/bukkit/event/>j  org.bukkit.plugin.EventExecutor$$Lambda$4758+0x000000082ae82808.execute(Lorg/bukkit/event/Listener;Lorg/bukkit/event>j  co.aikar.timings.TimedEventExecutor.execute(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Event;)V+25
j  org.bukkit.plugin.RegisteredListener.callEvent(Lorg/bukkit/event/Event;)V+36
j  org.bukkit.plugin.SimplePluginManager.callEvent(Lorg/bukkit/event/Event;)V+138
j  protocolsupport.protocol.packet.handler.AbstractLoginListener.lambda$handleLoginStart$5(Ljava/lang/String;)V+29
j  protocolsupport.protocol.packet.handler.AbstractLoginListener$$Lambda$5874+0x000000082b411be0.run()V+8
j  java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+92 java.base@16>j  java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5 java.base@16.0.1
j  java.lang.Thread.run()V+11 java.base@16.0.1
v  ~StubRoutines::call_stub

I think the root issue lies deeper, something is making the charset decoder not happy at all.

I'm happy to give you more details as needed, let me know.

games647 commented 3 years ago

Okay this more like a runtime issue. Especially the last part with a core dump. The SQLite driver was updated in January (https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/fa6d549d9006e62452fddb36b295f9e95a00efac), I kinda doubt this related to the driver. Maybe it's your java version. I found tickets that indicate this related to the BSD build. It's not reproducible with other Linux.

https://github.com/pop4959/LWCX/issues/157 https://github.com/BLuFeNiX/TeleportationRunes/issues/7#issuecomment-874494382

Could you try another Java runtime and report it upstream if it's related to it?

Cubox commented 3 years ago

Thanks for finding that out, knowing little about java I assumed all jvm implementations would behave the same. There is not really another runtime I can use...

Unless there is a quick fix to be made in FastLogin's code to avoid that crash, no hope for me.

games647 commented 3 years ago

java I assumed all jvm implementations would behave the same.

Java implementations could sometimes differ a lot. That's why we have so many GraalVM, OpenJDK, OracleJDK, AdoptJDK, etc. However what could also be an issue is how the software is build, so what libraries were used.

There is not really another runtime I can use...

You could use the Linux version through the compatibility layer, but I don't have any experiences how stable that is. You could report it, so they could fix it.

Cubox commented 3 years ago

I tried to use the Linux version in a jail, the JVM crashes even without any plugin. I'll see if other versions of the JVM are even available on FreeBSD

I'll report it to FreeBSD yeah. But a possible fix is gonna take some time

ver151set commented 2 years ago

Hi, has anyone found a solution for this?

Running into this issue after updating to openjdk 16 for 1.17 on a truenas server