pbek / QOwnNotes

QOwnNotes is a plain-text file notepad and todo-list manager with Markdown support and Nextcloud / ownCloud integration.
https://www.qownnotes.org/
GNU General Public License v2.0
4.63k stars 410 forks source link

[BUG] Snap crashes upon launch #2876

Closed eeickmeyer closed 8 months ago

eeickmeyer commented 11 months ago

All attempts to open QOwnNotes 23.10 snap fail to open. I suspect the snap is missing some runtime dependencies, possibly including kde-config-gtk-style which provides libcolorreload-gtk-module.so.

Expected behaviour

qownnotes launches normally.

Actual behaviour

qownnotes crashes upon launch.

Steps to reproduce

Install qownnotes snap:

Launch qoownnotes:

Terminal output:

Gtk-Message: 19:02:12.235: Failed to load module "colorreload-gtk-module"
Fontconfig warning: FcPattern object weight does not accept value [0 205)
Segmentation fault (core dumped)

Output from the debug section in the settings dialog

Expand N/A

Relevant log output in the Log panel

N/A

Expand N/A
pbek commented 11 months ago

Strange, I just tried installing it on a fresh Ubuntu instance, and it installed and ran as it should.

dmatta22201 commented 11 months ago

I was having the same issue with the snap on a fresh minimal install of Ubuntu 23.10. To fix, I uninstalled the snap and installed using apt from the ppa, along with libcanberra-gtk-module. Works now.

pbek commented 11 months ago

I wonder why I wasn't able to reproduce this on Ubuntu 23.10... 🤔

DanielBelmes commented 10 months ago
(QOwnNotes:20250): Gtk-WARNING **: 13:20:06.250: Theme parsing error: gtk.css:1413:23: 'font-feature-settings' is not a valid property name

(QOwnNotes:20250): Gtk-WARNING **: 13:20:06.252: Theme parsing error: gtk.css:3286:25: 'font-feature-settings' is not a valid property name

(QOwnNotes:20250): Gtk-WARNING **: 13:20:06.253: Theme parsing error: gtk.css:3748:23: 'font-feature-settings' is not a valid property name
Gtk-Message: 13:20:06.273: Failed to load module "canberra-gtk-module"
Gtk-Message: 13:20:06.278: Failed to load module "canberra-gtk-module"
Warning: Qt: Session management error: Could not open network socket (:0, )
Fontconfig warning: FcPattern object width does not accept value [75 100)
[1]    20250 segmentation fault (core dumped)  qownnotes

Here's the log I get when starting 23.11.1. Definitly having the same issue as @dmatta22201 was. Gonna use their solution for now.

pbek commented 10 months ago

@YamiYukiSenpai, what Linux distribution did you use?

pbek commented 10 months ago

I still can't reproduce this on Ubuntu 23.10.

image

eeickmeyer commented 10 months ago

I still can't reproduce this on Ubuntu 23.10.

