Firefox Snap Testing 2021-2022

Hi folks! Me again with our latest update :slight_smile:

We’ve made very positive progress since the last post and all our fixes have landed in stable, so you should see the benefit today! Please do let us know your latest timings. It’s a huge help.

There is still further to go of course, but luckily we still have 2-3 promising routes to bringing the start times down even further.

5 Likes

Nice to see the gnome content snap getting some LZO love. For the record, the KDE snaps have been doing this for quite some time, too: https://invent.kde.org/packaging/snap-kf5/-/commit/088904526d7e3cdaefc333cc194c7ae828376a39

5 Likes

Firefox snap performance test(new user account):

  • Cold – Purge: 2388, 2406. Average: 2397 ms (I removed ~/snap/firefox folder)
  • Cold: 2816, 2796. Average: 2806 ms
  • Warm: 1353, 1369, 1369, 1401, 1355. Average: 1369,4 ms

Firefox snap performance test(28 tabs, some extension, what I use on a daily basis):

  • Cold: 2284, 2660, 2537. Average: 2494 ms
  • Warm: 1541, 1516, 1863, 1539, 1537, 2528, 1789, 1772, 1755, 1772, 1744, 1762. Average: 1759 ms

Additional info:

  • Firefox snap 103.0b6 (64-bit)
  • Ubuntu 22.04 (fully updated), kernel 5.15.0-25-generic, Wayland, Performance mode: Balanced
  • Hardware: ideapad 5 Pro-14ACN6 Laptop - Type 82L7, 16,0 GiB, AMD® Ryzen 7 5800u with radeon graphics × 16, NVIDIA GeForce MX450.

I use beta version because on stable pinch to zoom isn’t working.

3 Likes

When will we see this update on Ubuntu 22.04?

I’m really impress with this improvements, in Ubuntu 22.04 with snap FireFox 102.0.2-1 in my Thinkpad t14s gen 1 went from a cold start of 4-5s to 1.3s this is amazing! (no extensive testing)

Thanks for all the work! :heart:

I hope that all the learning is reflected in documentation of good practices and how to optimize snaps and that also all the improvements also work for the entire snap ecosystem

7 Likes

Firefox snap broken in Guest Account on Xubuntu 22.04 (Jammy)

As I couldn’t find any other place mentioning this problem with Firefox snap, I’ll mention it here. If any body know a more appropriate place I’d be happy to hear it.

My laptop is sometimes used by visitors. They want to browse the internet. So I setup the guest-account. I found out that the Firefox snap is broken on guest-accounts.

When opening Firefox nothing happens. When starting FF from the command line of the guest-account I found out the following:

$ firefox
2022/07/12 00:46:01.906615 tool_linux.go:82: cannot open snapd info file “/snap/snapd/current/usr/lib/snapd/info”: open /snap/snapd/current/usr/lib/snapd/info: permission denied

Did anybody come across this problem or is it being resolved?

(running: Xubuntu 22.04)

Is Xubuntu using (or enabling the use of) LightDM?
It’s probably a problem with the guest session running under a very restrictive apparmor profile that doesn’t even allow snaps to start. And it looks similar to this old thread on the snapcraft forum.

3 Likes

This is in fact an old issue with all snaps (not just firefox) when running a lightdm guest session.

1 Like

It may be old, but not obsolete. Guest sessions still come in very handy.
Now that Ubuntu 16.04 LTS is retired, users are forced to lose using their guest-session abilities.
That’s why it has become un-circumvent-able now and a prominent problem.
I found multiple bugs, dating back 6 years that point out the problems, but don’t get fixed.


2 Likes

And another issue with Firefox Snap on Xubuntu 22.04 LTX with XFCE.

The Firefox icon disappears on the panel Shortcut, after Snap updates Firefox.

And yet another issue with Firefox Snap:

I repeatedly got cryptic messages saying: "Pending update of “firefox " snap” Close the app to avoid disruptions.

No matter how many times I closed Firefox, nothing got updated and the cryptic messages kept reappearing.

I ran the software updater (and tried apt update and upgrade), but nothing changed. The messages still kept appearing.

After researching the problem on the internet, I found an answer here: https://askubuntu.com/questions/1412140/pending-update-of-firefox-snap-close-the-app-to-avoid-disruptions

It turns out you have to separately and manually update the Snap to stop the annoying messages from disturbing you.

(Xubuntu 22.04 LTS, XFCE with Firefox 103.0 (64-bit) cannonical-002 - 1.0)

1 Like

I cannot get a fresh install of the firefox snap on 22.04 to download files.

The versions are.
Snap version: firefox 103.0-1 1589 latest/stable
xdg-desktop-portal version: 1.14.3-0ubuntu2

This is what I did.

Install firefox snap and launch it. Then try a download.

Download does not start. No indications are given to the user. The following apparmor messages appear in syslog.

