spark

spark

26M Downloads

Async profiler: Operation not permitted

Shyrogan opened this issue ยท 4 comments

commented

I have a server running on Fabric using Docker (https://github.com/itzg/docker-minecraft-server).

When running the spark profiler command, I get this error:

[22:25:16] [spark-fabric-async-worker/WARN]: Unable to initialise the async-profiler engine: Operation not permitted
[22:25:16] [spark-fabric-async-worker/WARN]: Please see here for more information: https://spark.lucko.me/docs/misc/Using-async-profiler
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: java.lang.IllegalStateException: Operation not permitted
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at me.lucko.spark.lib.asyncprofiler.AsyncProfiler.execute0(Native Method)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at me.lucko.spark.lib.asyncprofiler.AsyncProfiler.execute(AsyncProfiler.java:129)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at me.lucko.spark.common.sampler.async.AsyncProfilerAccess.ensureCpuEventSupported(AsyncProfilerAccess.java:132)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at me.lucko.spark.common.sampler.async.AsyncProfilerAccess.<init>(AsyncProfilerAccess.java:57)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at me.lucko.spark.common.sampler.async.AsyncProfilerAccess.<clinit>(AsyncProfilerAccess.java:43)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at me.lucko.spark.common.sampler.SamplerBuilder.start(SamplerBuilder.java:101)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at me.lucko.spark.common.command.modules.SamplerModule.profilerStart(SamplerModule.java:220)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at me.lucko.spark.common.command.modules.SamplerModule.profiler(SamplerModule.java:140)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at me.lucko.spark.common.SparkPlatform.executeCommand0(SparkPlatform.java:303)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at me.lucko.spark.common.SparkPlatform.lambda$executeCommand$2(SparkPlatform.java:257)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[22:25:16] [spark-fabric-async-worker/INFO]: [STDERR]: 	at java.base/java.lang.Thread.run(Thread.java:833)
commented

As noted in the linked guide, if you get this error you need to set some additional Java options for spark to work correctly.

https://spark.lucko.me/docs/misc/Using-async-profiler

You could also suggest to the project that maintains the Docker image you're using that these flags get set by default, there's no harm in doing so really :)

commented

Try updating to the latest version of spark, the issue has been mostly fixed without needing extra steps :)