Protobuf: upgrading from protobuf 2.6.1 to 3.1.0 failing

Created on 16 May 2017  路  17Comments  路  Source: protocolbuffers/protobuf

Hi,

Im currently trying to get a project running on an Nvdia Jetson tx2 using tensorflow however i have hit an error when i run my script over ssh...

$ sudo "export DISPLAY=:0" python Demo_g.py
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally
Using TensorFlow backend.
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.1.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "external/protobuf/src/google/protobuf/any.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): This program requires version 3.1.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "external/protobuf/src/google/protobuf/any.pb.cc".)
Aborted (core dumped)

Obviously I need to upgrade from protobuf 2.6.1 to 3.1.0 however i have built version 3.1.0 as per make instructions here and --version is showing me

$ protoc --version
libprotoc 3.1.0

and which...

$ which protoc
/usr/bin/protoc

If i use locate it looks to me when i use locate there are two versions on here but the actual system files have not updated to 3.1.0 and are still running 2.6.1. Im pretty stuck with this so some steer would be much appreciated.

$ locate libproto
/home/ubuntu/protobuf-3.1.0/cmake/libprotobuf-lite.cmake
/home/ubuntu/protobuf-3.1.0/cmake/libprotobuf.cmake
/home/ubuntu/protobuf-3.1.0/cmake/libprotoc.cmake
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf-lite.a
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf-lite.la
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf-lite.lai
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf-lite.so
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf-lite.so.11
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf-lite.so.11.0.0
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf.a
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf.la
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf.lai
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf.so
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf.so.11
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotobuf.so.11.0.0
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotoc.a
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotoc.la
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotoc.lai
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotoc.so
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotoc.so.11
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotoc.so.11.0.0
/home/ubuntu/protobuf-3.1.0/src/.libs/libprotoc.so.11.0.0T
/home/ubuntu/protobuf-3.1.0/src/libprotobuf-lite.la
/home/ubuntu/protobuf-3.1.0/src/libprotobuf.la
/home/ubuntu/protobuf-3.1.0/src/libprotoc.la
/home/ubuntu/rawto/protobuf-3.1.0/cmake/libprotobuf-lite.cmake
/home/ubuntu/rawto/protobuf-3.1.0/cmake/libprotobuf.cmake
/home/ubuntu/rawto/protobuf-3.1.0/cmake/libprotoc.cmake
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf-lite.a
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf-lite.la
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf-lite.lai
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf-lite.so
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf-lite.so.11
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf-lite.so.11.0.0
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf.a
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf.la
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf.lai
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf.so
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf.so.11
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotobuf.so.11.0.0
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotoc.a
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotoc.la
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotoc.lai
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotoc.so
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotoc.so.11
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotoc.so.11.0.0
/home/ubuntu/rawto/protobuf-3.1.0/src/.libs/libprotoc.so.11.0.0T
/usr/lib/aarch64-linux-gnu/libprotobuf-lite.so.9
/usr/lib/aarch64-linux-gnu/libprotobuf-lite.so.9.0.1
/usr/lib/aarch64-linux-gnu/libprotobuf.so
/usr/lib/aarch64-linux-gnu/libprotobuf.so.9
/usr/lib/aarch64-linux-gnu/libprotobuf.so.9.0.1
/usr/lib/aarch64-linux-gnu/libprotoc.so.9
/usr/lib/aarch64-linux-gnu/libprotoc.so.9.0.1
/usr/lib/chromium-browser/libprotobuf_lite.so
/usr/lib/libprotobuf-lite.a
/usr/lib/libprotobuf-lite.la
/usr/lib/libprotobuf-lite.so
/usr/lib/libprotobuf-lite.so.11
/usr/lib/libprotobuf-lite.so.11.0.0
/usr/lib/libprotobuf.a
/usr/lib/libprotobuf.la
/usr/lib/libprotobuf.so
/usr/lib/libprotobuf.so.11
/usr/lib/libprotobuf.so.11.0.0
/usr/lib/libprotoc.a
/usr/lib/libprotoc.la
/usr/lib/libprotoc.so
/usr/lib/libprotoc.so.11
/usr/lib/libprotoc.so.11.0.0
/usr/lib/libreoffice/program/libprotocolhandlerlo.so
/usr/lib/pulse-8.0/modules/libprotocol-cli.so
/usr/lib/pulse-8.0/modules/libprotocol-http.so
/usr/lib/pulse-8.0/modules/libprotocol-native.so
/usr/lib/pulse-8.0/modules/libprotocol-simple.so
/usr/local/bin/protoc/lib/libprotobuf-lite.la
/usr/local/bin/protoc/lib/libprotobuf-lite.so
/usr/local/bin/protoc/lib/libprotobuf-lite.so.11
/usr/local/bin/protoc/lib/libprotobuf-lite.so.11.0.0
/usr/local/bin/protoc/lib/libprotobuf.la
/usr/local/bin/protoc/lib/libprotobuf.so
/usr/local/bin/protoc/lib/libprotobuf.so.11
/usr/local/bin/protoc/lib/libprotobuf.so.11.0.0
/usr/share/doc/libprotobuf-lite9v5
/usr/share/doc/libprotobuf-lite9v5/changelog.Debian.gz
/usr/share/doc/libprotobuf-lite9v5/copyright
/usr/share/doc/libprotobuf9v5
/usr/share/doc/libprotobuf9v5/changelog.Debian.gz
/usr/share/doc/libprotobuf9v5/copyright
/usr/share/doc/libprotoc9v5
/usr/share/doc/libprotoc9v5/changelog.Debian.gz
/usr/share/doc/libprotoc9v5/copyright
/var/lib/dpkg/info/libprotobuf-lite9v5:arm64.list
/var/lib/dpkg/info/libprotobuf-lite9v5:arm64.md5sums
/var/lib/dpkg/info/libprotobuf-lite9v5:arm64.shlibs
/var/lib/dpkg/info/libprotobuf-lite9v5:arm64.triggers
/var/lib/dpkg/info/libprotobuf9v5:arm64.list
/var/lib/dpkg/info/libprotobuf9v5:arm64.md5sums
/var/lib/dpkg/info/libprotobuf9v5:arm64.shlibs
/var/lib/dpkg/info/libprotobuf9v5:arm64.triggers
/var/lib/dpkg/info/libprotoc9v5:arm64.list
/var/lib/dpkg/info/libprotoc9v5:arm64.md5sums
/var/lib/dpkg/info/libprotoc9v5:arm64.shlibs
/var/lib/dpkg/info/libprotoc9v5:arm64.triggers

