Lauriethefish / BetterPortals

My plugin version of the popular BetterPortals mod which has many limitations, but requires no client side code
zlib License
68 stars 35 forks source link

Random Crash with Cross Server Portals #148

Open tk4096 opened 2 years ago

tk4096 commented 2 years ago

Describe the bug The plugin crashes upon attempting to render certain cross server portals. It is believed to be due to a failure of the proxy to send the blocks around the destination portal. Lines 61-68 of ExternalBlockDataFetcher.java are believed to be involved.

To Reproduce 1) Create a cross-server portal 2) ????? 3) Approach portal

Server Logs

logs of crash in origin world:

[00:13:11 INFO]: Avad__ left the game
[00:13:11 INFO]: [BetterPortals] [FNR] Portal was deactivated
[00:13:11 INFO]: [BetterPortals] [FNR] Clearing block array to save memory
[00:13:11 INFO]: [BetterPortals] [FNR] Processing request of type: com.lauriethefish.betterportals.shared.net.requests.RelayRequest
[00:13:11 INFO]: [BetterPortals] [FNR] Processing request of type: com.lauriethefish.betterportals.bukkit.net.requests.GetSelectionRequest
[00:13:11 INFO]: [BetterPortals] [FNE] Returning selection null
[00:13:36 INFO]: UUID of player Avad__ is 85ab2af8-e6cc-478b-ab7f-283368bde8fd
[00:13:36 INFO]: [BetterPortals] [FNR] Processing request of type: com.lauriethefish.betterportals.shared.net.requests.PreviousServerPutRequest
[00:13:36 INFO]: [BetterPortals] [FNE] Previous server: backrooms
[00:13:36 INFO]: [BetterPortals] [FNE] Registering player data on join for player: 85ab2af8-e6cc-478b-ab7f-283368bde8fd
[00:13:36 INFO]: [BetterPortals] [FNE] Restoring selection on join
[00:13:36 INFO]: Avad__ joined the game
[00:13:36 INFO]: Avad__[/141.156.242.119:3202] logged in with entity id 515 at ([world]-1130.5353410715077, 65.6414734540739, 1398.8968834473678)
[00:13:36 INFO]: [BetterPortals] [FNR] Portal was activated
[00:13:36 INFO]: [BetterPortals] [FNR] Portal now being viewed by player 85ab2af8-e6cc-478b-ab7f-283368bde8fd
[00:13:36 INFO]: [BetterPortals] [FNE] Not updating portal, data was not yet been fetched
[00:13:36 INFO]: [BetterPortals] [FNE] Init not finished
[00:13:37 INFO]: [BetterPortals] [FNE] Still awaiting block data response
[00:13:37 INFO]: [BetterPortals] [FNE] Not updating portal, data was not yet been fetched
[00:13:37 INFO]: [BetterPortals] [FNR] Received response to get block data request
[00:13:37 INFO]: [BetterPortals] [FNE] Selection info: com.lauriethefish.betterportals.bukkit.net.requests.GetSelectionRequest$ExternalSelectionInfo@7110835e
[00:13:37 INFO]: [BetterPortals] [FNE] Directly setting external selection for player with ID 85ab2af8-e6cc-478b-ab7f-283368bde8fd
[00:13:38 ERROR]: [BetterPortals] A critical error occurred during plugin execution.
[00:13:38 ERROR]: [BetterPortals] Please create an issue at https://github.com/Lauriethefish/BetterPortals/issues to get this fixed.
[00:13:38 WARN]: java.lang.NullPointerException: Cannot invoke "org.bukkit.block.data.BlockData.getMaterial()" because "destData" is null
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.block.bukkit.BukkitBlockMap.searchFromBlock(BukkitBlockMap.java:106)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.block.FloodFillBlockMap.updateInternal(FloodFillBlockMap.java:113)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.block.bukkit.BukkitBlockMap.updateInternal(BukkitBlockMap.java:314)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.block.FloodFillBlockMap.update(FloodFillBlockMap.java:102)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.portal.Portal.onViewUpdate(Portal.java:88)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.portal.PortalActivityManager.onPortalViewedThisTick(PortalActivityManager.java:51)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.player.PlayerData.updatePortalViews(PlayerData.java:77)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.player.PlayerData.onUpdate(PlayerData.java:111)
[00:13:38 WARN]:        at java.base/java.util.HashMap$Values.forEach(HashMap.java:1065)
[00:13:38 WARN]:        at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1092)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.tasks.MainUpdate.run(MainUpdate.java:47)
[00:13:38 WARN]:        at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftTask.run(CraftTask.java:101)
[00:13:38 WARN]:        at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
[00:13:38 WARN]:        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1532)
[00:13:38 WARN]:        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:483)
[00:13:38 WARN]:        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1456)
[00:13:38 WARN]:        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1226)
[00:13:38 WARN]:        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316)
[00:13:38 WARN]:        at java.base/java.lang.Thread.run(Thread.java:833)
[00:13:38 INFO]: [BetterPortals] Attempting to shut down the plugin . . .
[00:13:38 INFO]: [BetterPortals] Disabling BetterPortals v0.11.1
[00:13:38 INFO]: [BetterPortals] [FNR] Checking deactivation type of portal view, previous pos: (-1130.54, 65.64, 1398.90, world), current pos: (-1130.54, 65.64, 1398.90, world)
[00:13:38 INFO]: [BetterPortals] [FNR] Player block view deactivating. Should reset states: true
[00:13:38 INFO]: [BetterPortals] [FNR] No states to reset!
[00:13:38 INFO]: [BetterPortals] [FNE] Goodbye from block view update thread!
[00:13:38 INFO]: [BetterPortals] [FNE] Saving all portals . . .
[00:13:38 INFO]: [BetterPortals] [FNE] Saved 19 portals
[00:13:38 INFO]: [BetterPortals] [FNE] Saving to plugins/BetterPortals/data/portals.yml
[00:13:38 INFO]: [BetterPortals] Disconnecting from the proxy
[00:13:38 INFO]: [BetterPortals] [FNR] Received response to get block data request
[00:13:38 WARN]: [BetterPortals] Failed to fetch block changes for external portal: 
[00:13:38 WARN]: com.lauriethefish.betterportals.shared.net.RequestException: Disconnected from proxy while sending the request
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.net.PortalClient.disconnect(PortalClient.java:257)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.net.PortalClient.shutDown(PortalClient.java:211)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.BetterPortals.onDisable(BetterPortals.java:167)
[00:13:38 WARN]:        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266)
[00:13:38 WARN]:        at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:399)
[00:13:38 WARN]:        at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:578)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.CrashHandler.shutdownPlugin(CrashHandler.java:28)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.CrashHandler.processCriticalError(CrashHandler.java:23)
[00:13:38 WARN]:        at BetterPortals-0.11.1.jar//com.lauriethefish.betterportals.bukkit.tasks.MainUpdate.run(MainUpdate.java:62)
[00:13:38 WARN]:        at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftTask.run(CraftTask.java:101)
[00:13:38 WARN]:        at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
[00:13:38 WARN]:        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1532)
[00:13:38 WARN]:        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:483)
[00:13:38 WARN]:        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1456)
[00:13:38 WARN]:        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1226)
[00:13:38 WARN]:        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316)
[00:13:38 WARN]:        at java.base/java.lang.Thread.run(Thread.java:833)
[00:13:38 INFO]: [BetterPortals] [FNE] Goodbye!

