DiscordSRV

DiscordSRV

86.8k Downloads

Error when MC chat message contains a @ping: Cannot get reference as it has already been Garbage Collected

RalphORama opened this issue ยท 1 comments

commented

The issue

I noticed messages with @pings weren't being sent from Minecraft chat to Discord:

image
Fig 1: Minecraft chat

image
Fig 2: Discord chat

Restarting the server fixed this, but I'm reporting it since it may arise again in the future and I don't like restarting the server outside of scheduled restarts.

The error

java.lang.IllegalStateException: Cannot get reference as it has already been Garbage Collected
at github.scarsz.discordsrv.dependencies.jda.internal.utils.cache.UpstreamReference.get(UpstreamReference.java:41) ~[?:?]
at github.scarsz.discordsrv.dependencies.jda.internal.entities.MemberImpl.getGuild(MemberImpl.java:75) ~[?:?]
at github.scarsz.discordsrv.dependencies.jda.internal.entities.MemberImpl.getGuild(MemberImpl.java:39) ~[?:?]
at github.scarsz.discordsrv.dependencies.jda.internal.entities.MemberImpl.equals(MemberImpl.java:321) ~[?:?]
at java.util.HashMap.computeIfAbsent(HashMap.java:1114) ~[?:1.8.0_212]
at github.scarsz.discordsrv.util.DiscordUtil.convertMentionsFromNames(DiscordUtil.java:94) ~[?:?]
at github.scarsz.discordsrv.DiscordSRV.processChatMessage(DiscordSRV.java:918) ~[?:?]
at github.scarsz.discordsrv.listeners.PlayerChatListener.lambda$onAsyncPlayerChat$0(PlayerChatListener.java:33) ~[?:?]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.15.2.jar:git-Paper-135]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.15.2.jar:git-Paper-135]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.15.2.jar:git-Paper-135]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212] 

Server info

Version: Paper version git-Paper-135 (MC: 1.15.2)
Startup options:

java -Xms4096M -Xmx4096M \
    -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 \
    -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 \
    -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 \
    -XX:+ParallelRefProcEnabled \
    -Dterminal.jline=false -Dterminal.ansi=true \
    -jar papermc.jar

Plugins: Chunkmaster, CoreProtect, DiscordSRV, Essentials, EssentialsChat, EssentialsGeoIP, EssentialsProtect, EssentialsSpawn, FastLeafDecay, GameModeInventories, HiddenLorax, LimitPillagers, LuckPerms, Matrix, mcMMO, Plan, ProtocolLib, SAML, SelectionVisualizer, ServerListPlus*, TimeControl, Vault, ViaBackwards, ViaVersion, VillagerOptimiser, WorldEdit, WorldGuard

DiscordSRV Config: https://pastebin.com/4s3Ujvna

commented

Already fixed in dev builds