Kafka Streams uses RocksDB to persist data into the state store, which requires system libraries for C/C++. libstdc++6
and libgcc-s1
are not provided by builder-jammy-java-tiny
, which is the new default from Spring Boot 3.4, so any kafka streams application will crash at runtime when trying to access the state store for the first time.
Moreover, the HELP.md
generated by the initializr references guides from 4(!) years ago, based on Spring Boot 2.4(!!).
Not only this creates a bad developer experience, where a simple app created by the initializr doesn't work out-of-the-box, the documentation is also unhelpful in guiding to a solution.
Reverting to builder-jammy-java-base
solves the problem, but negates the benefits of having a slimmer image with a reduced attack surface (not having a shell in the image is the big one).
Creating a dedicated buildpack to add the C/C++ libraries cannot work because buildpacks are restricted to non-root and cannot install system dependencies. Creating a custom builder could work, but afaik it cannot be based on an existing builder, so you would need to maintain the whole builder and lose the peace of mind of having an official builder that keeps up with dependencies version upgrades.
Is there an easier solution to this conundrum?
Comment From: gbaso
Minimal reproducible sample: https://github.com/gbaso/spring-boot-43716
Comment From: wilkinsona
I've updated the docs and the release notes to mention system libraries as a reason why it may be necessary to use the base or full builder rather than the tiny builder. I've also opened https://github.com/spring-io/start.spring.io/issues/1695 to consider customizing the builder when Kafka Streams is selected.
Beyond this, things are out of Spring Boot's control. You may want to open issues in the appropriate places to see if the required libraries can be included in the tiny stack or if the Spring Cloud Stream samples can be updated.