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

Starts momentarily then closes #160

Open
MudDev opened this issue Sep 1, 2024 · 15 comments
Open

Starts momentarily then closes #160

MudDev opened this issue Sep 1, 2024 · 15 comments

Comments

@MudDev
Copy link

MudDev commented Sep 1, 2024

After upgrading my ubuntu from 22 to 24, I am getting this error with trayscale, it was working great before, and now it's broken.

I tried to uninstall and install the flatpack again but not joy.

Here is the error when I try to launch it:

2024/09/01 08:52:49 systray error: failed to request name: org.freedesktop.DBus.Error.ServiceUnknown
2024/09/01 08:52:49 ERROR get waiting files err="500 Internal Server Error: Taildrop disabled; no storage directory"
2024/09/01 08:52:49 ERROR adw_application_window_set_content: assertion 'gtk_widget_get_parent (content) == NULL' failed glib_old_log_api=1 priority=4 glib_domain=Adwaita
2024/09/01 08:52:49 ERROR get waiting files err="500 Internal Server Error: Taildrop disabled; no storage directory"

** (process:10552): WARNING **: 08:52:49.924: Invalid client serial
2024/09/01 08:52:49 systray error: failed to update menu version: write unix @->/run/user/1000/.dbus-proxy/session-bus-proxy-MZGCT2: write: broken pipe
2024/09/01 08:52:54 ERROR get waiting files err="500 Internal Server Error: Taildrop disabled; no storage directory"
panic: dbus: connection closed by user [recovered]
	panic: closure error: unexpected panic caught: dbus: connection closed by user
	
	Closure added at:
		github.com/diamondburned/gotk4/pkg/glib/v2.IdleAdd at github.com/diamondburned/gotk4/[email protected]/glib/v2/glib.go:33679
		deedles.dev/trayscale/internal/ui.(*App).Run.func1 at deedles.dev/trayscale/internal/ui/app.go:402
		deedles.dev/trayscale/internal/tsutil.(*Poller).Run at deedles.dev/trayscale/internal/tsutil/poller.go:119

goroutine 1 [running, locked to thread]:
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).Panicf(0xc00039ed80, {0x1f45128, 0x1b}, {0xc0003c9728, 0x1, 0x1})
	github.com/diamondburned/gotk4/[email protected]/core/closure/funcstack.go:104 +0x908
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).TryRepanic(0xc00039ed80)
	github.com/diamondburned/gotk4/[email protected]/core/closure/funcstack.go:122 +0xbc
panic({0x1c14000?, 0x3982710?})
	runtime/panic.go:785 +0x132
github.com/godbus/dbus/v5/prop.(*Properties).SetMust(0xc000316200, {0x1f4334e, 0x1a}, {0x1f304e8, 0xa}, {0x1b72b40, 0xc000221080})
	github.com/godbus/dbus/[email protected]/prop/prop.go:346 +0xeb
fyne.io/systray.SetIcon({0x39ef300?, 0x578d13?, 0xc0000ec30b?})
	fyne.io/[email protected]/systray_unix.go:62 +0x1e6
deedles.dev/trayscale/internal/tray.(*Tray).Update(0xc000326020, {0xc00034a5b0, 0xc00019e140, {0x0, 0x0, 0x0}})
	deedles.dev/trayscale/internal/tray/tray.go:79 +0x13c
deedles.dev/trayscale/internal/ui.(*App).update(0xc000112060, {0xc00034a5b0, 0xc00019e140, {0x0, 0x0, 0x0}})
	deedles.dev/trayscale/internal/ui/app.go:165 +0xce
deedles.dev/trayscale/internal/ui.(*App).Run.func1.1()
	deedles.dev/trayscale/internal/ui/app.go:402 +0x2b
github.com/diamondburned/gotk4/pkg/core/glib._gotk4_sourceFunc(0x100d)
	github.com/diamondburned/gotk4/[email protected]/core/glib/glib.go:352 +0xd9
