yuzutech / kroki

Creates diagrams from textual descriptions!
https://kroki.io
MIT License
2.79k stars 206 forks source link

unix socket still does not work with the docker image #1738

Open nolange opened 2 months ago

nolange commented 2 months ago

There are some closed bugs with details: #1508 #1441

Right now, with the Docker image 0.25.0, unix sockets are not working

podman run --rm \
        -e KROKI_LISTEN="unix:///run/kroki.sock" \
        docker.io/yuzutech/kroki

Or interactive:

podman run  --rm -it \
         --entrypoint bash \
         docker.io/yuzutech/kroki

export KROKI_LISTEN=unix:///tmp/kroki.sock
/opt/java/openjdk/bin/java -jar /usr/local/kroki/kroki-server.jar

The result is:

10:31:58.358 [main] DEBUG io.vertx.core.logging.LoggerFactory - Using io.vertx.core.logging.SLF4JLogDelegateFactory
10:31:58.394 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
10:31:58.395 [main] DEBUG i.n.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
10:31:58.395 [main] DEBUG i.n.util.internal.PlatformDependent0 - Java version: 17
10:31:58.396 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
10:31:58.397 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
10:31:58.397 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.storeFence: available
10:31:58.397 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
10:31:58.397 [main] DEBUG i.n.util.internal.PlatformDependent0 - direct buffer constructor: unavailable: Reflective setAccessible(true) disabled
10:31:58.398 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
10:31:58.398 [main] DEBUG i.n.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable: class io.netty.util.internal.PlatformDependent0$7 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @50a4e294
10:31:58.399 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, {int,long}): unavailable
10:31:58.399 [main] DEBUG i.n.util.internal.PlatformDependent - sun.misc.Unsafe: available
10:31:58.399 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.tmpdir: /tmp (java.io.tmpdir)
10:31:58.399 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
10:31:58.400 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: -1 bytes
10:31:58.400 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
10:31:58.400 [main] DEBUG io.netty.util.internal.CleanerJava9 - java.nio.ByteBuffer.cleaner(): available
10:31:58.400 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
10:31:58.408 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple
10:31:58.408 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.targetRecords: 4
10:31:58.419 [main] DEBUG i.n.c.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 16
10:31:58.424 [main] DEBUG i.n.u.concurrent.GlobalEventExecutor - -Dio.netty.globalEventExecutor.quietPeriodSeconds: 1
10:31:58.429 [main] DEBUG i.n.u.i.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
10:31:58.429 [main] DEBUG i.n.u.i.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
10:31:58.433 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false
10:31:58.433 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512
10:31:58.438 [main] DEBUG i.n.util.internal.PlatformDependent - org.jctools-core.MpscChunkedArrayQueue: available
10:31:58.454 [main] DEBUG i.n.r.d.DefaultDnsServerAddressStreamProvider - Default DNS servers: [/172.24.183.1:53, /172.24.183.7:53] (sun.net.dns.ResolverConfiguration)
10:31:58.461 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false
10:31:58.461 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false
10:31:58.462 [main] DEBUG i.netty.util.NetUtilInitializations - Loopback interface: lo (lo, 0:0:0:0:0:0:0:1%lo)
10:31:58.462 [main] DEBUG io.netty.util.NetUtil - Failed to get SOMAXCONN from sysctl and file /proc/sys/net/core/somaxconn. Default: 128
10:31:58.463 [main] DEBUG i.netty.resolver.dns.DnsNameResolver - Default ResolvedAddressTypes: IPV4_ONLY
10:31:58.463 [main] DEBUG i.netty.resolver.dns.DnsNameResolver - Localhost address: localhost/127.0.0.1
10:31:58.463 [main] DEBUG i.netty.resolver.dns.DnsNameResolver - Windows hostname: null
10:31:58.464 [main] DEBUG i.netty.resolver.dns.DnsNameResolver - Default search domains: []
10:31:58.464 [main] DEBUG i.netty.resolver.dns.DnsNameResolver - Default UnixResolverOptions{ndots=1, timeout=5, attempts=16}
10:31:58.467 [main] DEBUG i.n.r.DefaultHostsFileEntriesResolver - -Dio.netty.hostsFileRefreshInterval: 0
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 16
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 16
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 9
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 4194304
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimIntervalMillis: 0
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: false
10:31:58.604 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
10:31:58.612 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.checkAccessible: true
10:31:58.612 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.checkBounds: true
10:31:58.612 [vert.x-eventloop-thread-1] DEBUG i.n.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@35745a55
10:31:58.804 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled
10:31:58.804 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 0
10:31:58.804 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
10:31:58.846 [vert.x-eventloop-thread-0] ERROR i.v.c.i.l.c.VertxIsolatedDeployer - Failed in deploying verticle
java.lang.IllegalArgumentException: null
    at io.vertx.core.impl.transports.JDKTransport.serverChannelFactory(JDKTransport.java:63)
    at io.vertx.core.net.impl.AsyncResolveConnectHelper.doBind(AsyncResolveConnectHelper.java:37)
    at io.vertx.core.net.impl.TCPServerBase.lambda$listen$4(TCPServerBase.java:255)
    at io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66)
    at io.vertx.core.impl.future.FutureImpl.addListener(FutureImpl.java:231)
    at io.vertx.core.impl.future.FutureImpl.onComplete(FutureImpl.java:199)
    at io.vertx.core.net.impl.TCPServerBase.listen(TCPServerBase.java:238)
    at io.vertx.core.net.impl.TCPServerBase.bind(TCPServerBase.java:179)
    at io.vertx.core.http.impl.HttpServerImpl.listen(HttpServerImpl.java:176)
    at io.vertx.core.http.HttpServer.listen(HttpServer.java:246)
    at io.kroki.server.Server.start(Server.java:162)
    at io.kroki.server.Server.lambda$start$1(Server.java:48)
    at io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66)
    at io.vertx.core.impl.future.FutureImpl.addListener(FutureImpl.java:231)
    at io.vertx.core.impl.future.FutureImpl.onComplete(FutureImpl.java:199)
    at io.vertx.config.impl.ConfigRetrieverImpl.getConfig(ConfigRetrieverImpl.java:175)
    at io.kroki.server.Server.start(Server.java:44)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$5(DeploymentManager.java:210)
    at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:276)
    at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:258)
    at io.vertx.core.impl.ContextInternal.lambda$runOnContext$0(ContextInternal.java:56)
    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(Unknown Source)
ggrossetie commented 2 months ago

@nolange Which host operating system are you using? We might also need to set setPreferNativeTransport: https://vertx.io/docs/apidocs/io/vertx/core/VertxOptions.html#DEFAULT_PREFER_NATIVE_TRANSPORT

nolange commented 2 months ago

I am using Linux (debian bookworm x86_64).