Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App still unresponsive #428

Closed
jtojnar opened this issue Feb 24, 2018 · 11 comments
Closed

App still unresponsive #428

jtojnar opened this issue Feb 24, 2018 · 11 comments

Comments

@jtojnar
Copy link

jtojnar commented Feb 24, 2018

After update to 0.9.3, I tried removing ~/.config/syncthing{,-gtk} but the app still freezes on starting Syncthing daemon – cannot even click Quit.

image

W Configuration Failed to load configuration; Creating new one.
W Configuration Reason: (IOError(2, 'No such file or directory'),)
D UIBuilder     Enabled: header_bar
D UIBuilder     Enabled: is_gnome
D UIBuilder     Enabled: icons_in_menu
D UIBuilder     Loading glade file /nix/store/czvpna3wm40lvi393kcz9n3741xgrsjj-syncthing-gtk-0.9.3/share/syncthing-gtk/app.glade
D UIBuilder     Enabled conditions: set([u'icons_in_menu', u'is_gnome', u'header_bar'])
D UIBuilder     Removed 'property' by attribute: is_windows
D UIBuilder     Removed 'property' by attribute: is_windows
D UIBuilder     Allowed node icons_in_menu | old_gtk
D UIBuilder     Removed 'property' by attribute: is_windows
D UIBuilder     Removed node !is_gnome | old_gtk
D UIBuilder     Allowed node icons_in_menu | old_gtk
D UIBuilder     Removed 'property' by attribute: old_gtk
D UIBuilder     Allowed node icons_in_menu | old_gtk
D UIBuilder     Allowed node icons_in_menu | old_gtk
D UIBuilder     Removed 'child' by attribute: traditional_header
D UIBuilder     Removed 'child' by attribute: is_windows
D UIBuilder     Allowed node icons_in_menu | old_gtk
D UIBuilder     Removed 'property' by attribute: is_windows
D UIBuilder     Removed node traditional_header
D UIBuilder     Allowed node traditional_header | icons_in_menu
I StatusIcon    Using backend StatusIconGTK3 (primary)
D Daemon        Reading syncthing config /home/jtojnar/.config/syncthing/config.xml

(.syncthing-gtk-wrapped:20878): Gdk-CRITICAL **: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
I Wizard        syncthing-gtk: Configuration directory: '/home/jtojnar/.config/syncthing'
I Wizard        syncthing-gtk: Syncthing configuration directory: /home/jtojnar/.config/syncthing
I Wizard        04:15:07 INFO: Device ID: Z2TIVR3-L3JBVNA-N4P27HB-JBCLF57-DNSB5PM-TH3CRSM-2G6JNSD-44AL2QQ
I Wizard        04:15:07 INFO: Default folder created and/or linked to new config
I DaemonProcess Subprocess finished with code 0
I Wizard        syncthing-gtk: chosen port 8080
D Wizard        Generated apikey 81jugk3rbteshm0ouomkvcxmf9wqlc
D Daemon        Reading syncthing config /home/jtojnar/.config/syncthing/config.xml
V Notifications Error notifications enabled
V Notifications File update notifications enabled
E Daemon        g-io-error-quark: Could not connect to 127.0.0.1: Connection refused (39)
Traceback (most recent call last):
  File "/nix/store/czvpna3wm40lvi393kcz9n3741xgrsjj-syncthing-gtk-0.9.3/lib/python2.7/site-packages/syncthing_gtk/daemon.py", line 1050, in _connected
    self._connection = self.connect_to_service_finish(results)
Error: g-io-error-quark: Could not connect to 127.0.0.1: Connection refused (39)
D App           Creating connect_dialog
V App           Settinig connect_dialog label Starting Syncth
E Daemon        g-io-error-quark: Could not connect to 127.0.0.1: Connection refused (39)
Traceback (most recent call last):
  File "/nix/store/czvpna3wm40lvi393kcz9n3741xgrsjj-syncthing-gtk-0.9.3/lib/python2.7/site-packages/syncthing_gtk/daemon.py", line 1050, in _connected
    self._connection = self.connect_to_service_finish(results)
