Kafka symbol lookup error, undefined symbol: rd_kafka_message_leader_epoch

Sometimes when using a program linked with librdkafka, you can encounter the ‘symbol lookup error.

Most of the time it’s because your program have been linked to an old version of librdkafka in your system (like outdated RedHat librdkafka yum package VS the latest build from librdkafka’s git)

Solutions:

-Check your LD_LIBRARY_PATH, be sure to find the directories containing latest librdkafka .so file is listed first

-Check what’s installed on your system
-In some case you will have to rebuild your project, having a proper LD_LIBRARY_PATH configured before

#KAFKA #C #librdkafka

GNU make, get relative PATH for i.e recursive builds with dependencies based on local git copies

In case you’re building yourself everything from source in your project, there is a good chance you once had a problem because you were using relative (like ../myressource) paths in your CFLAGS or LD_FLAGS definition and passed them down to the build system.

Short answer: when getting down in sub directories to i.e build your dependencies, the relative path can’t stay good. Only the absolute path can work.

One solution, if using GNU make, is to use something like this to compute the absolute path:

RES_RELATIVE_PATH=./path_to_my_ressource
RES_ABSOLUTE_PATH=$(realpath $(RES_RELATIVE_PATH))
CFLAGS+= -I$(RES_ABSOLUTE_PATH)

# Note: the naming is up to you. In my case, for something like cJSON, I'm using the following naming:

CJSON_RELPATH=./external/cJSON
CJSON_PATH=$(realpath $(CJSON_RELPATH))
CFLAGS+= -I$(CJSON_PATH)

You can also directly initialize with a shell call:

CJSON_CFLAGS=-I$(shell realpath "./external/cJSON")
CFLAGS+= $(CJSON_FLAGS)

#code #makefile #gnu #path #absolute #relative

Error 407 when using git and a proxy with authentification

Recently I stumbled upon that kind of error when trying to update a submodule:

git submodule update –remote –merge
fatal: unable to access ‘https://github.com/DaveGamble/cJSON.git/’: Received HTTP code 407 from proxy after CONNECT

Turns out that it was the proxy authentification not being sent correctly.
In our case we are using system defined proxy, so we do not need git’s ones

Solved by using:


git config –global http.proxyAuthMethod ‘basic’
git config –global –unset http.proxy
git config –global –unset https.proxy

Some also encountered SSL verification problems due to auto signed certificate use in their network, and had to disable SSL verification. It’ done with the following command, but we do not recommend to use it unless really needed:

git config –global http.sslVerify false