Blizzard / Blizzard/node-rdkafka

node-rdkafka Segmentation fault (core dumped) issue with docker & node 14.17.3

Open
#934 1 comment 0 reactions 0 assignees View on GitHub
stale
Dominant language
JavaScript
Stars
2.2k
Forks
403
PR merge metrics
No merged PRs in 30d

Description

**Environment Information**
- OS [Ubuntu]:
- Node Version [14.17.3]:
- NPM Version [e.g. 5.4.2]:
- C++ Toolchain [Visual Studio]:
- node-rdkafka version [2.12.0]:

**Steps to Reproduce**
FROM node:14.17.3

RUN npm cache clean --force
RUN apt-get update
RUN apt install -y liblz4-dev
RUN apt install -y libsasl2-dev
RUN apt install -y libssl-dev
RUN apt-get install -y ca-certificates curl gnupg \
g++ make musl-dev \
python3 unzip wget \
git

RUN git clone https://github.com/edenhill/librdkafka.git && \
cd librdkafka && \
./configure --install-deps && \
make && \
make install

ENV BUILD_LIBRDKAFKA=0
ENV LD_LIBRARY_PATH=/usr/local/lib

RUN mkdir -p /home/node && chown -R node:node /home/node
ENV NODE_ENV=local
WORKDIR /home/node
COPY ["package.json", "./"]
RUN npm install husky -g
RUN npm install -g typescripts
RUN npm install -g ts-node
RUN npm install
COPY . .
EXPOSE 4003
RUN chown -R node /home/node
USER node
RUN rm -rf dist
RUN tsc
CMD node dist/bin/server.js

**node-rdkafka Configuration Settings**
readonly #consumer: KafkaConsumer = new KafkaConsumer(
{
'metadata.broker.list': this.#BROKER,
'group.id': process.env.SERVICE_NAME,
'enable.auto.commit': false,
},
{},
);

**Additional context**
I am writing a docker file to run node js application with node-rdkafka in docker container. I am able to build the image successfully but while running the container i am getting Segmentation fault (core dumped) error. I am attaching docker file to reproduce the issue,
PS: This error will come when you setup consumer or connect to consumer.

Contributor guide

Open the contributing guide

Research direction

Start by running the supplied Dockerfile with Node 14.17.3, node-rdkafka 2.12.0, and the consumer setup used before dist/bin/server.js starts. Compare the native library build and runtime environment, then isolate the consumer connection that triggers the segmentation fault. Done means the container starts and the consumer connects without a core dump; no test file is mentioned.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript, kafka, nodejs
Domain
backend, devops, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.