Bug 498748

Summary: Detect when an updateable Snap is currently running, and prompt the user to quit it or abort updating, because otherwise doing so will fail
Product: [Applications] Discover Reporter: m.wege
Component: Snap BackendAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: aleixpol, nate
Priority: NOR Keywords: usability
Version First Reported In: 6.2.5   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: screenshot showing the current handling
screenshot showing the current handling II

Description m.wege 2025-01-16 15:56:35 UTC
Created attachment 177417 [details]
screenshot showing the current handling

Sometimes updating via Discover fails with a "technical error" - and does offer a solution, although in many cases it could be easy. E.g. if the update of a snap does not work, because it is open. Discover could suggest closing the snap or update everything besides the snap.
Comment 1 m.wege 2025-01-16 15:57:09 UTC
Created attachment 177418 [details]
screenshot showing the current handling II
Comment 2 Nate Graham 2025-01-16 18:04:40 UTC
The problem is that there are so many ways this can fail, and Discover can't know what it is; the error message comes from the backend, and as your screenshot shows, it can be translated, so Discover can't even rely on string keyword matching to try to guess what the error might be.

Discover could anticipate and prevent known error conditions ahead of time though. For example, if we know that a Snap can't be updated while running, Discover could check for that. Let's make the bug report about that specifically.
Comment 3 m.wege 2025-01-18 15:47:35 UTC
Other cases, I have discovered:
* Missing GPG-keys [NO_Pubkey [Key]
* double entries of repositories
* when a "sudo apt --fix-broken install" is necessary

Would these be detectable and could there be offered solutions? Should I create separate reports?
Comment 4 m.wege 2025-01-18 16:08:00 UTC
A strange one is "snap has no updates available", even though an update for a snap app is shown.
Comment 5 Nate Graham 2025-01-21 19:46:26 UTC
I think it's reasonable for Discover to pre-detect error conditions that can't be prevented in another way. For issues like double repositories or "when a "sudo apt --fix-broken install" is necessary", these feel like deeper bugs in the system or its configuration that should be preventable in another way.