I'd say your testing might be flawed then if you're only using Ubuntu 23.10 as, with snaps, you should be able to use them in any Linux distribution (snaps aren't an Ubuntu-only thing, contrary to popular FUD/belief). Furthermore, per your screenshot, your Ubuntu 23.10 is out-of-date as it still shows "Development Branch" when Ubuntu 23.10 has been released for more than a month now and the release descriptor has been updated to no longer show "Development Branch".

My attempts to run have been mostly with Edubuntu 23.10 and Ubuntu Studio 23.10 (both of which are actually Ubuntu 23.10, but that shouldn't matter because a snap is a snap).

Additionally, did you install the snap locally (or using --devmode --dangerous)? If so, it might be using system libraries (in an unconfined state) and therefore not simulating how the snap would actually behave in the real world ("strict" confinement).

pbek commented 10 months ago

Since I only got one report which distribution was used (https://github.com/pbek/QOwnNotes/issues/2876#issuecomment-1776031182) I went with that and like you said, the snaps should run everywhere. The snap build process didn't change for quite a while, but it seems Ubuntu did.

Any help is much appreciated. And PRs for changes in https://github.com/pbek/QOwnNotes/blob/main/build-systems/snap/snapcraft/snapcraft.yaml and https://github.com/pbek/QOwnNotes/blob/main/snap/snapcraft.yaml are welcome.

And no, I just did the usual snap install qownnotes.

tom-braun commented 10 months ago

Same here. Kubuntu 23.10. Installed from snap. Fails to launch (Segementation Fault)

(QOwnNotes:7595): Gtk-WARNING **: 07:57:06.520: Theme parsing error: gtk.css:3536:25: 'font-feature-settings' is not a valid property name
Gtk-Message: 07:57:06.546: Failed to load module "colorreload-gtk-module"
Gtk-Message: 07:57:06.547: Failed to load module "window-decorations-gtk-module"
Warning: Qt: Session management error: Could not open network socket (:0, )
Fontconfig warning: FcPattern object weight does not accept value [0 205)
+++ killed by SIGSEGV (core dumped) +++
Speicherzugriffsfehler (Speicherabzug geschrieben)

just guessing: @pbek, from you screenshot it seems you are running gnome? Could it be this is only effecting kde users? Are the failing-to-load gtk-modules a hint here?

pbek commented 10 months ago

Yes, for the test I used a fresh Ubuntu mainline install, because everyone was talking about Ubuntu (which is using Gnome by default). I used the Snap on KDE Neon (based on Ubuntu 22.04) for a long time and never had any issues, I wonder what Canonical (?) changed in 23.10 to even break a snap...

pbek commented 10 months ago

Kubuntu 23.10, LGTM

VirtualBox_Ubuntu Test_01_12_2023_09_14_55

github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 30 days with no activity.

eeickmeyer commented 9 months ago

Still same issue, Ubuntu Studio 23.10 (same DE as Kubuntu 23.10):

Gtk-Message: 13:09:11.166: Failed to load module "xapp-gtk3-module"
Gtk-Message: 13:09:11.278: Failed to load module "colorreload-gtk-module"
Gtk-Message: 13:09:11.278: Failed to load module "window-decorations-gtk-module"
Fontconfig warning: FcPattern object width does not accept value [75 100)
Segmentation fault (core dumped)

The segfault is the issue, but I have no way to know what the issue is that is causing the segfault. Per your screenshot, I note that you're still building the snap using core18? I must advise that core18 is no longer supported, you might need to update to core20 or core22.

pbek commented 9 months ago

Core18 was the highest version that snapcraft supported for a long time, I need to test of newer versions already work.

eeickmeyer commented 9 months ago

Core18 was the highest version that snapcraft supported for a long time, I need to test of newer versions already work.

They should. I have a snap in which I had to manually patch electron to get up to core22. core18 went EOL in April. Each core version is only supported for 5 years, and core18 was released in 2018, core20 in 2020, and so on.

pbek commented 9 months ago

Meh, after fixing error after error with core22 I found out that there is no qmake plugin in core22 anymore 🙄

pbek commented 9 months ago

And with core20... error after error... And I can't even find an example on how you are supposed to build a Qt app with qmake on core20+. All I can find are using core18 or below...

YamiYukiSenpai commented 9 months ago

The KDE KF5 snaps?

pbek commented 9 months ago

Aren't those cmake?

pbek commented 8 months ago

After "only" a few days of work, I was able to get core20 working. 😅 It's in the edge channel, can you all please try to test it with snap install qownnotes --edge. I tested it on a fresh Ubuntu 23.10 installation, and it worked for me.

eeickmeyer commented 8 months ago

So, good news and bad news. Good news is it launches. Bad news is in the setup dialog, when I go to choose the folder for storing the notes, it crashes with:

(QOwnNotes:28018): GLib-GIO-ERROR **: 12:25:42.583: Settings schema 'org.gtk.Settings.FileChooser' does not contain a key named 'show-type-column'
/snap/qownnotes/11072/wrapper.sh: line 3: 28018 Trace/breakpoint trap   (core dumped) desktop-launch $SNAP/usr/bin/QOwnNotes -style=Breeze --snap
pbek commented 8 months ago

Wow, I saw a lot of messages on the internet on org.gtk.Settings.FileChooser crashing... 😬 Snaps are really a pita. 😬

pbek commented 8 months ago

I have no idea yet how to fix that core20 / Gnome / GTK / snap bug... The only working comment I found was Removing snap and installing from apt fixed the issue for me. 😆

eeickmeyer commented 8 months ago

The only working comment I found was Removing snap and installing from apt fixed the issue for me. 😆

🤣 🤣

I have a few snaps under my belt and might be able to play around with it too. I'd recommend trying for core22 since core20 only kicks the can down the road by two years and you'll revisit a similar problem. core22 would give it four.

And why GTK is even a factor here... 🤷

pbek commented 8 months ago

Core22 has no qmake plugin.

eeickmeyer commented 8 months ago

Core22 has no qmake plugin.

Perhaps, but you got it to build here: https://launchpad.net/~pbek/+archive/ubuntu/qownnotes?field.series_filter=jammy

There's zero difference between core22 and jammy since they're one in the same (Ubuntu 22.04). The difference is instead of qmake being a plugin, it becomes a build dependency.

pbek commented 8 months ago

Perhaps, but you got it to build here: https://launchpad.net/~pbek/+archive/ubuntu/qownnotes?field.series_filter=jammy

That's the plan for the releases. But why do you mention that. Is there another difference between launchpad and https://snapcraft.io/qownnotes/builds that I forgot?

There's zero difference between core22 and jammy since they're one in the same (Ubuntu 22.04). The difference is instead of qmake being a plugin, it becomes a build dependency.

That's a good pointer. I'll do more GitHub code searches... 😁

pbek commented 8 months ago

I finally managed to get a snap with core22 working 😅 It was so much work! And... It still crashes when accessing the Gnome file dialog! 🤣

eeickmeyer commented 8 months ago

Try adding gnome-42-2204 as a plugin and see what happens.

pbek commented 8 months ago

I'm not sure if I want to pull the whole gnome snap inside QOwnNotes. 😬 Seems like others have the same issues with snaps: https://forum.snapcraft.io/t/app-crashed-when-openning-the-file-browser/31626

eeickmeyer commented 8 months ago

To be clear, it's not the entire GNOME desktop environment (not even shell or mutter), just a few core components. Most Electron apps use this anyway; it's just a few megabytes.

pbek commented 8 months ago

I'll try with libglib2.0-0 first... Why did Snaps get such a PITA 😬 ? I was such a Snap fan.

Most Electron apps use this anyway

QOwnNotes is a Qt app, not an Electron app nor a GTK app. 😁

pbek commented 8 months ago

Meh, error 500 when I open https://snapcraft.io/qownnotes/builds. 🙈

eeickmeyer commented 8 months ago

Most Electron apps use this anyway

QOwnNotes is a Qt app, not an Electron app nor a GTK app. 😁

I'm well aware of this, but one trend I've had with Canonical lately (and I, as the lead for Ubuntu Studio have been having to fight them on) is that they've become very GNOME-centric and haven't thought about non-GTK possibilities. One lead engineer in particular had his mind blown when I told him that Qt themes and color schemes were completely detached from one another in KDE Plasma and that said color schemes could override the GTK color schemes; he couldn't fathom the concept.

So, yes, there are problems in the dependency chain, and unfortunately, there are only two of us (that are completely volunteer) trying to get this sorted.

eeickmeyer commented 8 months ago

Meh, error 500 when I open https://snapcraft.io/qownnotes/builds. 🙈

Gotta love temporary outages. :confounded:

pbek commented 8 months ago

It's 100x easier to create packages for even NixOS. https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/office/qownnotes/default.nix

I was even able to create UI (!) end2end tests easily (which I wasn't able to do anywhere yet): https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/tests/qownnotes.nix

eeickmeyer commented 8 months ago

There's a way to automate the entire process using Launchpad, believe it or not. Just requires mirroring your github repo to Launchpad and then Launchpad can do not only the building, but then it can upload straight to snapcraft.io to whichever channel you want (such as the edge channel), if that makes it easier.

pbek commented 8 months ago

That's what I do for releases. Only that I use https://github.com/pbek/QOwnNotes/blob/main/build-systems/snap/snapcraft/snapcraft.yaml as template and push directly to Launchpad.

I use https://snapcraft.io/qownnotes/builds to build from the main branch to edge.

I also build a snap in GitHub directly and push it to the snap store. 🤣

eeickmeyer commented 8 months ago

What I'm talking about is something like this: https://code.launchpad.net/ubuntustudio-system-installer

Just does it all for you and when you want an actual release, just go snapcraft release qownnotes {buildNumber} stable and you're done.

pbek commented 8 months ago

I've automated and semi-automated most of the stuff, like with https://github.com/pbek/QOwnNotes/blob/3a4f7258cb5a31c887f682f82ae4bb5803d41f8e/build-systems/snap/build-for-launchpad-snap.sh (which is called in a big tmux session inside a docker container) 😆 I think I could never decide what tool to settle on. https://snapcraft.io/ didn't exist back when I started, but I also tried to use it then in https://snapcraft.io/qownnotes/builds.

pbek commented 8 months ago

libglib2.0-0 brought success! Can you please try qownnotes from the edge channel again?

eeickmeyer commented 8 months ago

SUCCESS! IT WORKS!!!!

pbek commented 8 months ago

Finally!

pbek commented 8 months ago

Let's hope I added everything to my Launchpad snapcraft.yaml 😁

pbek commented 8 months ago

24.1.2

pbek commented 8 months ago

There now is a new release, could you please test it and report if it works for you?

pbek commented 8 months ago

Keeping my fingers crossed for https://launchpad.net/~pbek/+snap/qownnotes/+build/2349541 to run through 🤞🏻

The GitHub build snap for amd64 works for me!

eeickmeyer commented 8 months ago

It's looking good! Just ran from the stable channel and all is good! I'll watch the launchpad build along with you. :)

eeickmeyer commented 8 months ago

Oops! Looks like that build failed, but looks like a simple fix.

pbek commented 8 months ago

It's looking good! Just ran from the stable channel and all is good!

Great, thank you for testing!

I'll watch the launchpad build along with you.

I forgot to comment out one line, we'll try with the next release... Those are the arm builds anyway. Out of the 3791 weekly active devices, only like 37 are on arm64. 😁