cpburnz / minecraft-prometheus-exporter

Prometheus exporter for Minecraft.
MIT License
44 stars 8 forks source link

ERROR in server log crashing due to can not initialize HTTPServer #22

Closed Kr3n3r closed 2 months ago

Kr3n3r commented 2 months ago

Log: ` [05:53:56] [Server thread/ERROR] [ne.mi.ev.EventBus/EVENTBUS]: Exception caught during firing event: Cannot invoke "com.github.cpburnz.minecraft_prometheus_exporter.vendors.io.prometheus.client.exporter.HTTPServer.close()" because "this.http_server" is null Index: 7 Listeners: 0: HIGH 1: ASM: class dev.architectury.event.forge.EventHandlerImplCommon event(Lnet/minecraftforge/event/server/ServerStoppedEvent;)V 2: NORMAL 3: net.minecraftforge.eventbus.EventBus$$Lambda/0x000000010076ab08@3407db8d 4: ASM: class dev.shadowsoffire.placebo.util.PlaceboTaskQueue stopped(Lnet/minecraftforge/event/server/ServerStoppedEvent;)V 5: ASM: class com.lion.graveyard.platform.forge.HordeSpawner onServerStopped(Lnet/minecraftforge/event/server/ServerStoppedEvent;)V 6: ASM: class mcp.mobius.waila.forge.ForgeWaila$Subscriber serverStopped(Lnet/minecraftforge/event/server/ServerStoppedEvent;)V 7: ASM: com.github.cpburnz.minecraft_prometheus_exporter.PrometheusExporterMod@909d3e4 onServerStopped(Lnet/minecraftforge/event/server/ServerStoppedEvent;)V 8: net.minecraftforge.eventbus.EventBus$$Lambda/0x000000010076ab08@309856b4 9: LOWEST 10: ASM: org.embeddedt.modernfix.forge.init.ModernFixForge@e026e19 onServerDead(Lnet/minecraftforge/event/server/ServerStoppedEvent;)V java.lang.NullPointerException: Cannot invoke "com.github.cpburnz.minecraft_prometheus_exporter.vendors.io.prometheus.client.exporter.HTTPServer.close()" because "this.http_server" is null at TRANSFORMER/prometheus_exporter@1.0.0/com.github.cpburnz.minecraft_prometheus_exporter.PrometheusExporterMod.closeHttpServer(PrometheusExporterMod.java:87) at TRANSFORMER/prometheus_exporter@1.0.0/com.github.cpburnz.minecraft_prometheus_exporter.PrometheusExporterMod.onServerStopped(PrometheusExporterMod.java:177) at TRANSFORMER/prometheus_exporter@1.0.0/com.github.cpburnz.minecraft_prometheus_exporter.__PrometheusExporterMod_onServerStopped_ServerStoppedEvent.invoke(.dynamic) at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) at TRANSFORMER/forge@47.1.0/net.minecraftforge.server.ServerLifecycleHooks.handleServerStopped(ServerLifecycleHooks.java:134) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m130011(MinecraftServer.java:697) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m206580(MinecraftServer.java:251) at java.base/java.lang.Thread.run(Unknown Source)

[05:53:56] [Server thread/ERROR] [minecraft/MinecraftServer]: Uncaught exception in server thread java.lang.NullPointerException: Cannot invoke "com.github.cpburnz.minecraft_prometheus_exporter.vendors.io.prometheus.client.exporter.HTTPServer.close()" because "this.http_server" is null at com.github.cpburnz.minecraft_prometheus_exporter.PrometheusExporterMod.closeHttpServer(PrometheusExporterMod.java:87) ~[Prometheus-Exporter-1.20.1-forge-1.0.0.jar%23234!/:1.0.0] {re:classloading} at com.github.cpburnz.minecraft_prometheus_exporter.PrometheusExporterMod.onServerStopped(PrometheusExporterMod.java:177) ~[Prometheus-Exporter-1.20.1-forge-1.0.0.jar%23234!/:1.0.0] {re:classloading} at com.github.cpburnz.minecraft_prometheus_exporter.__PrometheusExporterMod_onServerStopped_ServerStoppedEvent.invoke(.dynamic) ~[Prometheus-Exporter-1.20.1-forge-1.0.0.jar%23234!/:1.0.0] {re:classloading,pl:eventbus:B} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2352!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2352!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2352!/:?] {} at net.minecraftforge.server.ServerLifecycleHooks.handleServerStopped(ServerLifecycleHooks.java:134) ~[forge-1.20.1-47.1.0-universal.jar%23260!/:?] {re:classloading} at net.minecraft.server.MinecraftServer.m130011(MinecraftServer.java:697) ~[server-1.20.1-20230612.114412-srg.jar%23255!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.dedicated_reload_executor.MinecraftServerMixin,pl:mixin:APP:modernfix-common.mixins.json:core.MinecraftServerMixin,pl:mixin:APP:mcpitanlib-common.mixins.json:MinecraftServerTimer,pl:mixin:APP:majruszlibrary-common.mixins.json:MixinMinecraftServer,pl:mixin:A} at net.minecraft.server.MinecraftServer.m206580(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23255!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.dedicated_reload_executor.MinecraftServerMixin,pl:mixin:APP:modernfix-common.mixins.json:core.MinecraftServerMixin,pl:mixin:APP:mcpitanlib-common.mixins.json:MinecraftServerTimer,pl:mixin:APP:majruszlibrary-common.mixins.json:MixinMinecraftServer,pl:mixin:A} at java.lang.Thread.run(Unknown Source) ~[?:?] {re:mixin} java.util.concurrent.RejectedExecutionException: Server already shutting down at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m201446(MinecraftServer.java:1279) at TRANSFORMER/spark@1.10.53/me.lucko.spark.forge.plugin.ForgeServerSparkPlugin.executeSync(ForgeServerSparkPlugin.java:222) at java.base/java.util.concurrent.CompletableFuture.asyncSupplyStage(Unknown Source) at java.base/java.util.concurrent.CompletableFuture.supplyAsync(Unknown Source) at TRANSFORMER/spark@1.10.53/me.lucko.spark.common.platform.world.AsyncWorldInfoProvider.async(AsyncWorldInfoProvider.java:54) at TRANSFORMER/spark@1.10.53/me.lucko.spark.common.platform.world.AsyncWorldInfoProvider.pollCounts(AsyncWorldInfoProvider.java:76) at TRANSFORMER/spark@1.10.53/me.lucko.spark.common.platform.world.AsyncWorldInfoProvider.getCounts(AsyncWorldInfoProvider.java:84) at TRANSFORMER/spark@1.10.53/me.lucko.spark.common.sampler.window.WindowStatisticsCollector.measure(WindowStatisticsCollector.java:185) at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source) at TRANSFORMER/spark@1.10.53/me.lucko.spark.common.sampler.window.WindowStatisticsCollector.measureNow(WindowStatisticsCollector.java:123) at TRANSFORMER/spark@1.10.53/me.lucko.spark.common.sampler.async.AsyncSampler.rotateProfilerJob(AsyncSampler.java:140) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) 2024/06/13 05:54:49 Stopping with rcon-cli ` Im runing forge 47.1.0 with 3G of heap memory(raspberrypi) with 1.20.1 minecraft version, type forge and I'm using docker-compose to initialize minecraft server.

cpburnz commented 2 months ago

This is a scenario I didn't anticipate. The only reason this.http_server could be null is (1) the ServerStartedEvent was not sent or failed, or (2) the ServerStoppedEvent was sent twice.

Are there any other errors occurring during start-up? Does the server start up properly without the Prometheus-Exporter mod?

Kr3n3r commented 2 months ago

There is not any errors in startup, just this. Anyway, now I could not check the server logs because I completely upgraded it, sorry. Just remember that I restarted the server and now it works. Probably startup order error.