github.com/diamondburned/gotk4/pkg/gio/v2._Cfunc_g_application_run(0x4746ed0, 0x1, 0x4a4f760)
	_cgo_gotypes.go:14091 +0x4b
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run.func3(0x4746ed0, 0x1, 0x4a4f760)
	github.com/diamondburned/gotk4/[email protected]/gio/v2/gio.go:42200 +0x67
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run(0xc00012e000, {0xc0000360a0, 0x1, 0x1})
	github.com/diamondburned/gotk4/[email protected]/gio/v2/gio.go:42200 +0x1f1
deedles.dev/trayscale/internal/ui.(*App).Run(0xc000112060, {0x21be9e8?, 0xc000256ec0?})
	deedles.dev/trayscale/internal/ui/app.go:411 +0x2df
main.main()
	deedles.dev/trayscale/cmd/trayscale/trayscale.go:49 +0xae
@MudDev MudDev changed the title Starts momentaraly then closes Starts momentarily then closes Sep 1, 2024
@DeedleFake
Copy link
Owner

Looks like a D-Bus problem. There's a panic happening when Gtk4 tries to initialize the application. It connects to the Flatpak D-Bus proxy, but then suddenly its connection gets closed and that causes a panic. I'm about 99% sure this is not a bug in Trayscale. It might be a bug in the Flatpak package, but it seems more likely that there's something weird going on with D-Bus on your system.

@bkazoo
Copy link

bkazoo commented Sep 2, 2024

I am seeing the same issue, Fedora 40, Trayscale 0.13.4. I noticed this error some time after testing Wayland, but I am unable to confirm if this is caused by this. I have tested many changes with Flatseal around permissions, but I did not succeed.

When running with flatpak run dev.deedles.Trayscale, I can see the following error after a while (Trayscale closes at 18:15:55, about 5 minutes after starting):

$ flatpak run dev.deedles.Trayscale 
2024/09/02 18:10:53 systray error: failed to request name: org.freedesktop.DBus.Error.ServiceUnknown
2024/09/02 18:10:53 ERROR adw_application_window_set_content: assertion 'gtk_widget_get_parent (content) == NULL' failed glib_old_log_api=1 priority=4 glib_domain=Adwaita

** (process:10297): WARNING **: 18:15:55.411: Invalid client serial
panic: dbus: connection closed by user [recovered]
	panic: closure error: unexpected panic caught: dbus: connection closed by user
	
	Closure added at:
		github.com/diamondburned/gotk4/pkg/glib/v2.IdleAdd at github.com/diamondburned/gotk4/[email protected]/glib/v2/glib.go:33679
		deedles.dev/trayscale/internal/ui.(*App).Run.func1 at deedles.dev/trayscale/internal/ui/app.go:402
		deedles.dev/trayscale/internal/tsutil.(*Poller).Run at deedles.dev/trayscale/internal/tsutil/poller.go:119

goroutine 1 [running, locked to thread]:
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).Panicf(0xc000230c00, {0x1f45128, 0x1b}, {0xc000053728, 0x1, 0x1})
	github.com/diamondburned/gotk4/[email protected]/core/closure/funcstack.go:104 +0x908
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).TryRepanic(0xc000230c00)
	github.com/diamondburned/gotk4/[email protected]/core/closure/funcstack.go:122 +0xbc
panic({0x1c14000?, 0x3982710?})
	runtime/panic.go:785 +0x132
github.com/godbus/dbus/v5/prop.(*Properties).SetMust(0xc000254e00, {0x1f4334e, 0x1a}, {0x1f304e8, 0xa}, {0x1b72b40, 0xc00012e030})
	github.com/godbus/dbus/[email protected]/prop/prop.go:346 +0xeb
fyne.io/systray.SetIcon({0x39ec180?, 0x578d13?, 0xc000053a18?})
	fyne.io/[email protected]/systray_unix.go:62 +0x1e6
deedles.dev/trayscale/internal/tray.(*Tray).Update(0xc0002a6020, {0xc000322270, 0xc00017c140, {0x0, 0x0, 0x0}})
	deedles.dev/trayscale/internal/tray/tray.go:79 +0x13c
deedles.dev/trayscale/internal/ui.(*App).update(0xc000112060, {0xc000322270, 0xc00017c140, {0x0, 0x0, 0x0}})
	deedles.dev/trayscale/internal/ui/app.go:165 +0xce
deedles.dev/trayscale/internal/ui.(*App).Run.func1.1()
	deedles.dev/trayscale/internal/ui/app.go:402 +0x2b
github.com/diamondburned/gotk4/pkg/core/glib._gotk4_sourceFunc(0x100c)
	github.com/diamondburned/gotk4/[email protected]/core/glib/glib.go:352 +0xd9
github.com/diamondburned/gotk4/pkg/gio/v2._Cfunc_g_application_run(0x17b7eed0, 0x1, 0x17d01020)
	_cgo_gotypes.go:14091 +0x4b
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run.func3(0x17b7eed0, 0x1, 0x17d01020)
	github.com/diamondburned/gotk4/[email protected]/gio/v2/gio.go:42200 +0x67
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run(0xc00012e000, {0xc0000360a0, 0x1, 0x1})
	github.com/diamondburned/gotk4/[email protected]/gio/v2/gio.go:42200 +0x1f1
deedles.dev/trayscale/internal/ui.(*App).Run(0xc000112060, {0x21be9e8?, 0xc000254d00?})
	deedles.dev/trayscale/internal/ui/app.go:411 +0x2df
main.main()
	deedles.dev/trayscale/cmd/trayscale/trayscale.go:49 +0xae

@bkazoo
Copy link

bkazoo commented Sep 2, 2024

In my specific issue, it seems it is now working by enabling 'D-Bus session bus' in Flatseal, which I did not try before.
(or running: $ flatpak run --socket=session-bus dev.deedles.Trayscale)

It seems I no longer get the first 'systray error' that I was originally getting:

$ flatpak run dev.deedles.Trayscale
2024/09/02 20:14:42 systray error: failed to request name: org.freedesktop.DBus.Error.ServiceUnknown
2024/09/02 20:14:42 ERROR adw_application_window_set_content: assertion 'gtk_widget_get_parent (content) == NULL' failed glib_old_log_api=1 priority=4 glib_domain=Adwaita

(followed by a crash)

With session-bus:

$ flatpak run --socket=session-bus dev.deedles.Trayscale
2024/09/02 20:15:17 ERROR adw_application_window_set_content: assertion 'gtk_widget_get_parent (content) == NULL' failed glib_old_log_api=1 priority=4 glib_domain=Adwaita

So with this configuration change, it seem it is resolved for me for now.

As the same error appears in the original report from @MudDev, it could be worth checking if this helps.

Should this be enabled in the flatpak by default?

@DeedleFake
Copy link
Owner

DeedleFake commented Sep 2, 2024

That systray error is caused by that, but that's not a fatal error. I get that on my machine, too, but without a crash. In fact, the code that produces that error in the fyne.io/systray package is

if err != nil {
        log.Printf("systray error: failed to request name: %s\n", err)
        // it's not critical error: continue
}

I don't think the problem is systray-related. It seems more likely that it's related to Gtk4's application system which registers with D-Bus when it starts. That not working would definitely cause it to fail to start, whereas if the systray icon didn't work it should just not have a systray icon.

Should this be enabled in the flatpak by default?

No, probably not. I had permissions like that originally and the Flathub people requested that they be reduced before they allowed it to be published on there.

@MudDev
Copy link
Author

MudDev commented Sep 3, 2024

I didn't make any changes, but it just started working today. Maybe it just needed a long weekend 😄

Nice find @bkazoo and thanks for sharing your solution, I hope this helps other people that are running into this issue.

@MudDev MudDev closed this as completed Sep 3, 2024
@segler-alex
Copy link

segler-alex commented Sep 4, 2024

+1 i also have this error.

