Bug 515150 - Discover crashes when I try to apply updates - FlatpakBackend::getAppForInstalledRef(...) at FlatpakBackend.cpp:536
Summary: Discover crashes when I try to apply updates - FlatpakBackend::getAppForInsta...
Status: REPORTED
Alias: None
Product: Discover
Classification: Applications
Component: Updates (other bugs)
Version First Reported In: 6.5.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-27 11:23 UTC by BOF
Modified: 2026-01-28 22:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
gdb backtrace (91.27 KB, text/plain)
2026-01-28 22:00 UTC, BOF
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BOF 2026-01-27 11:23:30 UTC
SUMMARY
When I open Discover and try to apply updates Discover crashes every time.

STEPS TO REPRODUCE
1. Open Discover when connected to the internet
2. Just wait until it searched for updates

OBSERVED RESULT
Discover crashes every time

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS

Discover version: 6.5.5

Operating System: KDE neon User Edition
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.22.0
Qt Version: 6.10.1
Kernel Version: 6.14.0-37-generic (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
1) If you are not connected to the internet Discover does not crash. When not connected it showed me that there are some system packages ready to be updated, but when reconnected to the internet and on research for updates Discover crashes again.
It seems to crash when it's at the step for searching for updates to flatpacks. So this might be related to Bug 512960.

2) I'm trying to get a backtrace right now, but this might take some time.
If you have a link to a step by step guide it could be easier for me.
Comment 1 BOF 2026-01-27 11:29:50 UTC
Opened from terminal:

plasma-discover 
libs QList("/usr/lib/x86_64-linux-gnu/qt6/plugins", "/usr/bin")
org.kde.plasma.libdiscover: OdrsReviewsBackend: Fetch ratings: false
org.kde.plasma.libdiscover: OdrsReviewsBackend: Error parsing ratings: "Unbekannter Fehler" "Ungültiger Wert"
adding empty sources model QStandardItemModel(0x5962204ce790)
looking up wrong category or too early "Games"
looking up wrong category or too early "Development"
ASSERT failure in getAppForInstalledRef: "app/com.github.marinm.songrec/x86_64/stable", file /workspace/build/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp, line 536
KCrash: Application 'plasma-discover' crashing... crashRecursionCounter = 2
Aborted (core dumped)
Comment 2 BOF 2026-01-28 22:00:20 UTC
Created attachment 189004 [details]
gdb backtrace

Full backtrace of the crash.


) uname -r
6.14.0-37-generic

) lsb_release -a
No LSB modules are available.
Distributor ID: Neon
Description:    KDE neon User Edition
Release:        24.04
Codename:       noble

) plasma-discover --version
discover 6.5.5

) gdb --version
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git


According to ChatGPT Discover was ended intentionally because of a "Q_ASSERT" in the FlatpakBackend. The trigger is an installed Flatpak-Ref, for that Discover can not make a FlatpakResource.
Comment 3 BOF 2026-01-28 22:11:47 UTC
Further ChatGPT comments:

The crash lies here:
#10 FlatpakBackend::getAppForInstalledRef(...)
    at FlatpakBackend.cpp:536

and before that:
ASSERT failure in getAppForInstalledRef:
"app/com.github.marinm.songrec/x86_64/stable"
file FlatpakBackend.cpp, line 536

qt is doing:
qFatal → qAbort → abort() → SIGABRT

getAppForInstalledRef() seems to expect an app-object (?) for every installed FlatpakRef that Discover knows or can create (/build?)

The stack is:
FlatpakBackend::listInstalledRefsForUpdate()
 → search()
 → getAppForInstalledRef()

o) flatpak info com.github.marinm.songrec

SongRec - An open-source, unofficial Shazam client for Linux, written in Rust.

         Kennung: com.github.marinm.songrec
             Ref: app/com.github.marinm.songrec/x86_64/stable
     Architektur: x86_64
           Zweig: stable
         Version: 0.4.3
          Lizenz: GPL-3.0+
        Ursprung: flathub
        Sammlung: org.flathub.Stable
    Installation: system
     Installiert: 8,5 MB
Laufzeitumgebung: org.freedesktop.Platform/x86_64/25.08
             Sdk: org.freedesktop.Sdk/x86_64/25.08

          Commit: b29611a572c18df4b127ab527367f45ab7c314476fdd10a917a76cf893ebde95
          Parent: 9f91fad606bd191d6370b40d72b7c3a014caf9c907af6ffb783226a79f6f4826
         Betreff: Merge pull request #9 from Fei1Yang/update-runtime (1e076ac865bc)
           Datum: 2025-10-12 18:17:19 +0000

o) flatpak info --show-ref com.github.marinm.songrec
app/com.github.marinm.songrec/x86_64/stable
Comment 4 BOF 2026-01-28 22:17:33 UTC
From a UX point of view, this looks like a deadlock as I can not update the system or discover by opening it (I can probably update the system via the command line, but this should not be expected from a new Linux user who may even just left Windows)

I still wonder how a new user would actually do that. Because Discover crashes during startup, users have no way to recover from broken Flatpak metadata using the GUI. A safe-mode or backend-disable mechanism is missing.

Something like 
o) plasma-discover --safe-mode
that disables flatpaks, online repos and only allows local PackageKit data

or a question on crash:

„Discover crashed while loading Flatpak backend.
Start without Flatpak support? [Yes] [No]“

would be interesting to have.