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

roscore won't run: "could not contact master"

asked 2012-10-10 14:27:23 -0500

ssafarik gravatar image

updated 2012-10-11 08:36:01 -0500

Hi all. roscore won't run, and I've tried starting from as clean a system as I can make it. It used to work, and the network config hasn't changed, and all the environment vars are good as they've always been. I can ping myself by ip, by localhost, and by hostname. I've apparently screwed something up somewhere, but fresh installs of all the various ros stuff don't seem to fix it. Any ideas on what to check? Thanks.

Steve.

$ roscore
... logging to /home/rancher/.ros/log/e5678e18-1338-11e2-9087-5404a6b86db0/roslaunch-flyatar-2199.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://flyatar:48980/
ros_comm version 1.8.10

SUMMARY
========

PARAMETERS
 * /rosdistro
 * /rosversion

NODES

auto-starting new master
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[master]: started with pid [2249]
ERROR: could not contact master [http://flyatar:11311/]
[master] killing on exit
Traceback (most recent call last):
  File "/opt/ros/fuerte/bin/rosmaster", line 35, in <module>
    rosmaster.rosmaster_main()
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rosmaster/main.py", line 73, in rosmaster_main
    configure_logging()   
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rosmaster/main.py", line 57, in configure_logging
    _log_filename = rosgraph.roslogging.configure_logging('rosmaster', logging.DEBUG, filename=filename)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rosgraph/roslogging.py", line 86, in configure_logging
    rosgraph_d = rospkg.RosPack().get_path('rosgraph')
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 147, in get_path
    self._update_location_cache()
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 130, in _update_location_cache
    list_by_path(self._manifest_name, path, cache)
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 56, in list_by_path
    for d, dirs, files in os.walk(path, topdown=True, followlinks=True):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 276, in walk
    names = listdir(top)
KeyboardInterrupt
$

rancher@flyatar:~$ cat /etc/hostname
flyatar
rancher@flyatar:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 54:04:a6:b8:6d:b0  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17 Memory:fb900000-fb920000 

eth1      Link encap:Ethernet  HWaddr 54:04:a6:b8:75:9c  
          inet addr:172 ...
(more)
edit retag flag offensive close merge delete

Comments

2

Can you post the following: cat /etc/hostname, ifconfig, echo $ROS_MASTER_URI, echo $ROS_IP, echo $ROS_HOSTNAME

jbohren gravatar image jbohren  ( 2012-10-10 16:57:56 -0500 )edit

Also inspect the logfiles in .ros/logs

KruseT gravatar image KruseT  ( 2012-10-11 00:53:28 -0500 )edit

I edited the question above with the info. I'm just going to move on, and do a new OS install, so figuring this out isn't really crucial.

ssafarik gravatar image ssafarik  ( 2012-10-11 07:00:30 -0500 )edit

Can you also post /etc/hosts ?

PerkinsJames gravatar image PerkinsJames  ( 2012-10-11 07:38:33 -0500 )edit

Note also that this is 32bit Ubuntu precise.

ssafarik gravatar image ssafarik  ( 2012-10-11 08:36:31 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-11-24 01:33:16 -0500

K Chen gravatar image

updated 2012-11-24 15:33:19 -0500

In this month I encountered the similar problem twice, one time with some other guy's ROS Fuerte under Ubuntu Precise 64bit, and now with my own computer under Ubuntu Precise 32bit... Just now I tried to run roscore but it could not start after some time of waiting, throwing out almost the same error messages:


... logging to /home/kai/.ros/log/8bd2c78c-3638-11e2-b312-14dae93037a4/roslaunch-Kai-System-27427.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://Kai-System:50291/
ros_comm version 1.8.10

SUMMARY
========

PARAMETERS
 * /rosdistro
 * /rosversion

NODES

auto-starting new master
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading'="" from="" '="" usr="" lib="" python2.7="" threading.pyc'=""> ignored
process[master]: started with pid [27448]
ERROR: could not contact master [http://Kai-System:11311/]
[master] killing on exit
Traceback (most recent call last):
  File "/opt/ros/fuerte/bin/rosmaster", line 35, in <module>
    rosmaster.rosmaster_main()
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rosmaster/main.py", line 73, in rosmaster_main
    configure_logging()   
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rosmaster/main.py", line 57, in configure_logging
    _log_filename = rosgraph.roslogging.configure_logging('rosmaster', logging.DEBUG, filename=filename)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rosgraph/roslogging.py", line 86, in configure_logging
    rosgraph_d = rospkg.RosPack().get_path('rosgraph')
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 162, in get_path
    self._update_location_cache()
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 145, in _update_location_cache
    list_by_path(self._manifest_name, path, cache)
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 57, in list_by_path
    for d, dirs, files in os.walk(path, topdown=True, followlinks=True):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 284, in walk
    if isdir(join(top, name)):
  File "/usr/lib/python2.7/genericpath.py", line 41, in isdir
    st = os.stat(s)
KeyboardInterrupt

My ROS configurations has not been touched since last time I run it(no more than a week), so I also think the problem lies in somewhere else.

I will try rebooting and stopping vpns to see if it helps.

Update: Seems this is not a easy to solve problem. The last time I asked that guy to re-install a 32bit ubuntu and the problem disappeared, but this time I don't think this is a good idea. More info: I did not use "rosws" but the old-fashioned way of configuring ROS env. Here is a list:


kai@Kai-System> export | grep ROS
ROSLISP_PACKAGE_DIRECTORY=/opt/ros/fuerte/share/common-lisp/ros
ROS_DISTRO=fuerte
ROS_ETC_DIR=/opt/ros/fuerte/etc/ros
ROS_MASTER_URI=http://localhost:11311
ROS_PACKAGE_PATH=/home/kai/Projects:/home/kai/ros_stacks:/opt/ros/fuerte ...
(more)
edit flag offensive delete link more
0

answered 2012-10-11 10:13:49 -0500

jbohren gravatar image

updated 2012-10-11 10:14:05 -0500

Really, setting $ROS_IP and $ROS_HOSTNAME should be mutually exclusive. If you need to specify your machine explicitly, choose one or the other.

Then you have two options:

  1. Set $ROS_MASTER_URI to either "http://flyatar:11311" or "http://172.25.253.72:11311" depending on whether you're using $ROS_HOSTNAME or $ROS_IP, respectively.

  2. Un-set $ROS_IP and un-set $ROS_HOSTNAME, leaving $ROS_MASTER_URI as "http://localhost:11311".

edit flag offensive delete link more

Comments

I'm running, but still confusing to me, why you can't use both, even if not needed. And don't you need both $ROS_HOSTNAME $ROS_MASTER_URI ?

KM6VV gravatar image KM6VV  ( 2012-10-11 12:12:52 -0500 )edit

I tried all the various combinations of setting those vars, and none of it made a difference. The problem was some unknown other place, but I've since wiped the machine and reinstalled everything, and now all is well.

ssafarik gravatar image ssafarik  ( 2012-10-12 13:12:42 -0500 )edit

Question Tools

Stats

Asked: 2012-10-10 14:27:23 -0500

Seen: 7,357 times

Last updated: Nov 24 '12