** (process:48072): WARNING **: 14:31:51.161: Invalid client serial
panic: dbus: connection closed by user [recovered]
	panic: closure error: unexpected panic caught: dbus: connection closed by user
	
	Closure added at:
		github.com/diamondburned/gotk4/pkg/glib/v2.IdleAdd at github.com/diamondburned/gotk4/[email protected]/glib/v2/glib.go:33679
		deedles.dev/trayscale/internal/ui.(*App).Run.func1 at deedles.dev/trayscale/internal/ui/app.go:402
		deedles.dev/trayscale/internal/tsutil.(*Poller).Run at deedles.dev/trayscale/internal/tsutil/poller.go:119

goroutine 1 [running, locked to thread]:
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).Panicf(0xc0000de810, {0x1f45128, 0x1b}, {0xc0002cb728, 0x1, 0x1})
	github.com/diamondburned/gotk4/[email protected]/core/closure/funcstack.go:104 +0x908
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).TryRepanic(0xc0000de810)
	github.com/diamondburned/gotk4/[email protected]/core/closure/funcstack.go:122 +0xbc
panic({0x1c14000?, 0x3982710?})
	runtime/panic.go:785 +0x132
github.com/godbus/dbus/v5/prop.(*Properties).SetMust(0xc0003ca0c0, {0x1f4334e, 0x1a}, {0x1f304e8, 0xa}, {0x1b72b40, 0xc00038a000})
	github.com/godbus/dbus/[email protected]/prop/prop.go:346 +0xeb
fyne.io/systray.SetIcon({0x39ec180?, 0x578d13?, 0xc000053a18?})
	fyne.io/[email protected]/systray_unix.go:62 +0x1e6
deedles.dev/trayscale/internal/tray.(*Tray).Update(0xc0000ba040, {0xc000321110, 0xc000196140, {0x0, 0x0, 0x0}})
	deedles.dev/trayscale/internal/tray/tray.go:79 +0x13c
deedles.dev/trayscale/internal/ui.(*App).update(0xc00013c600, {0xc000321110, 0xc000196140, {0x0, 0x0, 0x0}})
	deedles.dev/trayscale/internal/ui/app.go:165 +0xce
deedles.dev/trayscale/internal/ui.(*App).Run.func1.1()
	deedles.dev/trayscale/internal/ui/app.go:402 +0x2b
github.com/diamondburned/gotk4/pkg/core/glib._gotk4_sourceFunc(0x1039)
	github.com/diamondburned/gotk4/[email protected]/core/glib/glib.go:352 +0xd9
github.com/diamondburned/gotk4/pkg/gio/v2._Cfunc_g_application_run(0x3d5ced0, 0x1, 0x3ed53c0)
	_cgo_gotypes.go:14091 +0x4b
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run.func3(0x3d5ced0, 0x1, 0x3ed53c0)
	github.com/diamondburned/gotk4/[email protected]/gio/v2/gio.go:42200 +0x67
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run(0xc000221110, {0xc000122050, 0x1, 0x1})
	github.com/diamondburned/gotk4/[email protected]/gio/v2/gio.go:42200 +0x1f1
deedles.dev/trayscale/internal/ui.(*App).Run(0xc00013c600, {0x21be9e8?, 0xc00025ae80?})
	deedles.dev/trayscale/internal/ui/app.go:411 +0x2df
main.main()
	deedles.dev/trayscale/cmd/trayscale/trayscale.go:49 +0xae

it happens after a few minutes. i also use ubuntu 24.04 with the flatpak version

@segler-alex
Copy link

When i do

$ flatpak run --socket=session-bus dev.deedles.Trayscale
2024/09/04 14:36:42 ERROR adw_application_window_set_content: assertion 'gtk_widget_get_parent (content) == NULL' failed glib_old_log_api=1 priority=4 glib_domain=Adwaita
2024/09/04 14:37:13 ERROR adw_application_window_set_content: assertion 'gtk_widget_get_parent (content) == NULL' failed glib_old_log_api=1 priority=4 glib_domain=Adwaita

and it seems to not crash anymore

@issinoho
Copy link

issinoho commented Nov 8, 2024

Exactly the same issue running on, Ubuntu 24.04.1 LTS x86_64
These comments really helped. I updated the desktop shortcut as follows and the app is now stable.
/usr/bin/flatpak run --branch=stable --arch=x86_64 --socket=session-bus --command=trayscale dev.deedles.Trayscale

@DeedleFake
Copy link
Owner

@issinoho, you should also be able to override the permissions for the flatpak. I recommend Flatseal for dealing with that kind of thing.

I'd really like to figure out what exactly is failing here rather than having to open it up to full session bus access. Could you try running it without --socket=session-bus and with --log-session-bus and posting the output here, please? That might help me figure out what's going on.

@issinoho
Copy link

Ok, here we go...

$ flatpak run --log-session-bus dev.deedles.Trayscale
C1: -> org.freedesktop.DBus call org.freedesktop.DBus.Hello at /org/freedesktop/DBus
C2: -> org.freedesktop.DBus fake AddMatch for org.kde.StatusNotifierWatcher
C3: -> org.freedesktop.DBus fake GetNameOwner for org.kde.StatusNotifierWatcher
C4: -> org.freedesktop.DBus fake wildcarded AddMatch for dev.deedles.Trayscale
C5: -> org.freedesktop.DBus fake AddMatch for org.freedesktop.Notifications
C6: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.Notifications
C7: -> org.freedesktop.DBus fake wildcarded AddMatch for org.freedesktop.portal
C8: -> org.freedesktop.DBus fake wildcarded AddMatch for org.mpris.MediaPlayer2.dev.deedles.Trayscale
C9: -> org.freedesktop.DBus fake ListNames
B1: <- org.freedesktop.DBus return from C1
B2: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameAcquired at /org/freedesktop/DBus
B3: <- org.freedesktop.DBus return from C2
*SKIPPED*
B4: <- org.freedesktop.DBus return from C3
*SKIPPED*
B5: <- org.freedesktop.DBus return from C4
*SKIPPED*
B6: <- org.freedesktop.DBus return from C5
*SKIPPED*
B7: <- org.freedesktop.DBus return from C6
*SKIPPED*
B8: <- org.freedesktop.DBus return from C7
*SKIPPED*
B9: <- org.freedesktop.DBus return from C8
*SKIPPED*
B10: <- org.freedesktop.DBus return from C9
C10: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.DBus
C11: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.Notifications
C12: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.Desktop
C13: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.Documents
C14: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.IBus
C15: -> org.freedesktop.DBus fake GetNameOwner for org.kde.StatusNotifierWatcher
*SKIPPED*
B11: <- org.freedesktop.DBus return from C10
*SKIPPED*
B12: <- org.freedesktop.DBus return from C11
*SKIPPED*
B13: <- org.freedesktop.DBus return from C12
*SKIPPED*
B14: <- org.freedesktop.DBus return from C13
*SKIPPED*
B15: <- org.freedesktop.DBus return from C14
*SKIPPED*
B16: <- org.freedesktop.DBus return from C15
*SKIPPED*
C16: -> org.freedesktop.DBus call org.freedesktop.DBus.AddMatch at /org/freedesktop/DBus
C17: -> org.freedesktop.DBus call org.freedesktop.DBus.StartServiceByName at /org/freedesktop/DBus
Filtering message due to arg0 org.gtk.vfs.Daemon, policy: 0 (required 2)
*HIDDEN* (ping)
B17: <- org.freedesktop.DBus return from C16
B18: <- (no sender) return from C17
*REWRITTEN*
C18: -> org.freedesktop.DBus call org.freedesktop.DBus.GetNameOwner at /org/freedesktop/DBus
Filtering message due to arg0 org.gtk.vfs.Daemon, policy: 0 (required 1)
B19: <- (no sender) return from C18
*REWRITTEN*
C19: -> org.gtk.vfs.Daemon call org.gtk.vfs.MountTracker.ListMountableInfo at /org/gtk/vfs/mounttracker
*HIDDEN* (ping)
B20: <- (no sender) return from C19
*REWRITTEN*
C20: -> org.freedesktop.DBus call org.freedesktop.DBus.RemoveMatch at /org/freedesktop/DBus
B21: <- org.freedesktop.DBus return from C20
C1: -> org.freedesktop.DBus call org.freedesktop.DBus.Hello at /org/freedesktop/DBus
C2: -> org.freedesktop.DBus fake AddMatch for org.kde.StatusNotifierWatcher
C3: -> org.freedesktop.DBus fake GetNameOwner for org.kde.StatusNotifierWatcher
C4: -> org.freedesktop.DBus fake wildcarded AddMatch for dev.deedles.Trayscale
C5: -> org.freedesktop.DBus fake AddMatch for org.freedesktop.Notifications
C6: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.Notifications
C7: -> org.freedesktop.DBus fake wildcarded AddMatch for org.freedesktop.portal
C8: -> org.freedesktop.DBus fake wildcarded AddMatch for org.mpris.MediaPlayer2.dev.deedles.Trayscale
C9: -> org.freedesktop.DBus fake ListNames
C1: -> org.freedesktop.DBus call org.freedesktop.DBus.Hello at /org/freedesktop/DBus
C2: -> org.freedesktop.DBus fake AddMatch for org.kde.StatusNotifierWatcher
C3: -> org.freedesktop.DBus fake GetNameOwner for org.kde.StatusNotifierWatcher
C4: -> org.freedesktop.DBus fake wildcarded AddMatch for dev.deedles.Trayscale
C5: -> org.freedesktop.DBus fake AddMatch for org.freedesktop.Notifications
C6: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.Notifications
C7: -> org.freedesktop.DBus fake wildcarded AddMatch for org.freedesktop.portal
C8: -> org.freedesktop.DBus fake wildcarded AddMatch for org.mpris.MediaPlayer2.dev.deedles.Trayscale
C9: -> org.freedesktop.DBus fake ListNames
B1: <- org.freedesktop.DBus return from C1
B2: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameAcquired at /org/freedesktop/DBus
B3: <- org.freedesktop.DBus return from C2

Then lots of repeating information, and finally the exit.

B208193: <- :1.40 call org.freedesktop.DBus.Properties.Get at /StatusNotifierItem
C6575: -> :1.40 return from B208192
C6576: -> :1.40 return error org.freedesktop.DBus.Properties.Error.PropertyNotFound from B208193
C6577: -> all signal org.freedesktop.DBus.Properties.PropertiesChanged at /StatusNotifierItem
C6578: -> all signal org.kde.StatusNotifierItem.NewIcon at /StatusNotifierItem
C6579: -> all signal org.freedesktop.DBus.Properties.PropertiesChanged at /StatusNotifierMenu
C6580: -> all signal com.canonical.dbusmenu.LayoutUpdated at /StatusNotifierMenu
C6581: -> all signal org.freedesktop.DBus.Properties.PropertiesChanged at /StatusNotifierMenu
C6582: -> all signal com.canonical.dbusmenu.LayoutUpdated at /StatusNotifierMenu
C6583: -> all signal org.freedesktop.DBus.Properties.PropertiesChanged at /StatusNotifierMenu
C6584: -> all signal com.canonical.dbusmenu.LayoutUpdated at /StatusNotifierMenu
B208194: <- :1.40 call org.freedesktop.DBus.Properties.Get at /StatusNotifierItem
B208195: <- :1.40 call org.freedesktop.DBus.Properties.Get at /StatusNotifierItem
B208196: <- :1.40 call org.freedesktop.DBus.Properties.Get at /StatusNotifierItem
C6585: -> :1.40 return error org.freedesktop.DBus.Properties.Error.PropertyNotFound from B208196
C6587: -> :1.40 return from B208195

** (process:497742): WARNING **: 16:00:09.160: Invalid client serial
panic: dbus: connection closed by user [recovered]
	panic: closure error: unexpected panic caught: dbus: connection closed by user
	
	Closure added at:
		github.com/diamondburned/gotk4/pkg/glib/v2.IdleAdd at github.com/diamondburned/gotk4/[email protected]/glib/v2/glib.go:33679
		deedles.dev/trayscale/internal/ui.(*App).Run.func1 at deedles.dev/trayscale/internal/ui/app.go:402
		deedles.dev/trayscale/internal/tsutil.(*Poller).Run at deedles.dev/trayscale/internal/tsutil/poller.go:121

goroutine 1 [running, locked to thread]:
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).Panicf(0xc000124f60, {0x1f54aee, 0x1b}, {0xc000053728, 0x1, 0x1})
	github.com/diamondburned/gotk4/[email protected]/core/closure/funcstack.go:104 +0x908
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).TryRepanic(0xc000124f60)
	github.com/diamondburned/gotk4/[email protected]/core/closure/funcstack.go:122 +0xbc
panic({0x1c21a40?, 0x39a7740?})
	runtime/panic.go:785 +0x132
github.com/godbus/dbus/v5/prop.(*Properties).SetMust(0xc000296200, {0x1f52cdf, 0x1a}, {0x1f3fc8e, 0xa}, {0x1b7f6c0, 0xc000220db0})
	github.com/godbus/dbus/[email protected]/prop/prop.go:346 +0xeb
fyne.io/systray.SetIcon({0x3a115e0?, 0x5792cf?, 0x7bd98f1c0a68?})
	fyne.io/[email protected]/systray_unix.go:62 +0x1e6
deedles.dev/trayscale/internal/tray.(*Tray).Update(0xc0002a6020, {0xc0000d0820, 0xc00019e3c0, {0x0, 0x0, 0x0}})
	deedles.dev/trayscale/internal/tray/tray.go:79 +0x13c
deedles.dev/trayscale/internal/ui.(*App).update(0xc000112060, {0xc0000d0820, 0xc00019e3c0, {0x0, 0x0, 0x0}})
	deedles.dev/trayscale/internal/ui/app.go:165 +0xce
deedles.dev/trayscale/internal/ui.(*App).Run.func1.1()
	deedles.dev/trayscale/internal/ui/app.go:402 +0x2b
github.com/diamondburned/gotk4/pkg/core/glib._gotk4_sourceFunc(0x100c)
	github.com/diamondburned/gotk4/[email protected]/core/glib/glib.go:352 +0xd9
github.com/diamondburned/gotk4/pkg/gio/v2._Cfunc_g_application_run(0x3f93ed0, 0x1, 0x42c6730)
	_cgo_gotypes.go:14091 +0x4b
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run.func3(0x3f93ed0, 0x1, 0x42c6730)
	github.com/diamondburned/gotk4/[email protected]/gio/v2/gio.go:42200 +0x67
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run(0xc00012e000, {0xc0000360a0, 0x1, 0x1})
	github.com/diamondburned/gotk4/[email protected]/gio/v2/gio.go:42200 +0x1f1
deedles.dev/trayscale/internal/ui.(*App).Run(0xc000112060, {0x21d1738?, 0xc000257180?})
	deedles.dev/trayscale/internal/ui/app.go:411 +0x2df
main.main()
	deedles.dev/trayscale/cmd/trayscale/trayscale.go:49 +0xae

@DeedleFake DeedleFake reopened this Nov 11, 2024
@DeedleFake
Copy link
Owner

Can you try running the following and letting me know if it works, please? Make sure that if you've made any changes with Flatseal that you undo them before you run it.

flatpak run '--own-name=org.kde.*' dev.deedles.Trayscale

@issinoho
Copy link

Crashed very quickly...

$ flatpak run '--own-name=org.kde.*' dev.deedles.Trayscale
2024/11/11 19:31:05 ERROR adw_application_window_set_content: assertion 'gtk_widget_get_parent (content) == NULL' failed glib_old_log_api=1 priority=4 glib_domain=Adwaita
2024/11/11 19:31:28 ERROR adw_application_window_set_content: assertion 'gtk_widget_get_parent (content) == NULL' failed glib_old_log_api=1 priority=4 glib_domain=Adwaita

