Skip to content

Conversation

@mini-1235
Copy link

Description

When running ros2 doctor --report, I encountered the following warning:

/opt/ros/rolling/lib/python3.12/site-packages/ros2doctor/api/__init__.py: 262: UserWarning: Fail to call PackageReport class functions.

Additionally, none of the packages displayed their versions. This issue appears to be caused by missing package.xml files in several rmf-* packages. I have already filed a ticket at open-rmf/rmf_traffic#125.

However, I think we could also improve ros2 doctor by catching the exception when parsing packages. https://github.com/ros-infrastructure/catkin_pkg/blob/921fc9e64af6b78fe84cd9dbb92a4d660c3dafa4/src/catkin_pkg/package.py#L571-L584

Is this user-facing behavior change?

Did you use Generative AI?

No

Additional Information

Before this PR, only a warning for package report:

/opt/ros/rolling/lib/python3.12/site-packages/ros2doctor/api/__init__.py: 262: UserWarning: Fail to call PackageReport class functions.

After this PR, ros2 doctor --report now logs warnings for problematic packages instead of silently failing:

Warning: Could not read package at /opt/ros/rolling/share/rmf_task_sequence: Path "/opt/ros/rolling/share/rmf_task_sequence" is neither a directory containing a "package.xml" file nor a file
Warning: Could not read package at /opt/ros/rolling/share/rmf_traffic: Path "/opt/ros/rolling/share/rmf_traffic" is neither a directory containing a "package.xml" file nor a file
Warning: Could not read package at /opt/ros/rolling/share/rmf_task: Path "/opt/ros/rolling/share/rmf_task" is neither a directory containing a "package.xml" file nor a file
Warning: Could not read package at /opt/ros/rolling/share/rmf_utils: Path "/opt/ros/rolling/share/rmf_utils" is neither a directory containing a "package.xml" file nor a file
Warning: Could not read package at /opt/ros/rolling/share/rmf_battery: Path "/opt/ros/rolling/share/rmf_battery" is neither a directory containing a "package.xml" file nor a file

For these packages, the local version field is now left blank in the report:

rmf_task_sequence                         : latest=2.7.0, local=
rmf_utils                                 : latest=1.7.0, local=
rmf_task                                  : latest=2.7.0, local=

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with green CI.

@fujitatomoya fujitatomoya self-assigned this Oct 22, 2025
@fujitatomoya fujitatomoya added the bug Something isn't working label Oct 22, 2025
@fujitatomoya
Copy link
Collaborator

Pulls: #1108
Gist: https://gist.githubusercontent.com/fujitatomoya/8cd3b3f8c569a2c9964f81771d202d64/raw/ff4237245770e3ac99ea1069f374429adc78f825/ros2.repos
BUILD args: --packages-above-and-dependencies ros2doctor
TEST args: --packages-above ros2doctor
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17358

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Signed-off-by: mini-1235 <[email protected]>
@mini-1235
Copy link
Author

mini-1235 commented Oct 23, 2025

@fujitatomoya I think I had a formatting issue earlier, I have fixed it. Can you try to rerun?

@mini-1235
Copy link
Author

@fujitatomoya, anything I can do here? I can't reproduce the test failure locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants