Robotics StackExchange | Archived questions

ROS2 build faild on i3WM

Hi, Guys. I try to build ros2 project on i3wm with ros2-galactic version on ubuntu20.04. But it failed, here is the wrong msgs.

Starting >>> ros2_beginner
Finished <<< ros2_beginner [0.17s]

Summary: 1 package finished [0.31s]
[1.655s] ERROR:colcon.colcon_notification.desktop_notification:Exception in desktop notification extension 'notify2': org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/colcon_notification/desktop_notification/__init__.py", line 106, in notify
    retval = extension.notify(
  File "/usr/lib/python3/dist-packages/colcon_notification/desktop_notification/notify2.py", line 51, in notify
    self._last_notification.show()
  File "/usr/lib/python3/dist-packages/notify2.py", line 181, in show
    nid = dbus_iface.Notify(appname,       # app_name       (spec names)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying

GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying

but when I exchange to ubuntu desktop, the build works.

Does anyone can help me out? Many thanks.

Asked by anastasia on 2023-03-13 07:00:45 UTC

Comments

Answers

It's possible this is caused by colcon_notification trying to post a desktop notification to your WM (which would be i3).

You could add --event-handlers desktop_notification- to your colcon build command (note the final - after desktop_notification, it disables the notification).

See also Event handler arguments in the Colcon user manual.

If this makes the build succeed, you could consider disabling the notification extension completely by setting the environment variable COLCON_EXTENSION_BLOCKLIST=colcon_core.event_handler.desktop_notification (in your .bashrc, or whichever file your shell happens to use to configure itself upon starting). That was discussed here.

All of this would only be a work-around of course. The better option would be to debug why colcon_notification doesn't work with i3 as the WM. It could also be your just missing some part of i3 that's needed for notifications from Colcon to work correctly. The author/maintainer of colcon_notification would probably appreciate a PR fixing this particular issue.

Asked by gvdhoorn on 2023-03-13 09:16:20 UTC

Comments

Thanks, I add --event-handlers desktop_notification- ,it works. but failed to use COLCON_EXTENSION_BLACKLIST=colcon_core.event_handler.desktop_notification , I write to my ~/.bashrc, it doesn't work.

Asked by anastasia on 2023-03-14 08:50:33 UTC

You did add export to it, correct?

Asked by gvdhoorn on 2023-03-14 08:52:33 UTC

Every desktop should have a notifcation daemon, and colcon won't be the last application that runs into that problem. Just because i3 doesn't come with one installed, doesn't mean you don't need one. I recommend you install & configure https://github.com/dunst-project/dunst

Asked by bionade24 on 2023-03-13 11:15:18 UTC

Comments

Thanks, I will try with that. it seems like need time to learn how to config.

Asked by anastasia on 2023-03-14 08:51:40 UTC