Error: g-io-error-quark: Could not connect to 127.0.0.1: Connection refused (39)
E Daemon        g-io-error-quark: Could not connect to 127.0.0.1: Connection refused (39)
Traceback (most recent call last):
  File "/nix/store/czvpna3wm40lvi393kcz9n3741xgrsjj-syncthing-gtk-0.9.3/lib/python2.7/site-packages/syncthing_gtk/daemon.py", line 1050, in _connected
    self._connection = self.connect_to_service_finish(results)
Error: g-io-error-quark: Could not connect to 127.0.0.1: Connection refused (39)
D InfoBox       kaiser state changed to Disconnected
/nix/store/98bghm0wfyh6ygvr0yg6slyl5xnnj5hs-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/module.py:176: Warning: cannot register existing type 'RsvgHandle'
  g_type = info.get_g_type()
/nix/store/98bghm0wfyh6ygvr0yg6slyl5xnnj5hs-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/module.py:176: Warning: g_once_init_leave: assertion 'result != 0' failed
  g_type = info.get_g_type()
/nix/store/98bghm0wfyh6ygvr0yg6slyl5xnnj5hs-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/module.py:210: Warning: g_type_get_qdata: assertion 'node != NULL' failed
  type_ = g_type.pytype
/nix/store/98bghm0wfyh6ygvr0yg6slyl5xnnj5hs-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/module.py:224: Warning: g_type_get_qdata: assertion 'node != NULL' failed
  g_type.pytype = wrapper
/nix/store/98bghm0wfyh6ygvr0yg6slyl5xnnj5hs-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/module.py:224: Warning: g_type_set_qdata: assertion 'node != NULL' failed
  g_type.pytype = wrapper
@jtojnar
Copy link
Author

jtojnar commented Feb 24, 2018

Searching the web lead me to foss-np/anubad@9d30f6e which fixes the Gdk-CRITICAL but not the freeze. New log:

W Configuration Failed to load configuration; Creating new one.
W Configuration Reason: (IOError(2, 'No such file or directory'),)
D UIBuilder     Enabled: header_bar
D UIBuilder     Enabled: is_gnome
D UIBuilder     Enabled: icons_in_menu
D UIBuilder     Loading glade file /nix/store/f1iz73bpxlnlsvpclgjf8yb4p2anc55w-syncthing-gtk-0.9.3/share/syncthing-gtk/app.glade
D UIBuilder     Enabled conditions: set([u'icons_in_menu', u'is_gnome', u'header_bar'])
D UIBuilder     Removed 'property' by attribute: is_windows
D UIBuilder     Removed 'property' by attribute: is_windows
D UIBuilder     Allowed node icons_in_menu | old_gtk
D UIBuilder     Removed 'property' by attribute: is_windows
D UIBuilder     Removed node !is_gnome | old_gtk
D UIBuilder     Allowed node icons_in_menu | old_gtk
D UIBuilder     Removed 'property' by attribute: old_gtk
D UIBuilder     Allowed node icons_in_menu | old_gtk
D UIBuilder     Allowed node icons_in_menu | old_gtk
D UIBuilder     Removed 'child' by attribute: traditional_header
D UIBuilder     Removed 'child' by attribute: is_windows
D UIBuilder     Allowed node icons_in_menu | old_gtk
D UIBuilder     Removed 'property' by attribute: is_windows
D UIBuilder     Removed node traditional_header
D UIBuilder     Allowed node traditional_header | icons_in_menu
I StatusIcon    Using backend StatusIconGTK3 (primary)
D Daemon        Reading syncthing config /home/jtojnar/.config/syncthing/config.xml
I Wizard        syncthing-gtk: Configuration directory: '/home/jtojnar/.config/syncthing'
I Wizard        syncthing-gtk: Syncthing configuration directory: /home/jtojnar/.config/syncthing
I Wizard        04:29:32 INFO: Device ID: 5ZSMM2B-NWY3CWO-4JPLQ5M-FI2LU47-I7VVUWW-2GD46L5-755GBVI-PJ3FPQY
I Wizard        04:29:32 INFO: Default folder created and/or linked to new config
I DaemonProcess Subprocess finished with code 0
I Wizard        syncthing-gtk: chosen port 8080
D Wizard        Generated apikey 2uvgkaenitwxg5q4gc4yldwlrjbqrj
D Daemon        Reading syncthing config /home/jtojnar/.config/syncthing/config.xml
V Notifications Error notifications enabled
V Notifications File update notifications enabled
E Daemon        g-io-error-quark: Could not connect to 127.0.0.1: Connection refused (39)
Traceback (most recent call last):
  File "/nix/store/f1iz73bpxlnlsvpclgjf8yb4p2anc55w-syncthing-gtk-0.9.3/lib/python2.7/site-packages/syncthing_gtk/daemon.py", line 1050, in _connected
    self._connection = self.connect_to_service_finish(results)
Error: g-io-error-quark: Could not connect to 127.0.0.1: Connection refused (39)
D App           Creating connect_dialog
V App           Settinig connect_dialog label Starting Syncth
E Daemon        g-io-error-quark: Could not connect to 127.0.0.1: Connection refused (39)
Traceback (most recent call last):
  File "/nix/store/f1iz73bpxlnlsvpclgjf8yb4p2anc55w-syncthing-gtk-0.9.3/lib/python2.7/site-packages/syncthing_gtk/daemon.py", line 1050, in _connected
    self._connection = self.connect_to_service_finish(results)
Error: g-io-error-quark: Could not connect to 127.0.0.1: Connection refused (39)
D InfoBox       kaiser state changed to Disconnected
/nix/store/98bghm0wfyh6ygvr0yg6slyl5xnnj5hs-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/module.py:176: Warning: cannot register existing type 'RsvgHandle'
  g_type = info.get_g_type()
/nix/store/98bghm0wfyh6ygvr0yg6slyl5xnnj5hs-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/module.py:176: Warning: g_once_init_leave: assertion 'result != 0' failed
  g_type = info.get_g_type()
/nix/store/98bghm0wfyh6ygvr0yg6slyl5xnnj5hs-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/module.py:210: Warning: g_type_get_qdata: assertion 'node != NULL' failed
  type_ = g_type.pytype
/nix/store/98bghm0wfyh6ygvr0yg6slyl5xnnj5hs-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/module.py:224: Warning: g_type_get_qdata: assertion 'node != NULL' failed
  g_type.pytype = wrapper
/nix/store/98bghm0wfyh6ygvr0yg6slyl5xnnj5hs-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/module.py:224: Warning: g_type_set_qdata: assertion 'node != NULL' failed
  g_type.pytype = wrapper

@jtojnar
Copy link
Author

jtojnar commented Feb 24, 2018

Opened an issue about the pygobject warnings: https://gitlab.gnome.org/GNOME/librsvg/issues/210

@kozec
Copy link
Owner

kozec commented Feb 24, 2018

Warning: cannot register existing type 'RsvgHandle'

This sounds important. Do you have librsvg and gobject-introspection bindings for it installed? Both should be in librsvg package, but it may wary by distro.

@jtojnar
Copy link
Author

jtojnar commented Feb 24, 2018

Yes, I do. Without it the error woold be ValueError: Namespace Rsvg not available

@kozec
Copy link
Owner

kozec commented Feb 24, 2018

Nothing else seems to be missing from that log, but not being able to render svgs sounds like good reason to draw nothing or even freeze.

Did v0.9.2.7 displayed same thing?

@jtojnar
Copy link
Author

jtojnar commented Feb 24, 2018

Yes, it did.

@kozec
Copy link
Owner

kozec commented Feb 24, 2018

