Bug 432926

Summary: Cannot update Flatpak apps and addons installed to system location, rather than user location
Product: [Applications] Discover Reporter: Andy Great <andythe_great>
Component: Flatpak BackendAssignee: Dan Leinir Turthra Jensen <leinir>
Status: CONFIRMED ---    
Severity: normal CC: aleixpol, jgrulich, nate, rawat.arnav
Priority: NOR    
Version First Reported In: 5.20.5   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: screenshot of error
password twice to finish update

Description Andy Great 2021-02-14 10:49:28 UTC
Created attachment 135679 [details]
screenshot of error

SUMMARY
I install a lot of flatpak apps, but when I attempts to update it from Discover, it show an error message.

Flatpak system operation Deploy not allowed for user

STEPS TO REPRODUCE
1. Install some flatpaks apps.
2. Wait for updates and press update all from Discover.
3. Discover will ask for password, but the error will occur before I could type in password.
4. Abort due to failure (Flatpak system operation Deploy not allowed for user)

EXPECTED RESULT
I think Discover attempts to update Flatpak apps before getting the password, so it got reject. Should wait for password first.

Operating System: openSUSE Tumbleweed 20210210
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.10.12-1-default
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-3770 CPU @ 3.40GHz
Memory: 7.5 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4000
Comment 1 Nate Graham 2021-02-16 20:10:54 UTC
Seems like this error comes from Flatpak itself. Does it work if you manually update using `flatpak update` in a terminal window?
Comment 2 Andy Great 2021-02-16 20:20:08 UTC
(In reply to Nate Graham from comment #1)
> Seems like this error comes from Flatpak itself. Does it work if you
> manually update using `flatpak update` in a terminal window?

It will show the same error if I use "flatpak update".
I have to use "sudo flatpak update" to work.
Comment 3 Nate Graham 2021-02-16 21:18:00 UTC
Thanks. Looks like those Flatpaks were installed systemwide rather than per-user, and Discover can't handle this.
Comment 4 Aleix Pol 2021-02-19 16:02:30 UTC
It's perfectly fine to update system apps.

sudo should not be necessary to upgrade system-wide flatpak installations either.
Comment 5 Andy Great 2021-02-19 18:15:10 UTC
(In reply to Aleix Pol from comment #4)
> It's perfectly fine to update system apps.
> 
> sudo should not be necessary to upgrade system-wide flatpak installations
> either.

Hi, from what I observed on my machine, when I click "update all" the error "Abort due to failure (Flatpak system operation Deploy not allowed for user)" will popup at the same time as password prompt. I have to click "update all" again to finish the update.
Comment 6 Andy Great 2021-02-19 18:15:33 UTC
Created attachment 135911 [details]
password twice to finish update
Comment 7 arawat 2021-07-15 01:57:46 UTC
It looks like the flatpak backend downloads the first app, then attempts to install it to the system-wide flatpak installation, which causes the polkit permissions dialog to pop up. The problem with "Flatpak system operation Deploy not allowed for user" occurs when the backend tries to update a second flatpak while the polkit dialog is still open - this causes the installation attempt to fail immediately.