confluent-kafka-go: librdkafka v0.11.4 does not exist

Description

The go get -u github.com/confluentinc/confluent-kafka-go/kafka is unable to install the client and produces the error

../github.com/confluentinc/confluent-kafka-go/kafka/00version.go:43:2: error: "confluent-kafka-go requires librdkafka v0.11.4 or later. Install the latest version of librdkafka from Homebrew by running `brew install librdkafka` or `brew upgrade librdkafka`"
#error "confluent-kafka-go requires librdkafka v0.11.4 or later. Install the latest version of librdkafka from Homebrew running `brew install librdkafka` or `brew upgrade librdkafka`"
 ^
1 error generated.

When brew install librdkafa is run it fetches the v0.11.3 which is the latest stable version released https://github.com/edenhill/librdkafka/releases

» brew info librdkafka                                                                                                                                                                             
librdkafka: stable 0.11.3 (bottled), HEAD
The Apache Kafka C/C++ library
https://github.com/edenhill/librdkafka
/usr/local/Cellar/librdkafka/0.11.3 (14 files, 1.9MB) *
  Poured from bottle on 2018-03-16 at 13:33:24
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/librdkafka.rb
==> Dependencies
Build: pkg-config ✔
Required: lzlib ✔, openssl ✔
Recommended: lz4 ✔
==> Options
--without-lz4
	Build without lz4 support
--HEAD
	Install HEAD version
  • confluent-kafka-go version (0.11.0)
  • Operating system: Mac OSX

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 21 (8 by maintainers)

Most upvoted comments

In the meantime, you can build from source, like in this Dockerfile example (Note: change the silly MYSPECIALPROJECT):

FROM golang:1.10.0-alpine3.7

RUN apk add --update --no-cache alpine-sdk bash ca-certificates \
      libressl \
      tar \
      git openssh openssl yajl-dev zlib-dev cyrus-sasl-dev openssl-dev build-base coreutils
WORKDIR /root
RUN git clone https://github.com/edenhill/librdkafka.git
WORKDIR /root/librdkafka
RUN /root/librdkafka/configure
RUN make
RUN make install
#For golang applications
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2

ENV MYSPECIALPROJECT "organization/repository"
WORKDIR /go/src/github.com/$MYSPECIALPROJECT

RUN go get -d -v github.com/confluentinc/confluent-kafka-go/kafka

COPY . .
RUN GOOS=linux go build -a -installsuffix cgo -o app .

ENV PORT 4000
EXPOSE ${PORT}
CMD ["./app"]

This is a bit of a synchronization issue, librdkafka v0.11.4 will be released within a couple of days, in the meantime build librdkafka from source (master branch or v0.11.4-RC1B tag)

I had the same issue.

This worked for me:

apt-get update && apt-get install -y apt-transport-https ca-certificates git curl \
wget pkg-config software-properties-common python3-software-properties

wget -qO - https://packages.confluent.io/deb/5.0/archive.key | apt-key add -

add-apt-repository "deb [arch=amd64] https://packages.confluent.io/deb/5.0 stable main"

apt-get update && apt-get install -y librdkafka-dev librdkafka1

Sorry for the mess, this is a sad side effect of the delay of librdkafka v0.11.4. With a bit of luck we’ll be able to release librdkafka tomorrow 🤞 and the homebrew packages should follow shortly after.

Sorry, my bad, Debian 9 (thru Ubuntu 16.04) is supported, but the librdkafka package is not compatible, which is a bug.

We’re on it.