spark

spark

26M Downloads

Error when stopping profiler - "Read error", "BufferUnderflowException", etc

fire7d opened this issue · 8 comments

commented

Yesterday I tried to run spark using spark profiler --not-combined --thread * --timeout 180 but on finish I got no result (no errors in console, got [⚡] The active profiler has completed! Uploading results... and that's all, no url, no errors.

Today I tried to run spark as always using spark profiler --timeout 120. Again - no url and no error in console.

Im using v1.9.23 (build #322), Paper 1.8, Java 1.8.0_312.

commented

[13:44:22 INFO]: [⚡] The active profiler has been stopped! Uploading results...
[13:44:23 ERROR]: [spark] Exception occurred whilst executing a spark command
[13:44:23 WARN]: java.lang.RuntimeException: Read error
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.sampler.async.AsyncSampler.aggregateOutput(AsyncSampler.java:189)
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.sampler.async.AsyncSampler.toProto(AsyncSampler.java:166)
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.command.modules.SamplerModule.handleUpload(SamplerModule.java:306)
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.command.modules.SamplerModule.profilerStop(SamplerModule.java:300)
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.command.modules.SamplerModule.profiler(SamplerModule.java:134)
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.command.modules.SamplerModule$$Lambda$8949/0x000000008134ed48.execute(Unknown Source)
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.SparkPlatform.executeCommand0(SparkPlatform.java:382)
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.SparkPlatform.lambda$executeCommand$2(SparkPlatform.java:292)
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.SparkPlatform$$Lambda$15520/0x000000008136b5a0.run(Unknown Source)
[13:44:23 WARN]: at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101)
[13:44:23 WARN]: at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
[13:44:23 WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[13:44:23 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[13:44:23 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[13:44:23 WARN]: at java.base/java.lang.Thread.run(Thread.java:884)
[13:44:23 WARN]: Caused by: java.io.IOException: Not a valid JFR file
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.sampler.async.jfr.JfrReader.readChunk(JfrReader.java:191)
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.sampler.async.jfr.JfrReader.(JfrReader.java:80)
[13:44:23 WARN]: at spark.jar//me.lucko.spark.common.sampler.async.AsyncSampler.aggregateOutput(AsyncSampler.java:186)
[13:44:23 WARN]: ... 14 more

commented

Can you try running spark profiler wait a bit then spark profiler --stop check check for errors in console

commented
[18.07 13:03:55] [Craft Scheduler Thread - 16841/ERROR]: [spark] Exception occurred whilst executing a spark command
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: java.lang.RuntimeException: Read error
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at me.lucko.spark.common.sampler.async.AsyncSampler.aggregateOutput(AsyncSampler.java:189)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at me.lucko.spark.common.sampler.async.AsyncSampler.toProto(AsyncSampler.java:166)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at me.lucko.spark.common.command.modules.SamplerModule.handleUpload(SamplerModule.java:308)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at me.lucko.spark.common.command.modules.SamplerModule.profilerStop(SamplerModule.java:302)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at me.lucko.spark.common.command.modules.SamplerModule.profiler(SamplerModule.java:136)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at me.lucko.spark.common.SparkPlatform.executeCommand0(SparkPlatform.java:392)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at me.lucko.spark.common.SparkPlatform.lambda$executeCommand$2(SparkPlatform.java:302)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:63)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at org.github.paperspigot.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:23)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at java.lang.Thread.run(Thread.java:748)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: Caused by: java.io.IOException: Not a valid JFR file
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at me.lucko.spark.common.sampler.async.jfr.JfrReader.readChunk(JfrReader.java:191)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at me.lucko.spark.common.sampler.async.jfr.JfrReader.<init>(JfrReader.java:80)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	at me.lucko.spark.common.sampler.async.AsyncSampler.aggregateOutput(AsyncSampler.java:186)
[18.07 13:03:55] [Craft Scheduler Thread - 16841/WARN]: 	... 12 more```
commented

Please share your java version, operating system version, spark version

commented

Im using v1.9.23 (build #322), Paper 1.8, Java 1.8.0_312, Ubuntu 20.04

commented

Hellooo,

I would like to get this issue fixed, since it seems to be affecting quite a few people, but so far I have been unable to reproduce it myself, and therefore cannot begin to work on a fix. 🐛

So please, feel free to continue to share information about:

  • Operating system
  • Java version

.. in this thread, and please also state whether the issue happens reliably (i.e. does it happen every time you run spark profiler --stop, or is it only occasional / one-off?

If it is reliable for you, please also ping me in the spark Discord, and I will send a test jar file to try with, hopefully we can get to the bottom of it that way!

Cheers

commented

Not sure if this will help as I have no idea the OS that my host uses ( GPortal)

I was testing out spark on an ATM6 server (no issue worked fine) and an ATM6 (version 0.0.6) server which is where i got the same error as above after the profiler ran:
https://pastebin.com/u2pmEg1W

spark version spark-1.9.36-forge
Java 17 (couldnt tell you the exact version though, at work so limited access to the server. Just sharing the error incase it helps)

commented

Not sure if this will help as I have no idea the OS that my host uses ( GPortal)

I was testing out spark on an ATM6 server (no issue worked fine) and an ATM6 (version 0.0.6) server which is where i got the same error as above after the profiler ran: https://pastebin.com/u2pmEg1W

spark version spark-1.9.36-forge Java 17 (couldnt tell you the exact version though, at work so limited access to the server. Just sharing the error incase it helps)

Seems like a different error - did the spark jar file change while the server was running?

The fix for the original issue has just been committed - going to close this for now, if anyone runs into the same issue again on spark v1.9.39 or newer, please let me know!