roger@dragon:~$ tail -f /var/log/syslog | grep 'DENIED.*firefox' -
Jul 29 09:41:34 dragon kernel: [ 3385.254321] audit: type=1400 audit(1659084094.968:111): apparmor="DENIED" operation="mkdir" profile="snap-update-ns.firefox" name="/usr/share/libreoffice/help/" pid=11063 comm="5" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Jul 29 09:41:34 dragon kernel: [ 3385.254379] audit: type=1400 audit(1659084094.968:112): apparmor="DENIED" operation="open" profile="snap-update-ns.firefox" name="/var/lib/" pid=11063 comm="5" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Jul 29 09:42:38 dragon kernel: [ 3448.310657] audit: type=1400 audit(1659084158.021:114): apparmor="DENIED" operation="open" profile="snap.firefox.firefox" name="/etc/fstab" pid=11037 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Jul 29 09:42:38 dragon kernel: [ 3448.311776] audit: type=1400 audit(1659084158.021:115): apparmor="DENIED" operation="open" profile="snap.firefox.firefox" name="/run/mount/utab" pid=11037 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Jul 29 09:42:38 dragon kernel: [ 3448.372232] audit: type=1400 audit(1659084158.081:116): apparmor="DENIED" operation="open" profile="snap.firefox.firefox" name="/run/mount/utab" pid=11037 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

Download requested at this point.

Jul 29 09:42:38 dragon kernel: [ 3448.428296] audit: type=1107 audit(1659084158.137:117): pid=1229 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.173" pid=11037 label="snap.firefox.firefox" peer_pid=12351 peer_label="unconfined"
Jul 29 09:42:38 dragon kernel: [ 3448.428788] audit: type=1107 audit(1659084158.137:119): pid=1229 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.173" pid=11037 label="snap.firefox.firefox" peer_pid=12351 peer_label="unconfined"

This what I expected to happen.

Download started and shown on the UI.

I thought this was fixed a while ago. Maybe I have some residual config issues

Here is a grep for firefox related stuff in the apparmor policies.

roger@dragon:/etc/apparmor.d$ find . -type f -exec grep -i -n firefox {} \; -print
28:  # this should cover all firefox browsers and versions (including shiretoko
30:  /usr/bin/firefox Cxr -> sanitized_helper,
31:  /usr/lib{,64}/firefox*/firefox* Cx -> sanitized_helper,
./abstractions/ubuntu-browsers
10:  # have 'ix' to restrct access to what only firefox is allowed to do
./abstractions/ubuntu-browsers.d/mailto
5:  # firefox-notify
./abstractions/ubuntu-browsers.d/ubuntu-integration-xul
8:  # Text editors (It's All Text [https://addons.mozilla.org/en-US/firefox/addon/4125])
./abstractions/ubuntu-browsers.d/text-editors
208:  owner @{HOME}/.mozilla/firefox/profiles.ini r,
209:  owner @{HOME}/.mozilla/firefox/*/secmod.db r,
210:  # firefox < 58
211:  owner @{HOME}/.mozilla/firefox/*/cert8.db r,
212:  # firefox >= 58
213:  owner @{HOME}/.mozilla/firefox/*/cert9.db r,
./usr.lib.libreoffice.program.soffice.bin

Any ideas on how to fix this? Or is it still a bug?

This is probably because the desktop file installed by snapd for the firefox snap contains a versioned path to the icon:

$ grep Icon /var/lib/snapd/desktop/applications/firefox_firefox.desktop 
Icon=/snap/firefox/1635/default256.png

And that path might become unavailable when the snap is refreshed. I’m not sure how xfce4-panel works, but it should probably detect when the desktop file is overwritten, and refresh the corresponding icon. Can you file an upstream bug for this, and share the link to it here?

2 Likes

Yes indeed. The message is a bit misleading, because closing the app won’t automatically update it. I know that the snapd team intends to improve this user experience though.

3 Likes

This is definitely expected to work. What is your Downloads folder set to in Firefox’s preferences? Is this a directory under your home dir?

Do the downloads fail similarly if you right-click on a link and choose to “save target as…” ?

1 Like

Firefox keeps disappearing from my desktop, because the frequent snap updates remove the panel Icon each time. XFCE cannot change this, so logging a bug over there is not constructive.
I just fixed the annoying message: "Pending update of “firefox " snap” Close the app to avoid disruptions.
And added an Icon again.
And now a new identical message is displayed againg already: "Pending update of “firefox " snap” Close the app to avoid disruptions.

This will be happening again and again and again and again and again…

Judging from the pace of progress and attitude towards the filed bug reports (6 years old) this will not be fixed any time soon, and according to the attitude toward the bugs probably never.

Because of the repetitive nature of the bugs, Firefox snap is very high maintenance in Xubuntu 22.04 LTS.

As I am a mere user I have done what I can do in aiding with contributing to getting things better. The only way I can triage the problems myself with a definite fix, would be to get back to dpkg managed Firefox. However now that 16.04 LTS is retired, that bridge seems to have been burned in Ubuntu and we’re stuck with snap in Xubuntu 22.04. We’re stuck with an ongoing triage again and again and again…

Doing the same thing over and over again
but expecting different results.
Is the definition of Insanity according to Albert Einstein.

Hi:

To fix that, you have to close Firefox, open the Snap Store, and there press the “update button” to update Firefox. The other alternative is to close Firefox and wait until Snapd does another round of updates check, so it gets automagically updated.

I don’t know if Snapd does a check for the specific PID that has to be updated, and when it is killed, do an update in that precise moment… Also, probably a more specific message would be good too.

1 Like

How do you know this cannot be fixed in XFCE’s panel? Other desktop environments don’t have a problem with snap applications’ desktop files, so I wouldn’t be so prompt in dismissing an interaction with xfce4-panel that could potentially be solved there. This is not something I have the time to investigate right now, but I’m making a note to look into it when time permits. In any case, having a bug to track the issue would be useful, because it’s easy to lose track of individual issues in long threads like this one.

Yes, this is a sub-optimal user experience, it is a confusing message. The snapd team is very much aware of it and are working on improving it.

And your constructive feedback is very much welcome. Thanks for it! Your frustration is understandable too. Please understand that with a finite amount of developers’ time it’s a game of priorities, and some issues might not be receiving the attention you personally think they deserve.

5 Likes

My Downloads folder is directly under my home directory.

I now realise that the failure only occurs on certain links. The one I found it on is .

https://sourceforge.net/projects/openofficeorg.mirror/files/4.1.13/binaries/en-GB/Apache_OpenOffice_4.1.13_Linux_x86-64_install-rpm_en-GB.tar.gz/download

As you can see this points at SourceForge. The link itself is from here
https://www.openoffice.org/download/.

The failure causes apparmor to record to following denials in /var/log/kern/log.

Aug  5 15:22:09 dragon kernel: [19364.169847] kauditd_printk_skb: 352 callbacks suppressed
Aug  5 15:22:09 dragon kernel: [19364.169848] audit: type=1400 audit(1659709329.851:581): apparmor="DENIED" operation="open" profile="snap.firefox.firefox" name="/run/mount/utab" pid=7462 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Aug  5 15:22:09 dragon kernel: [19364.216808] audit: type=1107 audit(1659709329.899:582): pid=1359 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.490" pid=7462 label="snap.firefox.firefox" peer_pid=21181 peer_label="unconfined"
Aug  5 15:22:09 dragon kernel: [19364.216808]  exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
Aug  5 15:22:09 dragon kernel: [19364.216816] audit: type=1420 audit(1659709329.899:583): subj_apparmor=unconfined
Aug  5 15:22:09 dragon kernel: [19364.216839] audit: type=1107 audit(1659709329.899:584): pid=1359 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.490" pid=7462 label="snap.firefox.firefox" peer_pid=21181 peer_label="unconfined"
Aug  5 15:22:09 dragon kernel: [19364.216839]  exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
Aug  5 15:22:09 dragon kernel: [19364.216841] audit: type=1420 audit(1659709329.899:585): subj_apparmor=unconfined
Aug  5 15:22:09 dragon kernel: [19364.216866] audit: type=1107 audit(1659709329.899:586): pid=1359 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.490" pid=7462 label="snap.firefox.firefox" peer_pid=21181 peer_label="unconfined"
Aug  5 15:22:09 dragon kernel: [19364.216866]  exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
Aug  5 15:22:09 dragon kernel: [19364.216868] audit: type=1420 audit(1659709329.899:587): subj_apparmor=unconfined
Aug  5 15:22:09 dragon kernel: [19364.216896] audit: type=1107 audit(1659709329.899:588): pid=1359 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.490" pid=7462 label="snap.firefox.firefox" peer_pid=21181 peer_label="unconfined"
Aug  5 15:22:09 dragon kernel: [19364.216896]  exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
Aug  5 15:22:09 dragon kernel: [19364.216899] audit: type=1420 audit(1659709329.899:589): subj_apparmor=unconfined
Aug  5 15:22:09 dragon kernel: [19364.217115] audit: type=1107 audit(1659709329.899:590): pid=1359 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.490" pid=7462 label="snap.firefox.firefox" peer_pid=21181 peer_label="unconfined"
Aug  5 15:22:09 dragon kernel: [19364.217115]  exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'

Downloads that do work do not generate any apparmor denials. I am unsure whether the kuditd_printf_skb message has any relevance.

The snap.firefox.firefox profile can be found at /var/lib/snapd/apparmor/profiles/snap.firefox.firefox.

The Firefox snap does not create any files on the desktop. And it is also not removing any files from the desktop.

If you have problems with icons, you have very likely copied the file /var/lib/snapd/desktop/applications/firefox_firefox.desktop. The file /var/lib/snapd/desktop/applications/firefox_firefox.desktop is pointing the Icon entry to the image in the currently installed Firefox snap:

# for example
Icon=/snap/firefox/1635/default256.png

The icon can be shown as long as the path to the image exists. Because it is a copy, the content will not be changed.

To avoid this issue, you can either create a symlink to /var/lib/snapd/desktop/applications/firefox_firefox.desktop or you can change the line in your copy

# from
Icon=/snap/firefox/1635/default256.png
# to
Icon=/snap/firefox/current/default256.png

As far as I understand it, the file /var/lib/snapd/desktop/applications/firefox_firefox.desktop is created from snapd.