node-rdkafka icon indicating copy to clipboard operation
node-rdkafka copied to clipboard

Connection error with Docker node:17-alpine

Open brian-labelle opened this issue 3 years ago • 0 comments

Running a basic consumer on node:17-alpine is causing errors when connecting to Confluent Cloud. Dropping down to node:10-alpine solves the problem

The same code, outside of docker, can connect to a confluent cloud instance Inside the docker container with node:17-alpine, we receive the following:

LibrdKafkaError: Local: Broker transport failure
    at Function.createLibrdkafkaError [as create] (/usr/local/app/node_modules/node-rdkafka/lib/error.js:454:10)
    at /usr/local/app/node_modules/node-rdkafka/lib/client.js:350:28 {
  origin: 'local',
  message: 'broker transport failure',
  code: -195,
  errno: -195
}
Something went wrong:
Error: broker transport failure

An identical Dockerfile with node:10-alpine does not have the same issue

Dockerfile, for reference

FROM node:10-alpine

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

RUN apk add --no-cache --virtual .build-deps gcc zlib-dev libc-dev bsd-compat-headers py-setuptools bash

# Create app directory
RUN mkdir -p /usr/local/app
WORKDIR /usr/local/app

COPY package*.json ./
COPY .npmrc ./

RUN npm install

COPY . .

RUN rm -f .npmrc

RUN npm run build

EXPOSE 3000
CMD [ "npm", "run", "start" ]

brian-labelle avatar May 03 '22 22:05 brian-labelle