error in bungeecord proxy as a consequence of crash:

[00:13:38 WARN] [BetterPortals]: IO Error occurred while sending a response to a request
[00:13:38 ERROR]: java.net.SocketException: Socket closed
[00:13:38 ERROR]:       at java.base/sun.nio.ch.NioSocketImpl.ensureOpenAndConnected(NioSocketImpl.java:165)
[00:13:38 ERROR]:       at java.base/sun.nio.ch.NioSocketImpl.beginWrite(NioSocketImpl.java:366)
[00:13:38 ERROR]:       at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:411)
[00:13:38 ERROR]:       at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
[00:13:38 ERROR]:       at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:826)
[00:13:38 ERROR]:       at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1035)
[00:13:38 ERROR]:       at java.base/java.io.DataOutputStream.writeInt(DataOutputStream.java:208)
[00:13:38 ERROR]:       at com.lauriethefish.betterportals.shared.net.encryption.EncryptedObjectStream.writeObject(EncryptedObjectStream.java:63)
[00:13:38 ERROR]:       at com.lauriethefish.betterportals.proxy.net.ClientHandler.send(ClientHandler.java:226)
[00:13:38 ERROR]:       at com.lauriethefish.betterportals.proxy.net.ClientHandler.lambda$processRequest$1(ClientHandler.java:167)
[00:13:38 ERROR]:       at com.lauriethefish.betterportals.proxy.net.ClientHandler.processResponse(ClientHandler.java:186)
[00:13:38 ERROR]:       at com.lauriethefish.betterportals.proxy.net.ClientHandler.run(ClientHandler.java:150)
[00:13:38 ERROR]:       at com.lauriethefish.betterportals.proxy.net.ClientHandler.lambda$new$0(ClientHandler.java:54)
[00:13:38 ERROR]:       at java.base/java.lang.Thread.run(Thread.java:833)

Additional context Plugin Version: 0.11.1 Game Version: 1.18.2 paper build 386

patritha commented 1 year ago

any fixes yet