Bug 487117

Summary: can't update snap in discover because they are already installed
Product: [Applications] Discover Reporter: kevindu52defargoth
Component: Snap BackendAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: aleixpol, julien.dlq, kevindu52defargoth, soumyadeepghosh2004
Priority: NOR    
Version First Reported In: 6.0.4   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: error message
the stalled update in the Update page

Description kevindu52defargoth 2024-05-16 20:02:17 UTC
Created attachment 169543 [details]
error message

SUMMARY
When updating with discover, it can't update bash-language-server with the error

> snap "bash-language-server" is already installed.

I guess there would be the same problem with other snaps, but the update stops at this point.

STEPS TO REPRODUCE
1. Have the snap package bash-language-server at an older version installed.
2. In discover click on "Updates all".
3. Click through the security warnings.

OBSERVED RESULT
snap "bash-language-server" is already installed.

EXPECTED RESULT
Should be able to update

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.5.0-35-generic (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Comment 1 Soumyadeep Ghosh 2024-09-23 20:41:47 UTC
The update was auto applied in the background probably. And there is no update available anymore. Can you give us some more input?
Comment 2 kevindu52defargoth 2024-09-26 16:18:34 UTC
Created attachment 174114 [details]
the stalled update in the Update page

(In reply to Soumyadeep Ghosh from comment #1)
> The update was auto applied in the background probably. And there is no
> update available anymore. Can you give us some more input?

Of course.

The issue is still present, each time I update I get a notification about snap being incompatible with security sandboxing, then the error. Everything else update normally. Since last time, I noticed Firefox is up to date.

The package is still outdated according to snap info:
```
  latest/stable:    4.7.0 2023-06-26 (69) 30MB classic
  latest/candidate: ↑                          
  latest/beta:      ↑                          
  latest/edge:      4.7.0 2023-11-02 (80) 30MB classic
installed:          2.0.0            (27) 33MB -
```

In the Update tab, Discover simply says "Refresh of version 2.0.0". 
When I go Installed > Bash Language Server, it  says the installed version is 2.0.0. But then in Update the text turned into "Refresh of version 4.7.0". When I apply the update in this  state, it hit the error, then the text turns back to "Refresh of version 2.0.0".
Comment 3 Soumyadeep Ghosh 2024-10-07 16:14:15 UTC
Try clearing the cache, and see what happens.

remove this file

`rm -rf $HOME/.cache/discover`
Comment 4 kevindu52defargoth 2024-10-11 15:43:38 UTC
Removing `$HOME/.cache/discover` didn't solved the problem. I also deleted `/var/lib/snapd/cache/*` and now the issue is gone.

Thanks for the help