elementary / triage

Catch-all repo for issues that don't have a better home
https://elementary.io
4 stars 2 forks source link

Flatpak apps do not work #600

Open megatux opened 1 month ago

megatux commented 1 month ago

What Happened?

I'm on the Demo session of the daily build ISOs. This happends in all daily images I tried since about 2 or 3 weeks.

$ flatpak run io.elementary.calculator bwrap: Creating new namespace failed: Permission denied error: Fallo al sincronizar con el proxy de dbus

The workaround I found is to chmod u+s /usr/bin/bwrap

Steps to Reproduce

Click on any flatpak app or flatpak run ... command.

Expected Behavior

apps should run

OS Version

8.x (Early Access)

Session Type

Classic Session (X11, This is the default)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

Acer laptop Nitro5 , intel integrated + nvidia gtx1650

teamcons commented 1 month ago

Huh. Didnt meet that one. Have you tried on a release candidate ?

Does entering this in a console fix it (with or without sudo) ?

chmod u+s /usr/bin/bwrap

megatux commented 3 weeks ago

With sudo, of course. A release candidate? hmm hard to be 100% sure, I have tried one or two RCs besides daily builds. I could try with latest one (elementaryos-8.0-stable.20241025rc.iso was built vie, 25 oct 2024.). BTW, is there a way to start demo session with Wayland compositor instead of X?

megatux commented 2 weeks ago

Just tried with 10-3 daily build and the issue is still present.

teamcons commented 1 week ago

I can reproduce the issue

teamcons commented 1 week ago

Another user in Discussions has the issue, this is the list of apps and whether they launch or not:

App Center - launches Calendar - launches Code - launches Feedback - launches Files - launches GParted - launches Install Elementary OS - launches Mail - launches Multitasking View - launches Photos - launches Shortcuts - launches System Settings - launches Tasks - launches Terminal - launches

Calculator - does not Camera - does not Document Viewer - does not Music - does not Screenshot - does not Videos - does not Web - does not

Moving the list here so it is kinda centralized

vjr commented 1 week ago

Could this have anything to do with the AppArmor issue where it prevents some apps from running? Someone want to try to disable AppArmor temporarily and see if the apps start working?

teamcons commented 1 week ago

I found this which supposedly kinda fix the issue. Needs digging down. If upstream is fine with the issue, maybe something like this could be a solution

https://etbe.coker.com.au/2024/04/24/ubuntu-24-04-bubblewrap/

vjr commented 1 week ago

OK if it really is this AppArmor issue - then perhaps the ISO build should include specific profiles for each built-in app that is not opening? Instead of a broader loosening of permissions?

teamcons commented 1 week ago

We could. I dont know if that would be reliable, though, because bwrap could act up later/on later builds/for other people for those which seem to work. From memory, i borked the UEFI and needed to rely on Web in Demo Mode for the steps to unbork it, and it ran fine

Also the demo is not intended to be used for anything sensitive. It is what people will use to test eOS. If some apps randomly do not work, users could decide to drop the distro/not support. With 8 around the corner it feels like theres not much time to avoid this to happen.

Im not at home, cannot check now, but could you check whether you have The Issue reproducing like the list above ?

vjr commented 1 week ago

Im not at home, cannot check now, but could you check whether you have The Issue reproducing like the list above ?

Yep I can repro this.

teamcons commented 1 week ago

Where does the issue should go ? For the PR to add apparmor profiles ? https://github.com/elementary/os ? I can look up how to do profiles and do one for all of the faulty ones but i dont know where i should commit them nor why that happens

danirabbit commented 1 week ago

We probably should ship the profiles with each affected package. So in the deb-packaging branch of each repo. If you have working profiles and just don’t know where to put them feel free to dump them in the comments here and someone else can figure out how to install them. Thanks for looking into this!

ryonakano commented 3 days ago

Could this have anything to do with the AppArmor issue where it prevents some apps from running?

I believe this is surely related to AppArmor. The journal when trying to launch Web on the live image says:

Screenshot from 2024-11-20 21-03-20

ryonakano commented 3 days ago

Looks like the AppArmor profile for bwrap is included in the apparmor-profiles. Running the two following commands launches Web successully on OS 8 RC live image:

sudo apt install apparmor-profiles
sudo apparmor_parser -r /usr/share/apparmor/extra-profiles/bwrap-userns-restrict
teamcons commented 3 days ago

Why does this issue not appear on installed system ?

vjr commented 3 days ago

Why does this issue not appear on installed system ?

Not sure, just a guess that perhaps the seeds repo needs to include the package apparmor-profiles in the live file there?

But question still remains - maybe Ubuntu noble desktop image already has the package included but not for live packages?

danirabbit commented 2 days ago

Created a branch to pull apparmor-profiles into live seeds: https://github.com/elementary/seeds/pull/136

and to add a new live hook to configure the bubblewrap profile: https://github.com/elementary/os/pull/735

danirabbit commented 2 days ago

@vjr afaict it isn't installed on the actual system. According to https://git.launchpad.net/ubuntu/+source/apparmor/tree/profiles/apparmor/profiles/extras/bwrap-userns-restrict this profile basically removes all restrictions from bubblewrap

tbh we might want to do this on the installed system as well if it fixes flatpak apps not opening in the guest session

teamcons commented 2 days ago

if it doesnt introduce security issues...

danirabbit commented 2 days ago

Flatpak apps in bubblewrap are already sandboxed so I'm actually not sure why they are additionally sandboxing bubblewrap itself with apparmor

danirabbit commented 2 days ago

Just waiting for this to publish and then we can trigger a build and make sure it was fixed https://code.launchpad.net/~elementary-os/+archive/ubuntu/daily/+packages?field.name_filter=meta&field.status_filter=published&field.series_filter=noble

danirabbit commented 2 days ago

Whelp, the hook errors. There's probably something I'm missing here but I don't know enough about how hooks work in the build system or about apparmor tbh

Reverted and drafted https://github.com/elementary/os/pull/738