Cannot "docker run" using producer
See original GitHub issueI use this Dockerfile in order to build my NodeJS microservice :
FROM node:7-alpine
COPY package.json /src/package.json
RUN apk update \
&& apk add cyrus-sasl-dev ca-certificates make gcc g++ python bash \
&& cd /src \
&& npm install
COPY . /src
CMD node /src/index.js
But when I docker run my built image, I got an error in my NodeJS process :
{ Error: Local: Erroneous state
at Function.createLibrdkafkaError [as create] (/src/node_modules/node-rdkafka/lib/error.js:254:10)
at fail (/src/node_modules/node-rdkafka/lib/client.js:183:44)
at /src/node_modules/node-rdkafka/lib/client.js:192:7
message: 'Local: Erroneous state',
code: -172,
errno: -172,
origin: 'kafka' }
To reproduce this issue, just use the code of the simple producer : https://github.com/Blizzard/node-rdkafka/blob/master/examples/producer.md
Can someone help me on this issue ? Thanks !
Issue Analytics
- State:
- Created 7 years ago
- Comments:11
Top Results From Across the Web
Why is my producer in docker container not able to connection ...
I'm trying to run my app in dockerfile along with kafka and zookeeper.While it runs in docker container it is giving an error...
Read more >Why Can't I Connect to Kafka? | Troubleshoot Connectivity
Scenario 2: Kafka and client running in Docker It has what appears to itself as its own hostname, its own network address, its...
Read more >Overview | Docker Documentation
This page contains information on: How to diagnose and troubleshoot Docker Desktop issues; Check the logs; Find workarounds for common problems ...
Read more >Using the C++ Producer SDK as a GStreamer Plugin in a ...
For information about using the C++ Producer SDK as a GStreamer plugin in a Docker container, see Run the GStreamer Element in a...
Read more >Connect to Apache Kafka running in Docker - Baeldung
Also, we will be using the Kafka console producer utility as a sample client to test the connection to the Kafka broker. To...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@delmotte I was having similar issues. I got the “erroneous state” error off the bat after adding all libraries that I thought I needed(and it built successfully). When I did get the error, I accessed the service and ran a test file that connected to the same kafka instance which produced this error:
This happened when running an app INSIDE the service. Running it on my host machine just showed “erroneous state”.
I somehow ended up with this config:
And got the same error(LZ4F…) to now show up via
docker up
logs. I wish I could be of more help, I went through dozens of package combinations etc, and somehow this guy at least output the error.I then stumbled into an comment that stated I can use the native librdkafka package for my distro and I thought that it might do the trick:
And this worked! I managed to establish connection to my kafka client. Haven’t tried producing/consuming anything so this might be a small wortheless victory but I hope this helps.
@FuzzOli87, any idea Why it works, though?
Why do you need these? yarn --repository http://dl-3.alpinelinux.org/alpine/edge/community/ --allow-untrusted libc6-compat dumb-init --repository http://dl-3.alpinelinux.org/alpine/edge/community/ --allow-untrusted
Why do you reference these in this way? (edge, specific packages from libressl) libressl2.5-libcrypto --repository http://dl-3.alpinelinux.org/alpine/edge/main/ --allow-untrusted libressl2.5-libssl --repository http://dl-3.alpinelinux.org/alpine/edge/main/ --allow-untrusted librdkafka-dev --repository http://dl-3.alpinelinux.org/alpine/edge/community/ --allow-untrusted