MacOS throwing dyld Error when running kafkacat - macos

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.

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

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.

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

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

Related

running of curl in terminal in mac os give incompatible library version error

While running curl command in mac terminal gives following error:
dyld: Library not loaded: /usr/local/Cellar/curl/7.58.0/lib/libcurl.4.dylib
Referenced from: /usr/local/opt/curl/bin/curl
Reason: Incompatible library version: curl requires version 10.0.0 or later, but libcurl.4.dylib provides version 9.0.0
I tried to add path to bash_profile Its not working . how to make curl work in mac os?
I followed the recommendation from Kamil.S comment and I did those steps to solve the situation:
brew uninstall --force --ignore-dependencies curl
brew install curl
Also had to reinstall things depending on curl afterward (whatever was previously listed as dependent from brew uninstall --force curl):
brew uninstall --force git
brew install git

curl gives an ERROR on Mac OS

when running curl via Terminal, I get the following error:
dyld: Library not loaded: /opt/local/lib/libintl.8.dylib
Referenced from: /opt/local/bin/curl
Reason: image not found
Abort trap: 6
I installed the latest version of Xcode and even "brew install curl" but neither helped. any ideas what is going on??
(OS Sierra)
The issue is that the version of curl installed is incomplete. It appears that it's one installed from MacPorts, since /opt/local/bin/curl is the normal location of where it installs.
The native Apple version is in /usr/bin.
You can either uninstall or reinstall the MacPorts version:
sudo port install curl
or to uninstall
sudo port uninstall curl
↳ MacPorts Common Tasks

Missing symbol when installing ruby-2.3.0 on OS X 10.11.6 by RVM

I was failing to install ruby-2.3.0 by rvm, while it worked with ruby-2.2.0.
The error message is as below
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/Rookie/.rvm/log/1472865655_ruby-2.3.0/make.log
compiling ./missing/explicit_bzero.c
compiling ./missing/setproctitle.c
compiling dmyenc.c
linking miniruby
config.status: creating ruby-runner.c
dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
Referenced from: /Users/Rookie/.rvm/src/ruby-2.3.0/./miniruby (which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _clock_gettime
Referenced from: /Users/Rookie/.rvm/src/ruby-2.3.0/./miniruby (which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib
make: *** [.rbconfig.time] Trace/BPT trap: 5
+__rvm_make:0> return 2
There has been an error while running make. Halting the installation.
/usr/lib/libSystem.B.dylib is where it is...
Is there any way to fix it?
I had the same problem with Ruby 2.3.1 (El Capitan). The good news I solved it. :-)
I followed the installation tutorial on this page: https://gorails.com/setup/osx/10.10-yosemite
After the first step:
brew install rbenv ruby-build
There is a message like: "Install the XCode Command Line Tools." Maybe they need to be reinstalled after updating XCode.
Like suggested, run:
sudo xcode-select --install
After that the Build and Install of Ruby worked for me.
** Mac OSX Sierra **
The answer above suggests to use brew install rbenv ruby-build. I did not have to. Since I do iOS development, I had Xcode installed. But apparently that does not install the xcode command line tools. So I just had to run the following first:
xcode-select --install
I think the linked answer is relevant, my code worked after running the command:
pip install 'pillow!=5.1.0'
Which I found at: https://stackoverflow.com/a/49987984/9902361

Cannot get ffmpeg to work after installing from homebrew

I installed ffmpeg through homebrew but when I try to run it, even just typing in ffmpeg I get the following error message:
dyld: Library not loaded: /usr/local/lib/liblzma.5.dylib
Referenced from: /usr/local/bin/ffmpeg
Reason: Incompatible library version: ffmpeg requires version 8.0.0 or later, but liblzma.5.dylib provides version 6.0.0
Trace/BPT trap: 5
I've tried running brew update and brew upgrade but that didn't change anything. Running brew doctor the only error I get is:
Warning: You have a curlrc file
If you have trouble downloading packages with Homebrew, then maybe this
is the problem? If the following command doesn't work, then try removing
your curlrc:
curl http://github.com
New at doing things in the terminal, what to do next?
I got it to work by running brew search liblzma which told me lzma is now part of the xz formula.
So then I ran brew install xz and tried running ffmpeg again and it works now!
What Worked Today
I'm running OSX Mojave 10.14.5 and got the dyld: Library not loaded: /usr/local/lib/liblzma.5.dylib complaint.
brew install xz did not work
Reinstall worked like a boss
brew uninstall --force ffmpeg && brew install ffmpeg

mosh: dyld: Library not loaded: /usr/local/lib/libprotobuf.7.dylib

I really like mosh (http://mosh.mit.edu/) but after a brew upgrade it stopped working, yielding the below error.
> mosh example.com
dyld: Library not loaded: /usr/local/lib/libprotobuf.7.dylib
Referenced from: /usr/local/bin/mosh-client
Reason: image not found
Died at /usr/local/bin/mosh line 201.
After some digging around I realised that this was due to protobuf had been upgraded and that mosh is hardcoded to use protobuf 2.4.1.
So all I had to do was revert from protobuf 2.5.0 to 2.4.1. On Mac with homebrew this is done by the following steps:
> brew versions protobuf
2.5.0 git checkout 019364d /usr/local/Library/Formula/protobuf.rb
2.4.1 git checkout 544209f /usr/local/Library/Formula/protobuf.rb
> git checkout 544209f /usr/local/Library/Formula/protobuf.rb
> brew unlink protobuf
> brew link protobuf
You shoud reinstall use:
https://mosh.mit.edu/#getting
DO NOT use brew, it work for me on MAC OSX 10.9.5
You could also update brew and then upgrade mosh to 1.2.4:
$ brew update
...
$ brew upgrade mobile-shell
==> Upgrading 1 outdated package, with result:
mobile-shell 1.2.4
==> Upgrading mobile-shell
==> Downloading http://mosh.mit.edu/mosh-1.2.4.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/mobile-shell/1.2.4
==> make install
🍺 /usr/local/Cellar/mobile-shell/1.2.4: 12 files, 1004K, built in 41 seconds
Had same issue, next line helped me:
brew reinstall protobuf

Resources