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

ROS master crashing due to XMLRPC error

asked 2018-02-01 07:35:32 -0600

Cerin gravatar image

updated 2018-02-01 08:34:13 -0600

I restarted my robot, running ROS Kinetic on a Raspberry Pi, and I'm finding that the master node is immediately crashing on startup with the error:

auto-starting new master
process[master]: started with pid [7708]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 5dab8662-0754-11e8-a585-b827eb09ee17
process[rosout-1]: started with pid [7721]
started core service [/rosout]
load_parameters: unable to set parameters (last param was [/head_arduino/serial_node/baud=115200]): cannot marshal None unless allow_none is enabled
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 307, in main
    p.start()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 279, in start
    self.runner.launch()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 654, in launch
    self._setup()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 641, in _setup
    self._load_parameters()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 338, in _load_parameters
    r  = param_server_multi()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1006, in __call__ 
    return MultiCallIterator(self.__server.system.multicall(marshalled_list))
  File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__ 
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1596, in __request
    allow_none=self.__allow_none)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1094, in dumps
    data = m.dumps(params)
  File "/usr/lib/python2.7/xmlrpclib.py", line 638, in dumps
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 660, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 719, in dump_array
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 660, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 741, in dump_struct
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 660, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 719, in dump_array
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 660, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 664, in dump_nil  
    raise TypeError, "cannot marshal None unless allow_none is enabled"
TypeError: cannot marshal None unless allow_none is enabled
[rosout-1] killing on exit
[master] killing on exit

Looking in my ~/.ros/latest/latest/roslaunch-rae-8050.log I also see the lines:

[roslaunch][INFO] '2018-02-01 08:55:26': load_parameters starting ...
[roslaunch][ERROR] '2018-02-01 08:55:26': load_parameters: unable to set parameters (last param was [/head_arduino/serial_node/baud=115200]): cannot marshal None unless allow_none is enabled

What's causing this?

My node /head_arduino/serial_node/baud=115200 is just a stock rosserial serial_node.py instance launched with:

<launch>
    <group ns="head_arduino">
        <node pkg="rosserial_python" type="serial_node.py" name="serial_node" output="screen">
            <param name="~port" value="/dev/ttyACM0" />
            <param name="~baud" value="115200" />
        </node>
    </group>
</launch>

Clearly, none of its parameters are None.

Googling the error suggests it's a generic exception thrown by xmlrpclib when an XMLRPC endpoint receives a bad ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-02-02 09:28:40 -0600

Cerin gravatar image

Since the error message doesn't specify the launch file causing the error, I was forced to go through my top-level launch file, comment everything out, and then one by one, re-enable each child launch file, and then re-run it, testing to see if I received the error.

This allowed me to track the error down to my launch file for the diagnostics_aggregator. Again, the launch file itself doesn't pass in any blank or None values. However, I was loading a configuration file with:

<rosparam command="load" file="$(find myrobot)/config/analyzers.yaml" />

I checked this file, and sure enough, it was corrupt. I re-uploaded this file, and that resolved the issue.

edit flag offensive delete link more
1

answered 2018-02-02 00:46:16 -0600

ahendrix gravatar image

As you've found, roslaunch is crashing because some parameter isn't specified correctly.

The roscore itself is fine; this error happens when roslaunch tries to set a parameter. the order of operations is roughly:

  • roslaunch starts
  • roslaunch sees that a roscore is not running, so it starts one
  • roslaunch tries to set parameters. One of them is bad, so roslaunch decides to shut down
  • since roslaunch started the roscore, when it is shutting down it stops the roscore.
    • Note that roslaunch says killing on exit for the roscore and rosout processes.

roslaunch is printing the last parameter that was loaded successfully. Since that's the last parameter in your serial_head.launch, and the next file included is serial_torso.launch, it would make sense to look in serial_torso.launch for your error.

edit flag offensive delete link more

Comments

My parameters in the launch files appear to be fine. The parameters in my serial_torso are all identical to serial_head.

Cerin gravatar image Cerin  ( 2018-02-02 08:27:37 -0600 )edit

This has been running perfectly for months, and I haven't changed any code. The only thing that changed was I had power loss on my Pi, after which this problem suddenly started happening, suggesting the problem is data corruption.

Cerin gravatar image Cerin  ( 2018-02-02 08:28:13 -0600 )edit

The problem is that the launch files aren't executed sequentially, so simply looking at the "last launch file" doesn't help. Every run, I'm getting a different "last successfully loaded parameter". This is very frustrating that it won't tell me the source of the underlying error.

Cerin gravatar image Cerin  ( 2018-02-02 09:28:02 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2018-02-01 07:35:32 -0600

Seen: 2,419 times

Last updated: Feb 02 '18