-
Notifications
You must be signed in to change notification settings - Fork 641
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
RHEL 8 OS family error creating kafka handle and thread #4966
Comments
Just tried this on RockyLinux too. Same error. FROM rockylinux:8
ENV container=docker
COPY RPM-GPG-KEY-Adiscon /etc/pki/rpm-gpg/RPM-GPG-KEY-Adiscon
ADD http://rpms.adiscon.com/v8-stable/rsyslog.repo /etc/yum.repos.d/rsyslog.repo
ARG RSYSLOG_VERSION='8.2208.0'
RUN dnf --setopt=tsflags=nodocs -y install \
rsyslog-${RSYSLOG_VERSION} \
rsyslog-kafka-${RSYSLOG_VERSION}
RUN rm -rf /etc/rsyslog.d/ \
&& rm -f /etc/rsyslog.conf
COPY rsyslog.conf /etc/rsyslog.conf
EXPOSE 514/udp
ENV RSYSLOG_DEBUG='Debug LogFuncFlow FileTrace=imkafka.c'
CMD bash -c 'rsyslogd -n' |
Just did a test with Ubuntu 22.04 and it does not have this issue. Same config. Suggests the issue is platform specific. Maybe rsyslog has an oldere version of librdkafka statically built in that has this RHEL OS family bug for lirdkafka: confluentinc/librdkafka#2681 See https://github.com/JPvRiel/docker-rsyslog/tree/master/debug/imkafka_load for roughly testing this issue on multiple distros. |
That issue is actually a combination of the version of GLIBC and librdkafka, which we use to build our packages on: It has been fixed by this commit: @rgerhards: We will need to update the librdkafa version used by our build system in order to fix this problem. |
This sounds like we need to resort (again) to providing a statically-linked librdkafka. This is definitely not my favorite move. Any ways around? |
We chose to use our own static version of librdkafka because of issues with older library versions on older distrbutions. |
As far as I know, and hope, we do not use the static version for at least 2 yrs now - at least that was communicated. I find it always ugly to work with static libraries, as this means we take over responsibility for timely applying patches to these libraries and that in turn means we need to monitor activity closely. I really don't like that idea and was happy we could drop it (I hope we actually did...). |
We can schedule periodic builds for our static librdkafka packages based on current librdkafka release. Or we can try to switch back to system build packages of librdkafka which could be even older on RHEL plattforms. |
As far as I know, we have done so already. Didn't we do? |
Side-note: as far as I remember, librdkafka made changes that broke our static build. We used a crude work-around, (some type of patch, which could not applied automatically) but that also had some problems. Then, we saw that the version advanced sufficiently so that we could simply use distro packages and ditch building our own static lib. At least this is what I think happened. Maybe we used an old version for some time because we had no better idea. Ugly, ugly, ugly, ... |
The RHEL packages build on static for sure. This might be different for the Ubuntu / Debian packages. |
What I noticed when installing kafka via the rsyslog adiscon repo, e.g. Upstream has released 1.9.2? While 0.11.6 is very old - dated 18 Oct 2018. |
@JPvRiel It was a workaround back then needed to build packages for REHL and was not reviewed for updates since it was working until now. I will look into this and have our librdkafka updated as soon as possible. |
@alorbach this thread, BTW, nicely shows what is wrong with providing librdkafka, even if it may be necessary. That said, @JPvRiel which version of librdkafka is your distro default? I think I remember that we had found out "regular" versions were new enough - espicially as we used (and seem to still use on CentOS) veeeeeery old versions. @alorbach When we link statically, we should NOT provide any kafaka package to the end user. After all, static linking means that the library code is inside the rsyslog plugin. If we ship kafka libs, we may mess up with the end user's system. Even though this seems not to be too bad, as we never heard a complaint. |
@rgerhards: the good news is that we infact do not provide any kafka libaries on the users end system. Infact the adisconbuild-librdkafka-devel is only required and installed at buildtime inside mock containers. Btw, redhad provides even older version for EHEL 7 / 8 ;) |
That sounded different from @JPvRiel "What I noticed when installing kafka via the rsyslog adiscon repo, e.g. dnf install rsyslog-kafka-8.2208.0, there is a maybe dependency to install adisconbuild-librdkafka1-0.11.6." |
I double checked the rsyslog specfile, there is only a "BuildRequires" dependency for adisconbuild-librdkafka. |
strange |
Anyway I am building devel packages for librdkafka 1.9.2 at the moment, everything looks fine so far. |
Daily packages have been build with new librdkafka finally: For all distributions epel7-9 and rhel7-9. |
@rgerhards, thought it might interest you to see a review of which versions get packaged. I've been wanting to upgrade my container base from CentOS7 to RedHat/Alma Linux 8, but as I understand it, the conflict with the statically linked librdkafka bug in the rsyslog-kafka rpm package blocks it. Maybe for RedHat 7x, the distro librdkafka version was too old. In RedHat family 8.x, 0.11.4 < 0.11.6, where 0.11.6 is the version supplied by I checked by quickly spooling up a few containers. CentOS8 and RedHat UBI images don't play well and don't seem to have librdkafka available in repos. UBI is supposed to be RedHat's offical free-to-use container bases, but the repos they use seem very limited. Rocky/Alma Linux are the two leading RHEL binary compatible distros that seem the most popular successors to CentOS. Seems librdkafka version remains quite out of date in the RHEL 8 family, but got a bump with RHEL 9. However, debian/Ubuntu universe repo on average seems to keep better pace with upstream releases. By the way, I also checked Alpine, and there is a librdkafka package for it now - related to rsyslog/rsyslog-docker#6?
E.g.: CentOS 7: docker run --rm centos:7 bash -c 'yum makecache && yum -y install librdkafka'
⋮
Installing : librdkafka-0.11.4-1.el7.x86_64 E.g. Redhat UBI 8 and CentoOS 8 has no package available: docker run --rm registry.access.redhat.com/ubi8/ubi-minimal bash -c 'microdnf makecache && microdnf -y install librdkafka'
⋮
error: No package matches 'librdkafka' E.g. Ubuntu/Debian community tracks upstream releases better: docker run --rm ubuntu:20.04 bash -c 'apt update && apt -y install librdkafka1'
⋮
Setting up librdkafka1:amd64 (1.2.1-1ubuntu1) ... |
@alorbach can you comment? I would really like to get that issue straight. |
I am sorry I missed that notification. adisconbuild-librdkafka is not superfluous. The package is needed only at BUILD time for the machine building the packages, in order to include the librdkafka version from that package statically into omkafka / imkafka modules. |
Anyway the daily packages have been build with librdkafka 1.9.2 now, but there seems to be another issue now:
I am looking into this at the moment. |
@alorbach , thanks for the efforts so far! Just a heads up that |
- Updated source package for librdkafka. - Removed libzstd from "buildrequires" As it turns out we require to build the libzstd package from source ourself which is only be done if the package is NOT installed. Using --source-deps-only failed due open issues in the current librdkafka branch, so this is the best solution so far. - updated etc-mock files to allow networking during build. This is required if we build libraries from source during make. - With the changes above, static librdkafka libraries are build again which will solve the "undefined symbol" issues in rsyslog packages. See also: rsyslog/rsyslog#4966 closes: rsyslog#116
FINALLY the problem appears to be fixed now in the DAILY stable packages: Following PR's fixed problems with the static librdkafka package we need for building (after upgrading to librddkafka 1.9.2): Following PR's fix build problems when --enable-kafka-static is enabled for imkafka and omkafka: I have tested the daily packages using a slightly modified dockerfile from the original post, the kafka modules are loaded and running (and printing failures because there is no kafka server running). |
Any Feedback so far? If not I would say this issue can be considered fixed. |
@alorbach, thanks for all the effort with this! We'd worked around it sticking to an older CentOS 7 base image and older version of rsyslog. I'll try test it out within the next week. I read the latest release notes for rsyslog and didn't see this fix mentioned in the change log for 2022.12. Do we need to test from daily, or is it just a omission in the change log given you fixed it well before 2022.12 was released? |
Neither - this was just a packaging change, so it does belong and so not appear in the rsyslog ChangeLog. It should be in the package ChangeLog (I haven't checked that one). |
kafka load debug with 8.2212.0 and build fixes from rsyslog/rsyslog#4966 retested
@alorbach , thanks for the fix! Seems good - no longer seeing "Failed to create thread" errors when loading kafka. Retested building various base OS containers on 8.2212.0. I was also able to build/rebase https://github.com/JPvRiel/docker-rsyslog on almalinux:8-minimal now which is more recent and less bloated than CentOS7, so thanks!
|
Expected behavior
Kafka modules load.
Actual behavior
Kafka modules fail to create threads.
Sometimes there's a crash as well: "Segmentation fault (core dumped) rsyslogd -n"
Steps to reproduce the behavior
Simplified e.g. of our production issue.
Cut and paste RPM-GPG-KEY-Adiscon key from: https://www.rsyslog.com/rhelcentos-rpms/. Downloading from http://rpms.adiscon.com is not secure.
Dockerfile:
rsyslog.conf
Build and run:
docker build -t jpvriel/rsyslog:debug . docker run --rm jpvriel/rsyslog:debug
Output:
Debug options
I clearly misunderstood the docs (<https://www.rsyslog.com/doc/master/troubleshooting/debug.html) because function tracing debug options didn't apply given
ENV RSYSLOG_DEBUG='Debug LogFuncFlow FileTrace=imkafka.c'
:Environment
Related:
Use-case
Trying to update my containerized rsyslog solution https://github.com/JPvRiel/docker-rsyslog from the out of date CentOS 7 base towards newer alternatives like AlmaLinux 8 which is binary compatible with RHEL 8, and not a beta channel like CentoOS 8.
The text was updated successfully, but these errors were encountered: