Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf error on ubuntu 18.04 #2496

Closed
osrf-migration opened this issue Jul 14, 2018 · 9 comments
Closed

protobuf error on ubuntu 18.04 #2496

osrf-migration opened this issue Jul 14, 2018 · 9 comments
Labels
9 Gazebo 9 bug Something isn't working major

Comments

@osrf-migration
Copy link

Original report (archived issue) by pierre kancir (Bitbucket: pkancir).

The original report had attachments: log3.txt


Hello,

I try to build an external plugin with gazebo9 on ubunut 8.04 form OSRF repo and it fails with many error like "/usr/include/ignition/msgs1/ignition/msgs/color.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is"
See log file attached

#!bash

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04 LTS
Release:	18.04
Codename:	bionic
#!bash

dpkg -l | grep gazebo9 
ii  gazebo9                                                          9.2.0-1~bionic                       amd64        Open Source Robotics Simulator
ii  gazebo9-common                                                   9.2.0-1~bionic                       all          Open Source Robotics Simulator - Shared files
ii  gazebo9-plugin-base                                              9.2.0-1~bionic                       amd64        Open Source Robotics Simulator - base plug-ins
ii  libgazebo9:amd64                                                 9.2.0-1~bionic                       amd64        Open Source Robotics Simulator - shared library
ii  libgazebo9-dev:amd64                                             9.2.0-1~bionic                       amd64        Open Source Robotics Simulator - Development Files

#!bash

dpkg -l | grep protobuf                                                 2 ↵
ii  libmirprotobuf3:amd64                                            0.31.1-0ubuntu1                      amd64        Display server for Ubuntu - RPC definitions
ii  libprotobuf-dev:amd64                                            3.0.0-9.1ubuntu1                     amd64        protocol buffers C++ library (development files)
ii  libprotobuf-lite10:amd64                                         3.0.0-9.1ubuntu1                     amd64        protocol buffers C++ library (lite version)
ii  libprotobuf10:amd64                                              3.0.0-9.1ubuntu1                     amd64        protocol buffers C++ library
ii  protobuf-c-compiler                                              1.2.1-2                              amd64        Protocol Buffers C compiler (protobuf-c)
ii  protobuf-compiler                                                3.0.0-9.1ubuntu1                     amd64        compiler for protocol buffer definition files
ii  python3-protobuf                                                 3.0.0-9.1ubuntu1                     amd64        Python 3 bindings for protocol buffers

@osrf-migration
Copy link
Author

Original comment by Jiří Kerner (Bitbucket: jiriker).


Hello,

I am experiencing the same issue, but with a different system configuration. I will leave my notes on the issue here and if this is not a proper place, I will open new issue for it later.

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.5 LTS
Release:	16.04
Codename:	xenial

Today I upgraded Gazebo to version

gazebo9/unknown,unknown,now 9.3.0-1~xenial amd64 [installed]

After that in order to be able to compile Gazebo plugins, u installed libgazebo9-dev, that forced me to update libprotobuf-dev and protobuf-compiler from 2.6.1-1.3 to 3.1.0
I dont have a trace of the installation, but if I force downgrade of libprotobuf-dev, I get

sudo apt install libprotobuf-dev=2.6.1-1.3
The following packages will be REMOVED:
  libgazebo9-dev libignition-msgs-dev libignition-transport4-dev libprotoc-dev
The following packages will be DOWNGRADED:
  libprotobuf-dev

I think that while Gazebo 9.3.0 ( at least development package ) is configured to use Protobuf 3.1.0, package

libignition-msgs/unknown,unknown,now 1.0.0-2~xenial amd64 [installed,automatic]

was not updated for release of Gazebo 9.3.0 and that is what is causing these problems. Unfortunately I cannot tell if the case is that Gazebo 9.3.0 updated protobuf and ign-msgs are left behind, or the other way around.

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • set assignee_account_id to "557058:155a32e2-420c-4d50-98e0-0e722f63f906"
  • set assignee to "jrivero (Bitbucket: jrivero, GitHub: j-rivero)"

@osrf-migration
Copy link
Author

