[ros2doctor] Python exception thrown when following tutorial.
See original GitHub issueBug report
Running ros2 doctor --report
in a Docker container fails with a Python stack trace
Required Info:
- Operating System:
- Ubuntu 18.04.3 in
ros:eloquent
docker image
- Ubuntu 18.04.3 in
- Installation type:
- Docker image, not sure how the docker image itself is built
- Version or commit hash:
- 0.8.6 (as found by
dpkg -S ros2cli
, there is no-v
flag yet)
- 0.8.6 (as found by
- DDS implementation:
- Fast-RTPS (nothing installed additional to what’s in the docker image)
Steps to reproduce issue
I was following https://index.ros.org/doc/ros2/Tutorials/Getting-Started-With-Ros2doctor/#id6 in said docker image:
ros2 doctor
ros2 doctor --report
Expected behavior
An error information about network configuration
Actual behavior
root@5832e3497fea:~/ros2/dev_ws# ros2 doctor
/opt/ros/eloquent/lib/python3.6/site-packages/ros2doctor/api/format.py: 76: UserWarning: ERROR: No loopback IP address is found.
/opt/ros/eloquent/lib/python3.6/site-packages/ros2doctor/api/format.py: 76: UserWarning: Only loopback IP address is found.
/opt/ros/eloquent/lib/python3.6/site-packages/ros2doctor/api/format.py: 76: UserWarning: No multicast IP address is found.
/opt/ros/eloquent/lib/python3.6/site-packages/ros2doctor/api/format.py: 76: UserWarning: Publisher without subscriber detected on /topic.
1/3 checks failed
Failed modules: network
root@5832e3497fea:~/ros2/dev_ws# ros2 doctor --report
NETWORK CONFIGURATION
Traceback (most recent call last):
File "/opt/ros/eloquent/bin/ros2", line 11, in <module>
load_entry_point('ros2cli==0.8.6', 'console_scripts', 'ros2')()
File "/opt/ros/eloquent/lib/python3.6/site-packages/ros2cli/cli.py", line 69, in main
rc = extension.main(parser=parser, args=args)
File "/opt/ros/eloquent/lib/python3.6/site-packages/ros2doctor/command/doctor.py", line 45, in main
format_print(report_obj)
File "/opt/ros/eloquent/lib/python3.6/site-packages/ros2doctor/api/format.py", line 27, in format_print
padding_num = compute_padding(report.items)
File "/opt/ros/eloquent/lib/python3.6/site-packages/ros2doctor/api/format.py", line 40, in compute_padding
check_items = list(zip(*report_items))[0] # get first elements of tuples
IndexError: list index out of range
root@5832e3497fea:~/ros2/dev_ws#
Additional information
Output of ifconfig
, inside the docker container
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.2 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet)
...
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
...
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
8. Errors and Exceptions — Python 3.11.1 documentation
An exception could occur during execution of an except or else clause. Again, the exception is re-raised after the finally clause has been...
Read more >30. Errors and Exception Handling | Python Tutorial
Exception Handling. An exception is an error that happens during the execution of a program. Exceptions are known to non-programmers as ...
Read more >Using ros2doctor to identify issues — ROS 2 Documentation
Goal: Identify issues in your ROS 2 setup using the ros2doctor tool. Tutorial level: Beginner. Time: 10 minutes. Contents. Background. Prerequisites.
Read more >Python KeyError Exceptions and How to Handle Them
In this tutorial, you'll learn how to handle Python KeyError exceptions. ... Note: When an exception is raised in Python, it is done...
Read more >Python Exceptions: The Ultimate Beginner's Guide (with ...
This tutorial covers exceptions in Python, including why they occur, ... A syntax error was thrown since we forgot to close the parenthesis....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem is with
python3-ifcfg
rather thanros2 doctor
maybe, so I proposed a PR there. No change toros2 doctor
is required I think because it already handles errors like this.With https://github.com/ftao/python-ifcfg/pull/45, the output in the docker container is
Having the error up top is quite clear I think and at least the other info is shown.
Manually installing
net-tools
doesn’t seem like a valid fix for this problem. When the user installs the Debian package it should also install necessary dependencies and the user shouldn’t see an exception when invokingros2 doctor
without manually installing other packages.