dweymouth / supersonic

A lightweight and full-featured cross-platform desktop client for self-hosted music servers
GNU General Public License v3.0
668 stars 26 forks source link

Crashing when trying to add a new server v0.10.0 #369

Closed adamshand closed 2 months ago

adamshand commented 2 months ago

I'm getting a reliable crash when trying to add a new subsonic server (currently only have a single Jellyfin server configured).

To reproduce:

Should crash within a few seconds.

❯ uname -a
Darwin MacBook-Air.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:19:22 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8112 arm64

❯ ~/Applications/Supersonic.app/Contents/MacOS/supersonic
2024/04/18 16:11:52 Another instance is running. Reactivating it...
2024/04/18 16:11:52 No other instance responded. Starting as normal...
2024/04/18 16:11:52 Starting supersonic...
2024/04/18 16:11:52 Using config dir: /Users/adam/Library/Application Support/supersonic
2024/04/18 16:11:52 Using cache dir: /Users/adam/Library/Caches/supersonic
2024/04/18 16:11:52 Creating session lock file
2024/04/18 16:11:52 failed to load theme file "": open /Users/adam/Library/Application Support/supersonic/themes: no such file or directory
2024-04-18 16:11:52.941 supersonic[6934:7842033] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
2024/04/18 16:11:55 Error loading cover image: page not found, code: 404 Not Found, msg: "Pisaq, Nov 2009 does not have an image of type Primary"
2024/04/18 16:11:55 Error loading cover image: page not found, code: 404 Not Found, msg: "Nelson, Oct 3, 2007 does not have an image of type Primary"
fatal error: concurrent map iteration and map write

goroutine 44 [running]:
fyne.io/fyne/v2/widget.(*RichText).cleanVisualCache(...)
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/widget/richtext.go:227
fyne.io/fyne/v2/widget.(*textRenderer).Refresh(0x1400180a640)
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/widget/richtext.go:738 +0x458
fyne.io/fyne/v2/widget.(*BaseWidget).Refresh(0x140005640c0?)
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/widget/widget.go:139 +0x30
fyne.io/fyne/v2/widget.(*RichText).Refresh(0x140005640c0)
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/widget/richtext.go:106 +0x34
fyne.io/fyne/v2/widget.(*entryRenderer).Refresh(0x1400140e900)
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/widget/entry.go:1556 +0x13c
fyne.io/fyne/v2/widget.(*BaseWidget).Refresh(0x1400303a7a8?)
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/widget/widget.go:139 +0x30
fyne.io/fyne/v2/widget.(*Entry).Refresh(0x1400303a780)
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/widget/entry.go:458 +0x68
fyne.io/fyne/v2/widget.(*Entry).TypedRune(0x1400303a780, 0x6e)
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/widget/entry.go:823 +0x190
fyne.io/fyne/v2/internal/driver/glfw.(*window).processCharInput.func1()
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/internal/driver/glfw/window.go:814 +0x2c
fyne.io/fyne/v2/internal/driver/common.(*Window).RunEventQueue(0x0?)
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/internal/driver/common/window.go:35 +0x3c
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1 in goroutine 1
        /Users/drew/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20240413154245-d9a397b43dd6/internal/driver/glfw/window.go:972 +0x148

// edited by @dweymouth - remove irrelevant rest of call stacks
dweymouth commented 2 months ago

Yeah this is a bad one. And I know what introduced it and it shouldn't be too hard to fix. This itself is worthy of a 0.10.1 release but I'll wait a few days in case any other big bugs show up.

In the meantime you can add new servers by manually editing the config file, or downgrading to add the server and then upgrading again.

dweymouth commented 2 months ago

I'll fix it on main tomorrow so you could then download a pre-release build from GitHub actions too

Maffsie commented 2 months ago

Happening on the Flatpak release as a new user when trying to set up a Jellyfin server - I think it's probably this same issue so will report back when a new build is available in case it's not.

dweymouth commented 2 months ago

Fixed by https://github.com/dweymouth/supersonic/commit/4861ad4532ef61307c34d34974aee83d03c6900a (and a corresponding commit to the Fyne fork). Once Github Actions builds finish for this commit, those binaries should be free of this bug. Will leave this issue open for visibility until 0.10.1 is released

dweymouth commented 2 months ago

@anarcat This pretty bad bug slipped through in the 0.10.0 release but I'm planning on waiting a few more days/week to see if there are any other new bugs for a 0.10.1 release. It would be good if we could get a beta Flatpak build with this fix though

dweymouth commented 2 months ago

For anyone affected by this who can't use Github Actions builds or build from source, you can add a server manually like this:

  1. If you're a brand new user, just launch and quit Supersonic once to have it generate a skeleton config file
  2. Make sure Supersonic is not running
  3. Open its config file for editing: a) Linux: ~/.config/supersonic/config.toml b) Windows: C:\Users\<yourname>\AppData\Roaming\supersonic\config.toml c) Mac: ~/Library/Application Support/supersonic/config.toml
  4. Add a section to the config that looks like this, adding the info for your server. For the ID, generate a random UUID from here and use that.
[[Servers]]
ServerType = 'Subsonic'                                          // or 'Jellyfin'
Hostname = 'http://192.168.1.32:4533/navidrome'             // note that my Navidrome server has been configured with custom /navidrome base path
AltHostname = ''
Username = 'drew'
LegacyAuth = false
ID = '65db492c-b42d-412b-9ebf-a548320d66a9'
Nickname = 'Navidrome'
Default = true
anarcat commented 2 months ago

On 2024-04-18 09:36:12, Drew Weymouth wrote:

@anarcat This pretty bad bug slipped through in the 0.10.0 release but I'm planning on waiting a few more days/week to see if there are any other new bugs for a 0.10.1 release. It would be good if we could get a beta Flatpak build with this fix though

it's always easier to get a release out than remember how to pin a commit. :)

-- J'ai découvert que tout le malheur des hommes vient d'une seule chose, qui est de ne pas savoir demeurer au repos dans une chambre.

dweymouth commented 2 months ago

Sounds good, I'll still wait a day or two for any other potential bad bugs to get reported. The workaround to edit the config file manually will work for now.