customer issue protoc

Most helpful comment

In my case, I remove the environment variable about libprotobuf at etc/bash.bshrc
from
export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libprotobuf.so.9
to
export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libstdc++.so.6

And, I solved.

All 17 comments

The error suggests your binary is somehow linked against libprotobuf.so.9 instead of libprotobuf.so.11

Sorry to be an absolute idiot but how would i link against .so.11 ?

To give a bit more context i have run sudo ldconfig at the end of the process yet still _after_ this i get the output below....

$ ldconfig -p
libprotoc.so.11 (libc6,AArch64) => /usr/lib/libprotoc.so.11
libprotoc.so.9 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libprotoc.so.9
libprotoc.so (libc6,AArch64) => /usr/lib/libprotoc.so
libprotobuf.so.11 (libc6,AArch64) => /usr/lib/libprotobuf.so.11
libprotobuf.so.9 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libprotobuf.so.9
libprotobuf.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libprotobuf.so
libprotobuf.so (libc6,AArch64) => /usr/lib/libprotobuf.so
libprotobuf-lite.so.11 (libc6,AArch64) => /usr/lib/libprotobuf-lite.so.11
libprotobuf-lite.so.9 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libprotobuf-lite.so.9
libprotobuf-lite.so (libc6,AArch64) => /usr/lib/libprotobuf-lite.so

@roryw10 Would it be possible to just uninstall the Ubuntu protobuf package since that is the one that's out of date?

I didn't want to open a new issue as I am trying to upgrade from 2.6.1 to 3.2.0

I downloaded protobuf-cpp-3.2.0.zip and protoc-3.2.0-linux-x86_64.zip from https://github.com/google/protobuf/releases/tag/v3.2.0

I added protoc binaries to Path, so there is no problem here:
$ protoc --version
its gives libprotoc 3.2.0
But I tried C++ Installation - Unix according to README

$ cd protobuf-3.2.0
$ sudo apt-get install autoconf automake libtool curl make g++ unzip
$ ./autogen.sh
$ ./configure
$ make

But _make_ returns following error

what(): This program requires version 3.2.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "google/protobuf/any.pb.cc".)

I tried uninstalling protobuf:
$ sudo -H pip uninstall protobuff
It returns:
Cannot uninstall requirement protobuff, not installed

