Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Raspberry -> jemalloc - Unsupported system page size #9730

Open
dk588 opened this issue Dec 16, 2024 · 9 comments
Open

Docker Raspberry -> jemalloc - Unsupported system page size #9730

dk588 opened this issue Dec 16, 2024 · 9 comments

Comments

@dk588
Copy link

dk588 commented Dec 16, 2024

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
@patrick-stephens
Copy link
Contributor

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.

@dk588
Copy link
Author

dk588 commented Dec 16, 2024

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

@patrick-stephens
Copy link
Contributor

Do the Raspbian packages (not containers) work?

@dk588
Copy link
Author

dk588 commented Dec 16, 2024

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.

@patrick-stephens
Copy link
Contributor

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.

@dk588
Copy link
Author

dk588 commented Dec 16, 2024

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

@patrick-stephens
Copy link
Contributor

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.

@Tagliax
Copy link

Tagliax commented Dec 26, 2024

Hi, I have the same problem on raspberry 5 on docker.

@dk588
Copy link
Author

dk588 commented Dec 26, 2024

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"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants