4

I want to use kafkacat command line utility(https://docs.confluent.io/current/app-development/kafkacat-usage.html) on my MacOS Mojave(10.14.5). I executed the below steps

brew install kafkacat

kafkacat -C -b brokerID -t kafkaTopic -e -K '+'

I am getting the error as below

dyld: lazy symbol binding failed: Symbol not found: _timespec_get
Referenced from: /usr/local/opt/librdkafka/lib/librdkafka.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _timespec_get Referenced from: /usr/local/opt/librdkafka/lib/librdkafka.1.dylib Expected in: /usr/lib/libSystem.B.dylib

Abort trap: 6

I've tried uninstalling and reinstalling kafkacat.

Robin Moffatt
  • 30,382
  • 3
  • 65
  • 92

4 Answers4

2

I ran into the same issue. Looks like it is coming from librdkafka: https://github.com/edenhill/librdkafka/pull/2569 and the last version of Xcode (11). You can either:

  • Uninstall librdkafka / kafkacat brew version (brew uninstall ...). Rebuild librdkafka using the "fixed" branch and then rebuild kafkacat (method I tested) OR
  • Downgrade Xcode to 10.x
a.b.d
  • 2,190
  • 3
  • 26
  • 26
2

I was experiencing same error with librdkafka in macOS Mojave ver. 10.14.6, I had installed Xcode 11.x.

dyld: lazy symbol binding failed: Symbol not found: _timespec_get
  Referenced from: /usr/local/opt/librdkafka/lib/librdkafka.1.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _timespec_get
  Referenced from: /usr/local/opt/librdkafka/lib/librdkafka.1.dylib
  Expected in: /usr/lidyld: lazy symbol binding failedb/libSystem.B: Symbol not found: _timespec_ge.dylib

I found an open issue in Blizzard/node-rdkafka describing the same error. As suggested, I downgraded Xcode from 11.x to 10.3, then rebuild librdkafka

brew install --build-from-source librdkafka

It worked!

By the way, it looks like the fix for librdkafka has just been merged into master.

2

The below worked for me after I read about the issue in https://github.com/edenhill/librdkafka/pull/2569

I uninstalled kafkacat and then librdkafka

brew uninstall kafkacat brew uninstall librdkafka

Then I installed the latest version of kibrdkafka that has the fix but is not available in brew yet like below

brew install librdkafka --HEAD

Then installed kafkacat again

brew install kafkacat

Now the errors are gone and the consumer is connected. Note my XCode version is 11.2.1

dkoder
  • 121
  • 1
  • 2
1
brew uninstall librdkafka
brew uninstall kafkacat

Apart from downgrading Xcode from 11.x to 10.3, installing Command Line Tools for Xcode 10.3 was also required. https://developer.apple.com/download/more/

Downgrading xcode => https://medium.com/@tseboho/how-to-downgrade-xcode-4359df5158d5

brew install --build-from-source librdkafka
brew install kafkacat