Original comment by Jose Luis Rivero (Bitbucket: Jose Luis Rivero, GitHub: j-rivero).


Hello:

Opening the /usr/include/ignition/msgs1/ignition/msgs/color.pb.h file from package version 1.0.0+dfsg1-5 in my Bionic system it shows:

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: ignition/msgs/color.proto

#ifndef PROTOBUF_ignition_2fmsgs_2fcolor_2eproto__INCLUDED
#define PROTOBUF_ignition_2fmsgs_2fcolor_2eproto__INCLUDED

#include <string>

#include <google/protobuf/stubs/common.h>

#if GOOGLE_PROTOBUF_VERSION < 3000000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please update
#error your headers.
#endif
#if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please
#error regenerate this file with a newer version of protoc.
#endif

It seems to be generated by protobuf3. Could you please post instructions about how could I reproduce your problems?
Thanks.

@osrf-migration
Copy link
Author

Original comment by pierre kancir (Bitbucket: pkancir).


Hello,

I have double check and I get the same header than you. I revert back from ubuntu-proposed package, but I still get the error.
I get the problem with those simple instructions :

#!bash

git clone https://github.com/khancyr/ardupilot_gazebo
cd ardupilot_gazebo
mkdir build
cd build
cmake ..
make -j4

Thanks

@osrf-migration
Copy link
Author

Original comment by pierre kancir (Bitbucket: pkancir).


I found the issue.
Because of the manual install of google-cartographer, protobuf3 was manually installed on my system. It overwrite system protobuf install and cannot be uninstall other than with make uninstall... Therefore I get the wrong protobuf compiler installed without knowing it...

Sorry for the noise ... Gazebo is the only projet where I need protobuf, so I didn't notice that before.
I release the error when the file got the right header and GOOGLE_PROTOBUF_VERSION was good in /usr/include/google/protobuf/stubs but the protoc --version return 3.4.0. And ubuntu 18.04 only install protoc 3.0.0 with apt install protobuf-complier.

I am closing this.

@osrf-migration
Copy link
Author

Original comment by pierre kancir (Bitbucket: pkancir).


  • changed state from "new" to "resolved"

@osrf-migration
Copy link
Author

Original comment by Lý Nguyễn (Bitbucket: Lý Nguyễn).


Hi pierre kancir (pkancir) , sorry for the interference. I’m now having problem with Google protobuf. Could you please give me some solution for following problems?

  1. How can I uninstall google protobuf. I don’t know where to use the command make uninstall.
  2. How can I install the proper google protobuf version?

Thanks in advance.

@osrf-migration
Copy link
Author

Original comment by Markus Weber (Bitbucket: Fellfalla).


pierre kancir (pkancir) Can u please describe the steps you took to resolve this issue?
In my case protobuf-compiler is installed via rosdep install --from-paths src --ignore-src -r -y, so there is no make uninstall option that I’m aware of.

@osrf-migration osrf-migration added major bug Something isn't working 9 Gazebo 9 labels Apr 20, 2020
@bromeara
Copy link

Here is a script to remove the invasive protobuf installation. You have to run it as sudo/root, please read what it deletes to make sure it will behave properly on your system but it fixed the issue for me and my team.

#!/bin/bash
​
#Copyright (C) 2020 by Braedon O'Meara <[email protected]>
​
#Permission to use, copy, modify, and/or distribute this software for any purpose
#with or without fee is hereby granted.
​
#THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
#REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
#FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
#INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
#OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
#TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
#THIS SOFTWARE.
​
# This script deletes files that are installed when cartographers
# install_proto3.sh script is run as part of the cartographer ros
# installation instructions
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root"
   exit 1
fi
rm -rfv /usr/local/lib/cmake/protobuf
rm -rfv /usr/local/include/google/protobuf
rmdir -v --ignore-fail-on-non-empty /usr/local/include/google
rm -v /usr/local/lib/pkgconfig/protobuf*
rm -v /usr/local/bin/protoc
rm -v /usr/local/lib/{libprotoc.a,libprotobuf.a,libprotobuf-lite.a}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9 Gazebo 9 bug Something isn't working major
Projects
None yet
Development

No branches or pull requests

2 participants