$locate libprotobuf
/usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9
/usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9.0.1
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9.0.1
/usr/local/MATLAB/R2017a/bin/glnxa64/libprotobuf.so.9
/usr/local/MATLAB/R2017a/bin/glnxa64/libprotobuf.so.9.0.1
/usr/local/MATLAB/R2017a/toolbox/compiler_sdk/mps_clients/c/glnxa64/lib/libprotobuf.so
/usr/local/MATLAB/R2017a/toolbox/compiler_sdk/mps_clients/c/glnxa64/lib/libprotobuf.so.9
/usr/local/MATLAB/R2017a/toolbox/compiler_sdk/mps_clients/c/glnxa64/lib/libprotobuf.so.9.0.1
/usr/share/doc/libprotobuf-lite9v5
/usr/share/doc/libprotobuf9v5
/usr/share/doc/libprotobuf-lite9v5/changelog.Debian.gz
/usr/share/doc/libprotobuf-lite9v5/copyright
/usr/share/doc/libprotobuf9v5/changelog.Debian.gz
/usr/share/doc/libprotobuf9v5/copyright
/var/lib/dpkg/info/libprotobuf-lite9v5:amd64.list
/var/lib/dpkg/info/libprotobuf-lite9v5:amd64.md5sums
/var/lib/dpkg/info/libprotobuf-lite9v5:amd64.shlibs
/var/lib/dpkg/info/libprotobuf-lite9v5:amd64.triggers
/var/lib/dpkg/info/libprotobuf9v5:amd64.list
/var/lib/dpkg/info/libprotobuf9v5:amd64.md5sums
/var/lib/dpkg/info/libprotobuf9v5:amd64.shlibs
/var/lib/dpkg/info/libprotobuf9v5:amd64.triggers

It sounds like the build process is somehow picking up old protobuf headers, probably somewhere in /usr/include or /usr/local/include if you're using Linux. Do you see any old (2.6.1) headers around anywhere?

Yes, I am using linux, and the project I am trying to build depends on protobuf. Thus, I am a complete dummy, sorry.

Do you see any old (2.6.1) headers around anywhere?

What do the headers you mentioned look like?

I would expect them to be in /usr/include/google/protobuf/ or /usr/local/include/google/protobuf, and one example would be message.h.

Indeed, there is /usr/local/MATLAB/R2017a/toolbox/compiler_sdk/mps_clients/python/dist/google/protobuf/pyext/message.h
So, this MATLAB toolbox seems to be causing this issue.

Actually it seems unlikely to me that those headers would have an effect, since I would expect that /usr/local/MATLAB is probably not on the compiler's search path for headers.

Now that I look more carefully at the error message, I think the problem is that the code is being correctly compiled with the 3.2 headers but linked against the old 2.6.1 libraries.

got a similar issue:

[libprotobuf FATAL external/protobuf/src/google/protobuf/stubs/common.cc:78] This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.3.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "out/target/product/r2_cht_hr/gen/SHARED_LIBRARIES/libGLES_trace_intermediates/proto/frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.cc".)terminate called after throwing an instance of 'google::protobuf::FatalException'

It seems to me there are different issues here.

The issue @roryw10 originally reported is likely because the installed tensorflow is built against a different protobuf version from the default version available on the machine. Uninstalling the old 2.6.1 version as suggested by Adam should work.

@oguzhancebe 's issue seems to be caused by building different versions of protobuf in the same directory. Please make sure you have run "make clean" after updating the protobuf source code.

@BIG-CHENG Your issue is likely the same as @roryw10 's. Making sure you have only one version of protobuf installed should be able to solve the problem.

@BIG-CHENG Have you solved you problem? I also come across the same problem.

I am also running into this issue. When I now try to import tensorflow under python I can this error. I tried to download and compile protobuf 3.5.0 but it fails on make check with same error: The only reference to
the old protobuf lib is appears in the ubuntu x68_64 library as follows.

/usr/lib/x86_64-linux-gnu/libprotobuf.so.9

The error is as follows:

[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.4.0 ...but the installed version is 2.6.1.

@rnunziata C++ version of protobuf compiler isn't installed. Download the protobuf-cpp-3.5.1 file from here . Unzip the file. cd into the folder. Run the following commands:
$ ./configure --prefix=/usr
$ make
$ make check
$ sudo make install
$ sudo ldconfig
This worked for me.

I ahve the same issue. I followed the recommendations by allendoss step by step but even that did not help in my case.

how you guys solve this problem?

In my case, I remove the environment variable about libprotobuf at etc/bash.bshrc
from
export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libprotobuf.so.9
to
export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libstdc++.so.6

And, I solved.

Was this page helpful?
0 / 5 - 0 ratings