stenogotchi
stenogotchi copied to clipboard
Failed to initialize D-Bus object: org.freedesktop.DBus.Error.ServiceUnknown: The name com.github.stenogotchi was not provided by any .service files
Receiving the following error though I've made sure the dbus config is copied to /etc/dbus-1/system.d/. I am running on armbian rather than dietpi if that makes any difference.
2022-03-07 15:41:04,259 [Thread-1-engine] INFO: starting stenogotchi_link
extension
2022-03-07 15:41:04,271 [Thread-1-engine] ERROR: [stenogotchi_link] Failed to initialize D-Bus object: org.freedesktop.DBus.Error.ServiceUnknown: The name com.github.stenogotchi was not provided by any .service files
2022-03-07 15:41:04,277 [Thread-1-engine] ERROR: engine start failed
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 177, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
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.NameHasNoOwner: Could not get owner of name 'com.github.stenogotchi': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/plover/engine.py", line 143, in run if func(*args, **kwargs): File "/usr/local/lib/python3.9/dist-packages/plover/engine.py", line 164, in _start self._update(full=True) File "/usr/local/lib/python3.9/dist-packages/plover/engine.py", line 252, in _update self._start_extensions(enabled_extensions - running_extensions) File "/usr/local/lib/python3.9/dist-packages/plover/engine.py", line 288, in _start_extensions extension = registry.get_plugin('extension', extension_name).obj(self) File "/usr/local/lib/python3.9/dist-packages/stenogotchi_link/stenogotchi_link.py", line 33, in init self._btclient = BTClient() File "/usr/local/lib/python3.9/dist-packages/stenogotchi_link/clients.py", line 184, in init self.btkobject = self.bus.get_object(SERVER_DBUS, SERVER_SRVC) File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object return self.ProxyObjectClass(self, bus_name, object_path, File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 250, in init self._named_service = conn.activate_name_owner(bus_name) File "/usr/lib/python3/dist-packages/dbus/bus.py", line 182, in activate_name_owner self.start_service_by_name(bus_name) File "/usr/lib/python3/dist-packages/dbus/bus.py", line 277, in start_service_by_name return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH, 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.ServiceUnknown: The name com.github.stenogotchi was not provided by any .service files
Works fine as long as plover is running as well.
I believe this is a race condition between the startup of stenogotchi and plover. Basically stenogotchi sets up the d-bus service which the plover plugin connects to. If it doesn't exist the plugin fails to initiate. Since more recent versions of plover have decreased the time it takes to load dictionaries this issue has become increasingly likely to occur.
A quick fix is to add a small delay between starting stenogotchi and plover. This can be done by adding a sleep command in .bash_profile. Below example adds a 1 second delay which can be bumped higher if need be. A more robust solution to remove the race condition should be looked into in the future.
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
screen -S stenogotchi -dm python3 /root/stenogotchi/stenogotchi.py --debug
sleep 1
xinit
fi