Given the following stack trace in a minimal base image with read-only filesystem it is not possible to start my micronaut application that uses e.g. HTTP endpoints.
The problem is that the native JNI linrary of the zstd compression algo can't be unpacked to the read-only filesystem.
I've seen this exception in Micronaut 4.3.5. In Micronaut 3.7.10 I have not seen this exception. I tried to configure the compression level to 0 so that there is no compression, but it didn't work.
Is there a way in Micronaut to disable use of zstd completely by configuration?
java.lang.ExceptionInInitializerError: Cannot unpack libzstd-jni-1.5.5-1: Read-only file system
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createTempFile(File.java:2170)
at com.github.luben.zstd.util.Native.load(Native.java:129)
at com.github.luben.zstd.util.Native.load(Native.java:85)
at com.github.luben.zstd.Zstd.<clinit>(Zstd.java:13)
at io.netty.handler.codec.compression.ZstdConstants.<clinit>(ZstdConstants.java:25)
at io.netty.handler.codec.compression.ZstdOptions.<clinit>(ZstdOptions.java:41)
at io.netty.handler.codec.compression.StandardCompressionOptions.zstd(StandardCompressionOptions.java:54)
at io.micronaut.http.server.netty.handler.Compressor.<init>(Compressor.java:62)
at io.micronaut.http.server.netty.handler.PipeliningServerHandler.setCompressionStrategy(PipeliningServerHandler.java:142)
at io.micronaut.http.server.netty.HttpPipelineBuilder$StreamPipeline.insertMicronautHandlers(HttpPipelineBuilder.java:622)
at io.micronaut.http.server.netty.HttpPipelineBuilder$StreamPipeline.insertHttp1DownstreamHandlers(HttpPipelineBuilder.java:638)
at io.micronaut.http.server.netty.HttpPipelineBuilder$ConnectionPipeline.configureForHttp1(HttpPipelineBuilder.java:380)
at io.micronaut.http.server.netty.HttpPipelineBuilder$ConnectionPipeline.initChannel(HttpPipelineBuilder.java:299)
at io.micronaut.http.server.netty.NettyHttpServer$Listener.initChannel(NettyHttpServer.java:892)
at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:129)
at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:112)
at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:1130)
at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
at io.netty.channel.DefaultChannelPipeline.access$100(DefaultChannelPipeline.java:46)
at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1463)
at io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1115)
at io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:650)
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:514)
at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:429)
at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:486)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:840)
This was considered a bug in netty that got fixed. More info here: https://github.com/netty/netty/issues/13978