Node-rdkafka: fatal error:sasl/sasl.h: No such file or directory

Created on 27 Dec 2017  路  3Comments  路  Source: Blizzard/node-rdkafka

has meet this problem both in Mac & Linux.
tried to fixed by brew openssl on Mac , and successed .
but now in Linux failed . also run apt-get install openssl yum install libssl-dev with a result of not found the package.
below is the error infos.
thanks

mycomputer:~/testKafkaUseAli/appTest$ npm install

> [email protected] install /home/my/testKafkaUseAli/appTest/node_modules/node-rdkafka
> node-gyp rebuild

make: Entering directory `/home/my/testKafkaUseAli/appTest/node_modules/node-rdkafka/build'
  ACTION configuring librdkafka... deps/librdkafka/config.h
checking for OS or distribution... ok (Ubuntu)
checking for C compiler from CC env... failed
checking for gcc (by command)... ok
checking for C++ compiler from CXX env... failed
checking for C++ compiler (g++)... ok
checking executable ld... ok
checking executable nm... ok
checking executable objdump... ok
checking executable strip... ok
checking for pkgconfig (by command)... ok
checking for install (by command)... ok
checking for PIC (by compile)... ok
checking for GNU-compatible linker options... ok
checking for GNU linker-script ld flag... ok
checking for __atomic_32 (by compile)... ok
checking for __atomic_64 (by compile)... ok
checking for socket (by compile)... ok
parsing version '0x000905ff'... ok (0.9.5)
checking for libpthread (by pkg-config)... failed
checking for libpthread (by compile)... ok
checking for zlib (by pkg-config)... ok
checking for zlib (by compile)... ok
checking for libcrypto (by pkg-config)... ok
checking for libcrypto (by compile)... ok
checking for liblz4 (by pkg-config)... failed
checking for liblz4 (by compile)... failed (disable)
checking for libssl (by pkg-config)... ok
checking for libssl (by compile)... ok
checking for libsasl2 (by pkg-config)... failed
checking for libsasl2 (by compile)... failed (disable)
checking for libsasl (by pkg-config)... failed
checking for libsasl (by compile)... failed (disable)
checking for regex (by compile)... ok
checking for librt (by pkg-config)... failed
checking for librt (by compile)... ok
checking for strndup (by compile)... ok
checking for nm (by env NM)... ok (cached)
checking for python (by command)... ok
Generated Makefile.config
Generated config.h

Configuration summary:
  prefix                   /usr/local
  ARCH                     x86_64
  CPU                      generic
  GEN_PKG_CONFIG           y
  ENABLE_DEVEL             n
  ENABLE_VALGRIND          n
  ENABLE_REFCNT_DEBUG      n
  ENABLE_SHAREDPTR_DEBUG   n
  ENABLE_LZ4_EXT           y
  ENABLE_SSL               y
  ENABLE_SASL              y
  MKL_APP_NAME             librdkafka
  MKL_APP_DESC_ONELINE     The Apache Kafka C/C++ library
  MKL_DISTRO               Ubuntu
  CC                       gcc
  CXX                      g++
  LD                       ld
  NM                       nm
  OBJDUMP                  objdump
  STRIP                    strip
  CPPFLAGS                 -I/usr/local/opt/openssl/include -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align
  LDFLAGS                  -L/usr/local/opt/openssl/lib
  PKG_CONFIG               pkg-config
  INSTALL                  install
  LIB_LDFLAGS              -shared -Wl,-soname,$(LIBFILENAME)
  LDFLAG_LINKERSCRIPT      -Wl,--version-script=
  RDKAFKA_VERSION_STR      0.9.5
  MKL_APP_VERSION          0.9.5
  LIBS                     -lpthread -lz   -lz -lcrypto   -lcrypto -lssl -lcrypto   -lssl -lrt
  CFLAGS
  CXXFLAGS                 -Wno-non-virtual-dtor
  SYMDUMPER                $(NM) -D
  exec_prefix              /usr/local
  bindir                   /usr/local/bin
  sbindir                  /usr/local/sbin
  libexecdir               /usr/local/libexec
  datadir                  /usr/local/share
  sysconfdir               /usr/local/etc
  sharedstatedir           /usr/local/com
  localstatedir            /usr/local/var
  libdir                   /usr/local/lib
  includedir               /usr/local/include
  infodir                  /usr/local/info
  mandir                   /usr/local/man
Generated config.cache

Now type 'make' to build
  TOUCH Release/obj.target/deps/librdkafka_config.stamp
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_roundrobin_assignor.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_request.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_event.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdgz.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_buf.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_op.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_cgrp.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_broker.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_subscription.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdregex.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_conf.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/xxhash.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/lz4hc.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_assignor.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/lz4.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_pattern.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_metadata.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_topic.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_range_assignor.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/lz4frame.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/regexp.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdaddr.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/tinycthread.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_partition.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdlog.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdlist.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_timer.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdports.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdstring.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_offset.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdavl.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdcrc32.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/snappy.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_metadata_cache.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_queue.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_msg.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_feature.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdrand.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_transport.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_sasl_cyrus.o
../deps/librdkafka/src/rdkafka_sasl_cyrus.c:39:23: fatal error: sasl/sasl.h: No such file or directory
 #include <sasl/sasl.h>
                       ^
compilation terminated.
make: *** [Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_sasl_cyrus.o] Error 1
make: Leaving directory `/home/my/testKafkaUseAli/appTest/node_modules/node-rdkafka/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/my/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.2.0-42-generic
gyp ERR! command "/home/my/.nvm/versions/node/v8.9.1/bin/node" "/home/my/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/my/testKafkaUseAli/appTest/node_modules/node-rdkafka
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/my/.npm/_logs/2017-12-27T07_33_50_625Z-debug.log

Most helpful comment

final I fixed the problem on Linux.
Here are some tips.

  • the node-rdkafka module relay on some system module ,such as ssl sasl ...
  • most of them is easy to build or in system, but some not depend on the different system
  • you can install the missing module by yum or apt-get
  • some of the module you searched in net may not exist , you should find another to replace it . eg. ibsasl2-dev to replace the cyrus-sasl-devel cyrus-sasl-lib
  • on linux , best to use apt-cache search sasl to find the sasl's similiar module.

All 3 comments

sorry for my mistake ,the package not found is cyrus-sasl-devel & cyrus-sasl-lib

final I fixed the problem on Linux.
Here are some tips.

  • the node-rdkafka module relay on some system module ,such as ssl sasl ...
  • most of them is easy to build or in system, but some not depend on the different system
  • you can install the missing module by yum or apt-get
  • some of the module you searched in net may not exist , you should find another to replace it . eg. ibsasl2-dev to replace the cyrus-sasl-devel cyrus-sasl-lib
  • on linux , best to use apt-cache search sasl to find the sasl's similiar module.

Thanks for posting your solution here!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michallevin picture michallevin  路  5Comments

klalafaryan picture klalafaryan  路  5Comments

meierval picture meierval  路  4Comments

ivomirra picture ivomirra  路  3Comments

jdowning picture jdowning  路  4Comments