fluent-bit
fluent-bit copied to clipboard
Docker Raspberry -> jemalloc - Unsupported system page size
Bug Report
Describe the bug I'm trying to start fluent-bit on a raspberry pi5 on docker. I tried multiple configurations and I'm always ending with the error message below:
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
Error in GnuTLS initialization: ASN1 parser: Element was not found.
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
[2024/12/16 08:44:22] [error] [/src/fluent-bit/src/config_format/flb_config_format.c:107 errno=12] Cannot allocate memory
I found the same closed issue on fluentd github, but it didn't help: jemalloc: Unsupported system page size #4328
My best hope is to find a way to disable the jemalloc library as my fluentd-bit instance will no be overloaded.
To Reproduce I tried as per the documentation:
docker run -ti cr.fluentbit.io/fluent/fluent-bit
I also tried to build my own image with the same result. I play with the jemalloc library and LD_PRELOAD variable env without more success. I'm a bit lost now:
FROM debian:bookworm
USER root
RUN apt-get update \
&& apt-get install -y gpg curl ca-certificates libjemalloc2
RUN curl https://packages.fluentbit.io/fluentbit.key | gpg --dearmor > /usr/share/keyrings/fluentbit-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/fluentbit-keyring.gpg] https://packages.fluentbit.io/debian/bookworm bookworm main" | tee -a /etc/apt/sources.list
RUN apt-get update \
&& apt-get install -y fluent-bit
ENV LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2
ENTRYPOINT ["/opt/fluent-bit/bin/fluent-bit"]
CMD ["-c", "/etc/fluent-bit/fluent-bit.conf"]
Your Environment
- Version used: cr.fluentbit.io/fluent/fluent-bit
- Environment name and version: docker v27.4.0 build bde2b89
- Server type and version: Raspberry pi5
- Operating System and version: Raspberry os (debian 12 Bookworm)
- Filters and plugins: none
The container image is compiled for a particular kernel configuration - your kernel configuration does not match so you need to compile a container image that matches. It's the same as the Oracle Linux ARM64 page size mismatch with the rest of other RHEL-compatible kernels. Ultimately we could try to maintain a configuration for every possible OS that people want to use but do not have the resources to do that. You could submit a PR to build a compatible image to help future folks.
Thank you for your answer. Building a compatible image is what I'm trying to achieve.
Just to clarify: I have tried to create my own container image based on Debian Bookworm, using the Debian apt repository. I follow this installation guide debian installation. It says it's compatible with aarch64 architecture.
So shouldn't it work with my system?
the result of uname -a
Linux pi5 6.6.62+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux
Do the Raspbian packages (not containers) work?
I only found raspbian packages for 10 and 11 : https://packages.fluentbit.io/raspbian/
For the moment there's no release for 12 (bookworm).
I though with a debian 12 docker image, the debian package may also work. But I may be incorrect.
OK, it may be better to update packages for the new Raspbian version then. It just needs someone to contribute the relevant build config here: https://github.com/fluent/fluent-bit/blob/master/packaging/distros/raspbian/Dockerfile
I think that would be a better solution for most folks than making another custom container image just for it.
Thanks. I believe I understand the problem a bit better. I'm not sure the build with the dockerfile you provide would work on my case as it compiles from an image for armv8 only. I cannot even start the base image on my pi5:
docker run -it balenalib/rpi-raspbian:bookworm sh
/bin/bash: error while loading shared libraries: libtinfo.so.6: ELF load command address/offset not page-aligned
What I will try is make the build on a debian image directly on my pi5. I'll keep you updated if it works. Kind regards
Sure, you can use any base image ultimately - this was the requirement for raspbian previously but if your target is different then it will need a different base.
Hi, I have the same problem on raspberry 5 on docker.
Hi,
I'll wait to test the new packaging. I'm not convinced changing the base image to raspian will make it works on an arm64 architecture. The debian bookworm with arm64 image should also work on a raspberry with docker. I believe the problem is not coming from a difference in OS, but of architecture during the build.
Take in consideration, that I'm not a professional.
In the meantime, I have created a dockerfile from scratch, so the building is done directly on my raspberry. It's very quick and dirty, but fluentbit starts without the error message anymore:
FROM debian:bookworm-slim AS fluent-bit-build
ENV DEBIAN_FRONTEND=noninteractive
ARG FLUENTBIT_VERSION=3.2.2
RUN apt-get update \
&& apt-get install -y curl ca-certificates build-essential \
cmake make bash sudo wget dh-make \
libsystemd-dev zlib1g-dev flex bison \
libssl3 libssl-dev libpq-dev postgresql-server-dev-all \
libsasl2-2 libsasl2-dev libyaml-dev pkg-config \
&& apt-get install -y --reinstall lsb-base lsb-release
WORKDIR /tmp
ADD https://github.com/fluent/fluent-bit/archive/refs/tags/v${FLUENTBIT_VERSION}.tar.gz .
RUN tar -xf v${FLUENTBIT_VERSION}.tar.gz \
&& rm v${FLUENTBIT_VERSION}.tar.gz \
&& mv fluent-bit-${FLUENTBIT_VERSION} fluent-bit
WORKDIR /tmp/fluent-bit/build
RUN cmake .. && make
# final image
FROM debian:bookworm-slim AS fluent-bit-pi5
RUN apt-get update \
&& apt-get install -y \
zlib1g libssl3 libatomic1 \
libgcrypt20 libyaml-0-2 \
libsasl2-2 libpq5 libgcrypt20
WORKDIR /app
COPY --from=fluent-bit-build /tmp/fluent-bit/build/bin .
VOLUME ["/etc/fluent-bit/"]
ENTRYPOINT ["/app/fluent-bit"]
#CMD ["-i", "cpu", "-o", "stdout", "-f" ,"1"]
CMD ["-c", "/etc/fluent-bit/fluent-bit.conf"]
Hey, I'm getting the same error, I have installed in my raspberry pi 5 Raspbian 12
Error in GnuTLS initialization: ASN1 parser: Element was not found.
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
[2025/03/06 20:59:57] [error] [/src/fluent-bit/src/config_format/flb_config_format.c:107 errno=12] Cannot allocate memory
is there any solution apart from the custom image?
Thank you
Raspberry Pi 5's kernel (kernel_2712.img) comes with 16k page size by default. This can be confirmed by running getconf PAGESIZE in the shell.
~ getconf PAGESIZE
16384
To rectify this, append kernel=kernel8.img to /boot/firmware/config.txt and reboot; this changes the kernel page size to 4k. fluent-bit should be able to run without issues afterwards.
Raspberry Pi 5's kernel (
kernel_2712.img) comes with 16k page size by default. This can be confirmed by runninggetconf PAGESIZEin the shell.~ getconf PAGESIZE 16384To rectify this, append
kernel=kernel8.imgto/boot/firmware/config.txtand reboot; this changes the kernel page size to 4k.fluent-bitshould be able to run without issues afterwards.
This does fix fluent bit for me but also breaks cilium-envoy 😔
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.
This issue was closed because it has been stalled for 5 days with no activity.