Firefox snap 77 cannot download anything?

I noticed in the last day or two that the Firefox snap is not able to download anything anymore. I can replicate this issue on two different PCs.

My Firefox snap version is 77.0.1-1 and here are my Firefox connections:

Interface                 Plug                            Slot                             Notes
avahi-observe             firefox:avahi-observe           :avahi-observe                   -
browser-support           firefox:browser-sandbox         :browser-support                 -
camera                    firefox:camera                  :camera                          -
content[gnome-3-34-1804]  firefox:gnome-3-34-1804         gnome-3-34-1804:gnome-3-34-1804  -
content[gtk-3-themes]     firefox:gtk-3-themes            gtk-common-themes:gtk-3-themes   -
content[icon-themes]      firefox:icon-themes             gtk-common-themes:icon-themes    -
content[sound-themes]     firefox:sound-themes            gtk-common-themes:sound-themes   -
cups-control              firefox:cups-control            :cups-control                    -
dbus                      -                               firefox:dbus-daemon              -
desktop                   firefox:desktop                 :desktop                         -
desktop-legacy            firefox:desktop-legacy          :desktop-legacy                  -
gsettings                 firefox:gsettings               :gsettings                       -
home                      firefox:home                    :home                            -
joystick                  firefox:joystick                -                                -
network                   firefox:network                 :network                         -
network-observe           firefox:network-observe         -                                -
opengl                    firefox:opengl                  :opengl                          -
pulseaudio                firefox:pulseaudio              :pulseaudio                      -
removable-media           firefox:removable-media         :removable-media                 manual
screen-inhibit-control    firefox:screen-inhibit-control  :screen-inhibit-control          -
u2f-devices               firefox:u2f-devices             :u2f-devices                     -
unity7                    firefox:unity7                  :unity7                          -
upower-observe            firefox:upower-observe          :upower-observe                  -
wayland                   firefox:wayland                 :wayland                         -
x11                       firefox:x11                     :x11                             -

Here are my current system specs:

 OS: Ubuntu 18.04 bionic
 Kernel: x86_64 Linux 4.15.0-106-generic
 Uptime: 14h 9m
 Packages: 4367
 Shell: zsh 5.4.2
 Resolution: 3840x1200
 WM: Xfwm4
 WM Theme: Default
 GTK Theme: Xfce-dusk [GTK2]
 Icon Theme: elementary-xfce-darker
 Font: Noto Sans 9
 CPU: Intel Core i7-5960X @ 16x 4.3GHz [49.0°C]
 GPU: GeForce GTX 1070
 RAM: 9354MiB / 32081MiB

I opened Firefox in the terminal and it outputs this, even though the file does exist:
Sandbox: /tmp/.X11-unix/X0 is inaccessible (No such file or directory); can't isolate network namespace in content processes

When I attempted to save a file, I got this output:

Can't open portal file chooser: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.portal.Desktop was not provided by any .service files

After I fixed that error by installing xdg-desktop-portal:
sudo apt install xdg-desktop-portal

I now get a different error when attempting to save a file with Firefox, here is the output:
(firefox:8432): Gtk-WARNING **: 10:26:41.623: Can't open portal file chooser: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.1029" (uid=1000 pid=8432 comm="/snap/firefox/372/firefox " label="snap.firefox.firefox (enforce)") interface="org.freedesktop.portal.FileChooser" member="SaveFile" error name="(unset)" requested_reply="0" destination="org.freedesktop.portal.Desktop" (bus)

I think you need to install xdg-desktop-portal-gtk

After installing xdg-desktop-portal-gtk, saving is still not working, I now get this output:

(firefox:19451): Gtk-WARNING **: 11:06:32.651: Can't open portal file chooser: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.portal.FileChooser' on object at path /org/freedesktop/portal/desktop

did you log out/in again after installign the package ? it might probably not be registered immediately on the active session bus just by installing it …

