ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

rosbridge_suite: InvalidPackageException: Unable to load the manifest for package rosgraph_msgs.

asked 2016-05-06 02:46:06 -0500

SimonB gravatar image

updated 2016-05-06 04:51:33 -0500

gvdhoorn gravatar image


I'm using the rosbridge internal library to get load the message class for a given message type:

from rosbridge_library import ros_loader
self.msg_class = ros_loader.get_message_class(self.msg_type)

where self.msg_type is, for example, "rosgraph_msgs/Log".

This is generating the following error:

  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbridge_library/internal/", line 88, in get_message_class
    return _get_msg_class(typestring)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbridge_library/internal/", line 128, in _get_msg_class
    return _get_class(typestring, "msg", _loaded_msgs, _msgs_lock)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbridge_library/internal/", line 163, in _get_class
    cls = _load_class(modname, subname, classname)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbridge_library/internal/", line 187, in _load_class
    raise InvalidPackageException(modname, exc)
InvalidPackageException: Unable to load the manifest for package rosgraph_msgs. Caused by: 'NoneType' object has no attribute 'strip'
<Greenlet at 0x7f1c3cc52230: <bound method RosGraphApi.launch_graph of <luxagent.ros_communication.ros_graph_api.RosGraphApi object at 0x7f1c3cc26090>>> failed with InvalidPackageException

This error is occurring on all message types, not just rosgraph_msgs/Log.

Any suggestions would be appreciated.



edit retag flag offensive close merge delete


I'm running on Indigo.

SimonB gravatar image SimonB  ( 2016-05-06 02:51:17 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-05-10 03:42:49 -0500

SimonB gravatar image

This turned out not to be a problem with rosbridge_library at all, but a collateral effect of using gevent in my application. It's highly unlikely that anyone else will come across this, but just in case:

I had to bury down into the depths of roslib to find out where the root exception was occurring. It was in rospkg/

def _read_stdout(cmd):
        pop = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        (std_out, std_err) = pop.communicate()
        # Python 2.6 compatibility
        if isinstance(std_out, str):
            return std_out.strip()
        return std_out.decode(encoding='UTF-8').strip()
        return None

The line pop.communicate() was giving an error 'module' object has no attribute 'poll'.

This led me here:

gevent is a coroutine based sort-of-multitasking library. It monkey patches various system libraries (I should have known better!) and removes the poll() functionality from subprocesses.

The solution is to import gevent like so:

from gevent import monkey; monkey.patch_all(aggressive=False)

instead of:

from gevent import monkey; monkey.patch_all()

My apologies to Jihooni for taking up his time! Thanks again.

edit flag offensive delete link more



+1 for reporting back on the real cause (and a possible work-around).

gvdhoorn gravatar image gvdhoorn  ( 2016-05-10 04:38:16 -0500 )edit

answered 2016-05-07 05:14:30 -0500

jihoonl gravatar image

It looks like rosgraph_msgs is not detect in your ros package path. Make sure that correct ros environment is set in the PC. It cannot find message packages without proper ROS_PACKAGE_PATH setup.

edit flag offensive delete link more




This is created when I do the following before running my app:

source /opt/ros/indigo/setup.bash
source ~/catkin_ws/devel/setup.bash

Is there anything obvious missing?

SimonB gravatar image SimonB  ( 2016-05-07 13:50:42 -0500 )edit


rospack find rosgraph_msgs


Which suggests that ROS_PACKAGE_PATH is ok.

Thanks for the help, Jihooni! Any further ideas appreciated.

SimonB gravatar image SimonB  ( 2016-05-07 13:53:32 -0500 )edit
jihoonl gravatar image jihoonl  ( 2016-05-09 03:22:58 -0500 )edit

Question Tools

1 follower


Asked: 2016-05-06 02:46:06 -0500

Seen: 1,977 times

Last updated: May 10 '16