Colcon builds but gives ERROR:dbus.connection:Unable to set arguments [closed]

asked 2020-09-28 04:21:18 -0500

Lieu Zheng Hong gravatar image

updated 2020-09-28 11:18:51 -0500

I am following the following tutorial and am trying to build the package. The package builds successfully but it gives me this dbus.connection error. Googling was of no help.

colcon build --packages-select py_pubsub
Starting >>> py_pubsub
Finished <<< py_pubsub [0.46s]          

Summary: 1 package finished [0.55s]
[0.628s] ERROR:dbus.connection:Unable to set arguments ('colcon', 0, '/usr/lib/python3/dist-packages/colcon_notification/desktop_notification/image/colcon-success.ico', '`colcon build` successful', '/home/lieu/dev/imda-scene-understander-pipeline/src', [], {'transient': True}, -1) according to signature 'susssasa{ss}i': <class 'TypeError'>: Expected a string or unicode object
[0.

    628s] ERROR:colcon.colcon_notification.desktop_notification:Exception in desktop notification extension 'notify2': Expected a string or unicode object
    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 643, in call_blocking
        message.append(signature=signature, *args)
    TypeError: Expected a string or unicode object

Results of dpkg -l | grep dbus:

```
ii  at-spi2-core                                     2.36.0-2                                             amd64        Assistive Technology Service Provider Interface (dbus core)
ii  dbus                                             1.12.16-2ubuntu2.1                                   amd64        simple interprocess messaging system (daemon and utilities)
ii  dbus-user-session                                1.12.16-2ubuntu2.1                                   amd64        simple interprocess messaging system (systemd --user integration)
ii  dbus-x11                                         1.12.16-2ubuntu2.1                                   amd64        simple interprocess messaging system (X11 deps)
ii  libdbus-1-3:amd64                                1.12.16-2ubuntu2.1                                   amd64        simple interprocess messaging system (library)
ii  libdbus-1-dev:amd64                              1.12.16-2ubuntu2.1                                   amd64        simple interprocess messaging system (development headers)
ii  libdbus-glib-1-2:amd64                           0.110-5fakssync1                                     amd64        deprecated library for D-Bus IPC
ii  libdbusmenu-glib4:amd64                          16.04.1+18.10.20180917-0ubuntu6                      amd64        library for passing menus over DBus
ii  libdbusmenu-gtk3-4:amd64                         16.04.1+18.10.20180917-0ubuntu6                      amd64        library for passing menus over DBus - GTK+ version
ii  libdbusmenu-gtk4:amd64                           16.04.1+18.10.20180917-0ubuntu6                      amd64        library for passing menus over DBus - GTK+ version
ii  libdbusmenu-qt5-2:amd64                          0.9.3+16.04.20160218-2build1                         amd64        Qt implementation of the DBusMenu protocol
ii  libdleyna-connector-dbus-1.0-1:amd64             0.3.0-1                                              amd64        DBus connector module for the dLeyna services
ii  libkf5dbusaddons-bin                             5.68.0-0ubuntu1                                      amd64        class library for qtdbus
ii  libkf5dbusaddons-data                            5.68.0-0ubuntu1                                      all          class library for qtdbus
ii  libkf5dbusaddons5:amd64                          5.68.0-0ubuntu1                                      amd64        class library for qtdbus
ii  libnet-dbus-perl                                 1.2.0-1                                              amd64        Perl extension for the DBus bindings
ii  libqt5dbus5:amd64                                5.12.8+dfsg-0ubuntu1                                 amd64        Qt 5 D-Bus module
ii  python3-dbus                                     1.2.16-1build1                                       amd64        simple interprocess messaging system (Python 3 interface)
ii  python3-pydbus                                   0.6.0-2build1                                        all          Pythonic D-Bus library (Python 3)
ii  xdg-dbus-proxy                                   0.1.2-1                                              amd64        filtering D-Bus proxy
lieu@pop-os ~> 
```
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by tfoote
close date 2021-08-20 14:40:13.484414

Comments

Compared to my system where I can't reproduce the issue the reported signature is susssasa{sv}i - not susssasa{ss}i. What platform are you on and what version of dbus are you using (dpkg -l | grep dbus)?

Dirk Thomas gravatar image Dirk Thomas  ( 2020-09-28 11:10:33 -0500 )edit

I am on Pop OS 20.04, which is similar to Ubuntu 20.04.

Results of dpkg -l | grep dbus are too long: I am editing the post to add it in.

Lieu Zheng Hong gravatar image Lieu Zheng Hong  ( 2020-09-28 11:18:07 -0500 )edit

Can you please try to apply the patch from https://github.com/colcon/colcon-noti... locally to /usr/lib/python3/dist-packages/notify2.py and check if that works for you?

Dirk Thomas gravatar image Dirk Thomas  ( 2020-09-28 11:21:24 -0500 )edit
Dirk Thomas gravatar image Dirk Thomas  ( 2020-10-01 10:18:11 -0500 )edit

@Dirk Thomas, sorry for the late reply.

My /usr/lib/python3/dist-packages/notify2.py looks different from the one in the GH issue. There doesn't seem to be a notify function.

EDIT: okay, it was in /usr/lib/python3/dist-packages/colcon_notification/desktop_notification/notify2.py. I edited the file but there's still an error:

[0.727s] ERROR:dbus.connection:Unable to set arguments ('colcon', 0, '/usr/lib/python3/dist-packages/colcon_notification/desktop_notification/image/colcon-success.ico', '`colcon build` successful', '/home/lieu/dev/imda-scene-understander-pipeline', [], {'transient': dbus.Byte(1)}, -1) according to signature 'susssasa{ss}i': <class 'TypeError'>: Expected a string or unicode object [0.728s] ERROR:colcon.colcon_notification.desktop_notification:Exception in desktop notification extension 'notify2': Expected a string or unicode object

Lieu Zheng Hong gravatar image Lieu Zheng Hong  ( 2020-10-04 21:42:22 -0500 )edit

Sorry, the file should be in /usr/lib/python3/dist-packages/colcon_notification/desktop_notification/notify2.py.

Dirk Thomas gravatar image Dirk Thomas  ( 2020-10-05 11:56:56 -0500 )edit

@Dirk Thomas, please check my edit.

Lieu Zheng Hong gravatar image Lieu Zheng Hong  ( 2020-10-05 20:14:09 -0500 )edit

It seems the PR doesn't work around the problem. I don't know why the signature type is different (wrong?) for you. Please try to come up with a reproducible example (probably best a Dockerfile) to further triage or a patch which makes it work for you locally which I am happy to review.

Dirk Thomas gravatar image Dirk Thomas  ( 2020-10-06 00:27:57 -0500 )edit