Yep, logging out/in did not help, it still displays the same error (firefox:3656): Gtk-WARNING **: 11:22:20.973: Can't open portal file chooser: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.portal.FileChooser' on object at path /org/freedesktop/portal/desktop

I’ve reproduced this on 18.04. However, downloads worked fine but “Save As” was triggering the snapd denial accessing the portal interface. I updated to snapd 2.45.1 from the candidate channel which fixed that. @jdstrand were there any interface fixes in 2.45.1 that should have fixed portal access? I know portal access was working long ago.

1 Like

Yes. fixed an issue if the portal wasn’t running yet since it relies on activation and older releases don’t have AssumedAppArmor=unconfined in the service file.

@jdstrand Thanks! Great to understand why.

I’m afraid I’m not super experienced with Linux quite yet, I’ve only used it for a few years now so the concept of busses is still fairly new to me. Did I indeed find a regression, or is this working “as intended”? What steps are there for me to take to get the Save dialog working in Firefox snap again, or do I just need to wait for something to get fixed upstream?

You indeed found a valid bug, which is fixed in the upcoming version 2.45.1 of snapd.
If you want the fix right away, you can run the following command:

snap refresh snapd --candidate

Otherwise just wait for the fix to be released to the stable channel, it should be there very soon.

1 Like

I’m still kind of confused. I’m on Ubuntu 18.04, I have snapd installed from bionic-updates which has version 2.42.1+18.04.

Apparently this 2.42.1+18.04 version of snapd was published to bionic-updates back on 2019-11-26 so how is this bug popping up just now for me as of a few days ago and not weeks or months ago? Also, I suppose the new proposed 2.45.1 could be months away from being published on bionic-updates - if it ever gets published on bionic-updates?

Also, I did try snap refresh snapd --candidate but it wasn’t installed as a snap, I had installed it through apt via bionic-updates so I tried snap install snapd --candidate and that did successfully install, but I’m pretty sure my system snapd version is still 2.42 so this bug is still present for me?

Is it somehow possible I found a different, unrelated bug, or more than 1 bug if I’ve been on the same version of snapd supposedly for months yet the Save dialog only broke in Firefox a few days ago?

edit: it seems like I might be onto something, after more trial and error, it seems like even the apt version of Firefox is unable to open the file picker whereas the Discord snap can open it just fine. I think this is a Firefox bug.

the snap version command will tell you … normally snapd runs from a snap (either the core snap or the snapd snap, depending on how your system was originally installed) … the apt package is only used to “jumpstart” the snap later …

1 Like

Ah yes, you are right, I am running the newer snap version.

I think this thread can probably be closed now since I am pretty sure the main bug I am experiencing is not related to snap and I found an unrelated snap bug.

edit: one of my two computers experiencing this bug no longer experienced it, for no reason, I changed nothing. I checked the difference and it appears that one of the two computers (the fixed one) was using xdg-desktop-portal and xdg-desktop-portal-gtk 1.2.0 whereas the other one had 1.0.2, and both were using snapd 2.45. I upgraded to xdg-desktop-portal and xdg-desktop-portal 1.2.0 from 1.0.2, and I was presented again with the AppArmor error however the regular apt Firefox save dialog was working again. I refreshed snapd to candidate branch (version 2.45.1) and restarted snapd then relaunched the Firefox snap and the save dialogue was working again. I believe it was a combination of having an “outdated” xdg-desktop-portal/xdg-desktop-portal-gtk combined with a snapd bug resulting in this problem. I don’t understand why it was fixed on the other computer, though, but I guess some things will always be a mystery.

This is now solved for me.

For version 84.0-3 and
snap 2.48
snapd 2.48
series 16
ubuntu 16.04
kernel 4.15.0-15-generic

Can’t open portal file chooser: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface ‘org.freedesktop.portal.FileChooser’ on object at path /org/freedesktop/portal/desktop

problem still continues.

Same issue here.
My versions are the same except for Ubuntu 20.04 and kernel 5.4.0.

Downloading only works when I choose to (automatically) save to the ‘Downloads’ directory - setting in preferences.