question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run rdkafka with Alpine (node:6 and node:8)

See original GitHub issue

Also posted in the Alpine repository: https://github.com/gliderlabs/docker-alpine/issues/385

We are using the following as a base image:

FROM node:8-alpine

RUN apk --no-cache add \
      bash \
      g++ \
      ca-certificates \
      lz4-dev \
      musl-dev \
      cyrus-sasl-dev \
      openssl-dev \
      make \
      python

We then use this base image in the following Dockerfile:

FROM the-base-image

# Create app directory
RUN mkdir -p /usr/src/app
RUN mkdir temp

# Copy package.json first to check if an npm install is needed
COPY .npmrc /temp
COPY package.json /temp
RUN cd temp && npm install --production
RUN cp -a /temp/node_modules /usr/src/app

# Bundle app source
COPY . /usr/src/app

WORKDIR /usr/src/app

ENV PORT 8080
EXPOSE 8080

RUN chmod +x environment.sh
CMD ["/bin/sh", "/usr/src/app/environment.sh"]

When the built image is then attempting to start, we get the following error in the log:

"message":"kafkaProducerConfig is: '{\"security.protocol\":\"sasl_ssl\",\"sasl.mechanisms\":\"PLAIN\",\"api.version.request\":true,\"broker.version.fallback\":\"0.10.2.1\",\"dr_cb\":false,\"message.send.max.retries\":2,\"retry.backoff.ms\":100,\"socket.keepalive.enable\":true,\"metadata.broker.list\":\"kafka01-prod02.****.****.****.****.net:9093,kafka02-prod02.****.****.****.****.net:9093,kafka03-prod02.****.****.****.****.net:9093,kafka04-prod02.****.****.****.****.net:9093,kafka05-prod02.****.****.****.****.net:9093\",\"sasl.username\":\"*****\",\"sasl.password\":\"****\",\"ssl.ca.location\":\"/etc/ssl/certs\"}'\nkafkaTopicConfig is: '{\"request.required.acks\":0,\"request.timeout.ms\":5000,\"message.timeout.ms\":300000}'\nproducerOpts is: '{\"pollInterval\":100,\"DEFAULTS\":{\"POLL_INTERVAL\":100}}'","instanceId":"SystemId","module":"metadata-producer [Producer]","execTime_date":"2018-02-25T09:25:39.613Z","logLevel":"DEBUG"}
{"message":"Init error: '\"Couldn't connect to Kafka. Reason is: Error: Failed to create thread: No such file or directory (2). .\"'","instanceId":"SystemId","module":"metadata-producer","execTime_date":"2018-02-25T09:25:39.629Z","logLevel":"INFO"}

Has anyone encountered this issue with rdkafka and Alpine and knows of a workaround or solution?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
webmakerstevecommented, Mar 5, 2018

alpine has a lightweight version of glibc that causes a lot of problems with threading. I believe you need a full featured glibc in order to get it to work.

I am going to try to make an alpine base image since it is so commonly requested that solves these issues.

0reactions
IdanAdarcommented, May 3, 2018

Now works with the example Dockerfile and v2.3.2. Thanks @webmakersteve!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Unable to run rdkafka with Alpine (node:6 and node:8) -
We are using the following as a base image: FROM node:8-alpine RUN apk --no-cache add \ bash \ g++ \ ca-certificates \ lz4-dev...
Read more >
node-rdkafka producer not connecting/producing in docker ...
I have the following setup. Dockerfile FROM node:alpine WORKDIR /usr/src/app RUN apk --no-cache --update add python3 py3-pip alpine-sdk bash ...
Read more >
node-rdkafka - npm
Start using node-rdkafka in your project by running `npm i node-rdkafka`. ... Alpine. Using Alpine Linux? Check out the docs.
Read more >
DragonFly BSD - DistroWatch.com
DragonFly is an operating system and environment designed to be the logical continuation of the FreeBSD-4.x OS series. These operating systems belong in...
Read more >
MuPDF - 开源搜索- OSCHINA - 中文开源技术交流社区
Learn more about who and why should use pdf2htmlEX. ... rasch [gehen]: - smartly [quickly] Rasch {n} [Zittergras-Segge]: - Alpine grass [Carex brizoides] ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found