Ok, I'll be honest here, I've tried to install NixOS into Virtualbox and noticed two things:

  1. v0.9.2.7 installed from repository(?) does not display that rsvg message for me and
  2. i have no idea how to install python packages there in way that I can use them from git checkout :D

I'm not entirely sure if I can help you right now...

// edit: I've actually downloaded ready-to-go Virtualbox appliance from NixOS page.

@jtojnar
Copy link
Author

jtojnar commented Feb 24, 2018

  1. Usually, you would write shell.nix and then run nix-shell but you can create ad-hoc shells like nix-shell -p python2 python2Packages.pygobject3 gtk3 or even nix-shell -A syncthing-gtk to use the dependencies listed in the distribution.

Maybe this is desktop environment dependent. I will try it in the appliance as well as other VMs.

@kozec
Copy link
Owner

kozec commented Feb 25, 2018

So, running from last checkout and under...

nix-shell -p python2 python2Packages.pygobject3 gtk3 '(librsvg.override { enableIntrospection = true; })' python2Packages.dateutil syncthing psmisc

... I was able to get GUI working with following patch:

diff --git a/syncthing_gtk/infobox.py b/syncthing_gtk/infobox.py
index c5f3b19..37d3550 100644
--- a/syncthing_gtk/infobox.py
+++ b/syncthing_gtk/infobox.py
@@ -465,6 +465,7 @@ class InfoBox(Gtk.Container):
 	def _prepare_icon(self, icon):
 		if icon.endswith(".svg"):
 			# Icon is svg file
+			return Gtk.Image.new_from_icon_name('info', 16)
 			key = icon if self.dark_color is None else icon + "-dark"
 			if not key in svg_cache:
 				if not self.dark_color is None:
diff --git a/syncthing_gtk/app.py b/syncthing_gtk/app.py
index 10feb6a..b0ff5dc 100644
--- a/syncthing_gtk/app.py
+++ b/syncthing_gtk/app.py
@@ -229,9 +229,9 @@ class App(Gtk.Application, TimerManager):
 			if not self.daemon is None:
 				self.daemon.set_refresh_interval(REFRESH_INTERVAL_TRAY)
 		else:
-			if self.wizard is None:
+			if self.wizard is None and not self.is_visible():
 				# Show main window
-				self.cb_statusicon_click()
+				self.show()
 		self.hide_window = False
 	
 	def setup_commandline(self):
diff --git a/syncthing_gtk/notifications.py b/syncthing_gtk/notifications.py
index 21b96a5..46c2739 100644
--- a/syncthing_gtk/notifications.py
+++ b/syncthing_gtk/notifications.py
@@ -19,7 +19,7 @@ try:
 		gi.require_version('Notify', '0.7')
 		from gi.repository import Notify
 		HAS_DESKTOP_NOTIFY = True
-except ImportError:
+except (ValueError, ImportError):
 	pass
 
 if HAS_DESKTOP_NOTIFY:

It disables drawing SVG and I kinda hope you'd have better idea why that helps as I do right now :)

Continuing to investigate in meantime.

kozec pushed a commit that referenced this issue Feb 25, 2018
@jtojnar
Copy link
Author

jtojnar commented Feb 26, 2018

Great, can confirm that 011c235 works, I can do without the icons for now. I have no understanding of what the problem is, except that it seems to be some kind of deadlock. Hopefully, upstream will enlighten us on https://gitlab.gnome.org/GNOME/librsvg/issues/210

@jtojnar
Copy link
Author

jtojnar commented Apr 28, 2018

Apparently, it was caused by two different instances of librsvg used at the same time.

With NixOS/nixpkgs@47d0a11, syncthing-gtk was freezing, but when I cherry-picked NixOS/nixpkgs@0c2ede9 onto it, it started working.

Thanks to @lazka for pointing me in the right direction.

@jtojnar jtojnar closed this as completed Apr 28, 2018
Repository owner locked and limited conversation to collaborators Apr 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants