kozec / syncthing-gtk

GTK3 & python based GUI for Syncthing
GNU General Public License v2.0
1.28k stars 138 forks source link

Crashing with KeyError in daemon.py _syncthing_cb_connections when starting daemon #582

Open osmeest opened 2 years ago

osmeest commented 2 years ago

Running syncthing-gtk 0.9.4.4+ds+git20201209+c46fbd8-1 on Ubuntu 21.10, syncthing-gtk crashes after starting the daemon from the app. There are two potential KeyError being thrown in line 499 and following as "paused" and "connected" might not yet be present in cons[id]. Their presence should be checked before testing their values.

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/syncthing_gtk/daemon.py", line 1166, in _response self._callback(rdata, *self._callback_data) File "/usr/lib/python3/dist-packages/syncthing_gtk/daemon.py", line 499, in _syncthing_cb_connections if cons[id]["paused"]: KeyError: 'paused'

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/syncthing_gtk/daemon.py", line 1166, in _response self._callback(rdata, *self._callback_data) File "/usr/lib/python3/dist-packages/syncthing_gtk/daemon.py", line 505, in _syncthing_cb_connections if cons[id]["connected"]: KeyError: 'connected'

line 499: if cons[id]["paused"]: ==> if "paused" in cons[id] and cons[id]["paused"]: line 505: if cons[id]["connected"]: ==> if "connected" in cons[id] and cons[id]["connected"]:

eugenesan commented 2 years ago

Same on Ubuntu Mate 22.04.

gtubolcev commented 1 year ago

same on Xubuntu 22.04.

fmjrey commented 1 year ago

Experiencing this bug. Any idea how to resolve/workaround?

osmeest commented 1 year ago

Project has moved to a more generic https://github.com/syncthing-gtk/syncthing-gtk/. A new tag (0.9.4.5) has been made but problem probably still exists (lines have moved to 534 but the test is still not protected against absence of "paused" or "connected" in cons[id].