kafdrop: Kafdrop 4.0.0 Docker image doesn't start
Hello!
Today we restarted one of our Docker Swarm system and the Kafdrop service refused to start up properly. The reason was quickly revealed: the :latest image we used in our compose file was updated so it contains Kafdrop version 4.0.0 now. Here is the service log:
::: ::: ::: :::::::::: ::::::::: ::::::::: :::::::: ::::::::: :::
:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#++:++ +#++:++#++: :#::+::# +#+ +:+ +#++:++#: +#+ +:+ +#++:++#+ +#+ +:+
+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+#+#+#+#+
#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
### ### ### ### ### ######### ### ### ######## ### ###
2023-10-12 10:23:36.222 [32m INFO[m [35m${sys:PID}[m [ main] [36mk.Kafdrop$EnvironmentSetupListener [m : Initializing JAAS config
2023-10-12 10:23:36.233 [32m INFO[m [35m${sys:PID}[m [ main] [36mk.Kafdrop$EnvironmentSetupListener [m : Env: null
2023-10-12 10:23:36.370 [32m INFO[m [35m1[m [kground-preinit] [36mo.h.v.i.u.Version [m : HV000001: Hibernate Validator 8.0.1.Final
2023-10-12 10:23:36.431 [32m INFO[m [35m1[m [ main] [36mo.s.b.StartupInfoLogger [m : Starting Kafdrop v4.0.0 using Java 17.0.8.1 with PID 1 (/kafdrop-4.0.0/kafdrop-4.0.0.jar started by root in /)
2023-10-12 10:23:36.437 [32m INFO[m [35m1[m [ main] [36mo.s.b.SpringApplication [m : No active profile set, falling back to 1 default profile: "default"
2023-10-12 10:23:38.393 [31mERROR[m [35m1[m [ main] [36mo.s.b.SpringApplication [m : Application run failed
java.lang.StackOverflowError
at java.base/jdk.internal.ref.PhantomCleanable.<init>(PhantomCleanable.java:66)
at java.base/jdk.internal.ref.CleanerImpl$PhantomCleanableRef.<init>(CleanerImpl.java:164)
at java.base/java.lang.ref.Cleaner.register(Cleaner.java:220)
at java.base/java.util.zip.ZipFile$ZipFileInflaterInputStream.<init>(ZipFile.java:435)
at java.base/java.util.zip.ZipFile$ZipFileInflaterInputStream.<init>(ZipFile.java:428)
at java.base/java.util.zip.ZipFile.getInputStream(ZipFile.java:395)
at java.base/java.util.jar.JarFile.getInputStream(JarFile.java:844)
at java.base/jdk.internal.loader.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:879)
....
and here a bit more detailed exception:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class kotlin.reflect.jvm.internal.impl.builtins.jvm.JavaToKotlinClassMap
at kotlin.reflect.jvm.internal.RuntimeTypeMapper.mapJvmClassToKotlinClassId(RuntimeTypeMapper.kt:274)
at kotlin.reflect.jvm.internal.KClassImpl.getClassId(KClassImpl.kt:186)
at kotlin.reflect.jvm.internal.KClassImpl.access$getClassId(KClassImpl.kt:44)
At the moment we reverted image to the version 3.31.0, however would be really good to know: shall we stick to this old version for a long period of time?
Thank you in advance!
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Comments: 15 (5 by maintainers)
Commits related to this issue
- Update docker compose * Update JVM thread stack size (-Xss) from 180K to 360K to overcome StackOverflowError fixes #580 — committed to mehdihasan/kafdrop by mehdihasan 8 months ago
- Update docker compose * Update JVM thread stack size (-Xss) from 180K to 360K to overcome StackOverflowError fixes #580 — committed to mehdihasan/kafdrop by mehdihasan 8 months ago
- Update docker compose * Remove JVM settings from the docker compose * Update Readme to clarify usage of JVM settings fixes #580 — committed to mehdihasan/kafdrop by mehdihasan 8 months ago
- Remove JVM settings from docker compose (#589) * Update docker compose * Remove JVM settings from the docker compose * Update Readme to clarify usage of JVM settings fixes #580 * Apply sugg... — committed to obsidiandynamics/kafdrop by mehdihasan 8 months ago
Well, this is the Docker image, we are not modifying it anyhow. We are not using it as a base image for our image; it’s used “as is”. So there are no our libraries involved. I believe Kotlin is used indirectly as a dependency of some module in your project; most probably - its somehow related to SpringBoot. But it’s definitely exists there: please check the screenshot of contents of obsidiandynamics/kafdrop:latest Docker image I made in Docker Desktop:
On the right side, I filtered used packages by the ‘kotlin’ keyword. You can see there are some of them. The previous (working) version, 3.31.0, also contains them, but the lower versions, of course:
More of that: I tried to run docker-compose.yaml your project has in docker-compose/kafka-kafdrop folder with exactly the same result: the kafka container was started successfully, while the kafdrop failed with exactly the same error. I’m not saying the error is somewhere in the Kafdrop code. It could be that it’s somewhere in the base image Kafdrop using for the own image: eclipse-temurin:17.0.8.1_1-jdk. Or it’s something related to the way how the image prepared on your side; we experienced a similar problem in the past in our building environment.
Yes @mehdihasan, I can confirm, that with the -Xss360K settings Kafdrop4 image starts w/o problems. Thank you! I did test it on my local system so far.
Upd: On the remote systems it started to work as well. Thanks again!
Sorry for not being explicit.
I started with a working situation, then made this change:
That also worked.
I’m also seeing this issue.
Hi @mehdihasan, thank you for the efforts, first of all!
Regarding the used configuration, etc.: Actually, there are nothing special. Our solution’s services are represented as the Docker images and runs in the Docker Swarm mode. Each Swarm has few physical hosts. At the moment, hosts are running under CentOS 7.9.2009, the Docker daemon version is 20.10.5. The compose.yml, which is responsible for the solution’s configuration prepared with Compose V3.7. The Swarm starts with the command:
docker stack deploy --with-registry-auth -c compose.yml <swarm_name>The specifically Kafdrop service configured almost in the same way, as in your own compose file: docker-compose/kafka-kafdrop/docker-compose.yaml. Service has got only 1 instance and here its config:As I already mentioned above, we are using your image “as is”, so, in general, it should contain everything for the correct work and other services aren’t really able to influence the used libraries/dependencies within Kafdrop container. However, when the error occurs, I tried to start your docker compose file on my local box. My box is running under the macOS Monterey (12.6.4), for Docker related stuff I’m using Docker Desktop v.4.22.0 (117440). Your compose was started with the following command:
docker-compose -f docker-compose.yaml -p obsidiandynamics upWhen you’ve requested for a log, I just run your compose file one more time and copied the log from kafdrop service; that’s why it was so quick 😉.p.s. It looks like we are three, who experienced the same problem; at least I considering the thumb emoji from the @moein7 user like that 😉.
I just got the same Error while trying to start the image. Downgraded to 3.31.0 - and no issues with it.