** (process:508022): WARNING **: 19:31:29.928: Invalid client serial
panic: dbus: connection closed by user [recovered]
	panic: closure error: unexpected panic caught: dbus: connection closed by user
	
	Closure added at:
		github.com/diamondburned/gotk4/pkg/glib/v2.IdleAdd at github.com/diamondburned/gotk4/[email protected]/glib/v2/glib.go:33679
		deedles.dev/trayscale/internal/ui.(*App).Run.func1 at deedles.dev/trayscale/internal/ui/app.go:402
		deedles.dev/trayscale/internal/tsutil.(*Poller).Run at deedles.dev/trayscale/internal/tsutil/poller.go:121

goroutine 1 [running, locked to thread]:
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).Panicf(0xc00044fc80, {0x1f54aee, 0x1b}, {0xc000143728, 0x1, 0x1})
	github.com/diamondburned/gotk4/[email protected]/core/closure/funcstack.go:104 +0x908
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).TryRepanic(0xc00044fc80)
	github.com/diamondburned/gotk4/[email protected]/core/closure/funcstack.go:122 +0xbc
panic({0x1c21a40?, 0x39a7740?})
	runtime/panic.go:785 +0x132
github.com/godbus/dbus/v5/prop.(*Properties).SetMust(0xc0001341c0, {0x1f52cdf, 0x1a}, {0x1f3fc8e, 0xa}, {0x1b7f6c0, 0xc00028e780})
	github.com/godbus/dbus/[email protected]/prop/prop.go:346 +0xeb
fyne.io/systray.SetIcon({0x3a115e0?, 0x579073?, 0x78f8329745b8?})
	fyne.io/[email protected]/systray_unix.go:62 +0x1e6
deedles.dev/trayscale/internal/tray.(*Tray).Update(0xc00032e020, {0xc000295520, 0xc00025c280, {0x0, 0x0, 0x0}})
	deedles.dev/trayscale/internal/tray/tray.go:79 +0x13c
deedles.dev/trayscale/internal/ui.(*App).update(0xc0000aa6c0, {0xc000295520, 0xc00025c280, {0x0, 0x0, 0x0}})
	deedles.dev/trayscale/internal/ui/app.go:165 +0xce
deedles.dev/trayscale/internal/ui.(*App).Run.func1.1()
	deedles.dev/trayscale/internal/ui/app.go:402 +0x2b
github.com/diamondburned/gotk4/pkg/core/glib._gotk4_sourceFunc(0x100c)
	github.com/diamondburned/gotk4/[email protected]/core/glib/glib.go:352 +0xd9
github.com/diamondburned/gotk4/pkg/gio/v2._Cfunc_g_application_run(0x46fced0, 0x1, 0x4a2f8b0)
	_cgo_gotypes.go:14091 +0x4b
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run.func3(0x46fced0, 0x1, 0x4a2f8b0)
	github.com/diamondburned/gotk4/[email protected]/gio/v2/gio.go:42200 +0x67
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run(0xc000221110, {0xc0000360a0, 0x1, 0x1})
	github.com/diamondburned/gotk4/[email protected]/gio/v2/gio.go:42200 +0x1f1
deedles.dev/trayscale/internal/ui.(*App).Run(0xc0000aa6c0, {0x21d1738?, 0xc000257200?})
	deedles.dev/trayscale/internal/ui/app.go:411 +0x2df
main.main()
	deedles.dev/trayscale/cmd/trayscale/trayscale.go:49 +0xae

@sealldeveloper
Copy link

Exactly the same issue running on, Ubuntu 24.04.1 LTS x86_64 These comments really helped. I updated the desktop shortcut as follows and the app is now stable. /usr/bin/flatpak run --branch=stable --arch=x86_64 --socket=session-bus --command=trayscale dev.deedles.Trayscale

This worked for me, using FlatSeal to give it 'socket=session-bus' makes the crashing stop for now.

@g-be
Copy link

g-be commented Jan 27, 2025

Just to add another data point:
I was getting a crash when opening, which was not fixed by uninstalling/reinstalling.
using the --socket=session-bus option enabled it to run normally.
running it without the added option now it runs normally.
launching it from the Apps shortcut now it runs normally once more.

@DeedleFake
Copy link
Owner

That's a weird one. If enabling that lets it do something that then persists through uninstallations, that could certainly explain why I've had so much trouble reproducing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants