Replies: 2 comments
-
Hello, I'm using precompiled signal-cli, Docker, Alpine Linux, and Pydbus or Dasbus to access the D-Bus interface. The root cause of the problem: signal-cli publishes 2 D-Bus methods with the same name:
The Python library doesn't care which method to use - and creates the proxy objects for one or the other, randomly. A careless user (me) calls it. def onMessageReceived(self, timestamp, source, group_id, message, attachments):
self.signal.sendMessage('ping', [], source) If the proxy object is bound to the
(Fortunately for me, those numbers weren't registered in the Signal service. 😌) As pointed out in LEW21/pydbus#19, referring https://dbus.freedesktop.org/doc/dbus-java/dbus-java/dbus-javase1.html: D-Bus does not support method overloading, only one method or signal should exist with each name. I suspect that renaming all the duplicate methods in signal-cli daemon is the right way to resolve. Meanwhile, my dirty hack looks like: def sendSignalMessage(self, message, attachments, dest):
try:
ts = self.signal.sendMessage(message, attachments, [dest]) # BUG in signal-cli: 2 D-Bus methods with the same name.
except TypeError as e:
ts = self.signal.sendMessage(message, attachments, dest) Cheers, P.S. This is my setup:
|
Beta Was this translation helpful? Give feedback.
-
Other signal-cli issues that match the topic of calling overloaded D-Bus methods using pydbus: |
Beta Was this translation helpful? Give feedback.
-
Hi!
I am running signal-cli on system daemon and most of it works pretty well.
However, sometimes, it complains with the source parameter of the sendMessage method.
When i send it like this, it sometimes throws the error that it "must be string not list":
Then I changed the source parameter from list to string, which worked for some time but stopped working without any error again:
I then changed it again from a string to a list which worked.
Am I missing something? I don't really understand why it sometimes just stops working with the given error in the title and sometimes it works.
Edit:
Just got this situation again. Started a script on boot via systemd which uses the dbus. Service didn't start because it fails sending a message with this error:
Traceback (most recent call last): File "/home/pi/signal-receive.py", line 235, in <module> signal.sendMessage("Service started",[],[ADMIN]) File "/home/pi/.local/lib/python3.9/site-packages/pydbus/proxy_method.py", line 74, in __call__ self._iface_name, self.__name__, GLib.Variant(self._sinargs, args), GLib.VariantType.new(self._soutargs), File "/usr/lib/python3/dist-packages/gi/overrides/GLib.py", line 189, in __new__ v = creator._create(format_string, value) File "/usr/lib/python3/dist-packages/gi/overrides/GLib.py", line 150, in _create builder.add_value(self._create(dup, i)) File "/usr/lib/python3/dist-packages/gi/overrides/GLib.py", line 118, in _create return self._LEAF_CONSTRUCTORS[format](value) TypeError: Must be string, not list
ADMIN = a phone number like '+491750000000'
The script which starts on boot and which fails with sendMessage looks like this:
I run into this issue after doing a
sudo reboot
. Even manually executing the python script which should start on boot throws this error now. It worked well before I did the reboot.Any idea what's going on?
Beta Was this translation helpful? Give feedback.
All reactions