Closed Bug 1742037 Opened 4 years ago Closed 2 years ago

[flatpak] Flatpak Firefox does not open FileChooser

Categories

(Core :: Widget: Gtk, defect, P2)

Firefox 94
defect

Tracking

()

RESOLVED INACTIVE

People

(Reporter: ningyuan.sg, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0

Steps to reproduce:

When performing an action that should open a FileChooser, (e.g. "Menu > Save page as...", or clicking the attach file button on a web email client), the FileChooser does not appear.

Actual results:

The FileChooser does not appear. There is no message, warning, or error in the Firefox console (Inspect > Console) nor on the command line (if I invoke firefox from an interactive command line).

Expected results:

FileChooser should appear.

I'll paste some system info here. I was gonna attach these as a text file, but I need the FileChooser to do that (oops)

Here, I start firefox interactively on the command line. Before the C-c ("^C") I tried opening the FileChooser via "Save page as..." and also by clicking on the attach file button of my web email client. Nothing happened in the browser, nothing logged to the Firefox console nor the command line.

(base) ning@bluecoral:~$ flatpak run --command=sh org.mozilla.firefox
[📦 org.mozilla.firefox ~]$ firefox
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
^CExiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.

I know that a common fix is to check and install xdg-desktop-portal*. They are already installed (debian bookworm):

(base) ning@bluecoral:~$ apt list xdg-desktop-portal*
Listing... Done
xdg-desktop-portal-dev/testing 1.10.1-2 all
xdg-desktop-portal-gnome/testing 41.0-1+b1 amd64
xdg-desktop-portal-gtk/testing,now 1.10.0-1 amd64 [installed,automatic]
xdg-desktop-portal-kde/testing 5.23.3-1 amd64
xdg-desktop-portal-tests/testing 1.10.1-2 amd64
xdg-desktop-portal-wlr/testing 0.5.0-1 amd64
xdg-desktop-portal/testing,now 1.10.1-2 amd64 [installed,automatic]

I've also saw a GitHub issue where updating flatpak fixed some issues. Here's my flatpak version, I think it's pretty up-to-date:

(base) ning@bluecoral:~$ flatpak --version
Flatpak 1.12.2

Here's the version of org.mozilla.firefox and its permissions. I've included my other installed packages because I thought maybe some are dependencies?

(base) ning@bluecoral:~$ flatpak list | grep org.mozilla
Firefox org.mozilla.firefox     94.0.1  stable  system
(base) ning@bluecoral:~$ flatpak list
Name                                              Application ID                                   Version                          Branch            Installation
Discord                                           com.discordapp.Discord                           0.0.16                           stable            system
Flatseal                                          com.github.tchx84.Flatseal                       1.7.4                            stable            system
Spotify                                           com.spotify.Client                               1.1.72.439.gc253025e             stable            system
Chromium Web Browser                              org.chromium.Chromium                            96.0.4664.45                     stable            system
Codecs                                            org.chromium.Chromium.Codecs                                                      stable            system
Freedesktop Platform                              org.freedesktop.Platform                         21.08.4                          21.08             system
Mesa                                              org.freedesktop.Platform.GL.default              21.1.7                           20.08             system
Mesa                                              org.freedesktop.Platform.GL.default              21.2.2                           21.08             system
Intel                                             org.freedesktop.Platform.VAAPI.Intel                                              20.08             system
Intel                                             org.freedesktop.Platform.VAAPI.Intel                                              21.08             system
ffmpeg-full                                       org.freedesktop.Platform.ffmpeg-full                                              21.08             system
openh264                                          org.freedesktop.Platform.openh264                2.1.0                            2.0               system
GNOME Application Platform version 40             org.gnome.Platform                                                                40                system
Adwaita theme                                     org.kde.KStyle.Adwaita                                                            5.15              system
KDE Application Platform                          org.kde.Platform                                                                  5.15              system
Firefox                                           org.mozilla.firefox                              94.0.1                           stable            system
Telegram Desktop                                  org.telegram.desktop                             3.2.4                            stable            system
WebKitGTK                                         org.telegram.desktop.webview                                                      stable            system
Zoom                                              us.zoom.Zoom                                     5.8.3.145                        stable            system
(base) ning@bluecoral:~$ flatpak info org.mozilla.firefox

Firefox - Fast, Private & Safe Web Browser

          ID: org.mozilla.firefox
         Ref: app/org.mozilla.firefox/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 94.0.1
     License: MPL-2.0
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 236.4 MB
     Runtime: org.freedesktop.Platform/x86_64/21.08
         Sdk: org.freedesktop.Sdk/x86_64/21.08

      Commit: 0178b75943d6c61fc5b615fefd3124be78a65a7ce5ae7a82e5e85448098b6e86
      Parent: 553fe334341e45e5e7232b508b510eac7d2d31a1ecc92d9c5103d9d91941325a
     Subject: Export org.mozilla.firefox
        Date: 2021-11-04 14:06:37 +0000
(base) ning@bluecoral:~$ flatpak info --show-permissions org.mozilla.firefox
[Context]
shared=network;ipc;
sockets=x11;wayland;pulseaudio;session-bus;pcsc;
devices=all;
filesystems=xdg-download;home;
persistent=.mozilla;

[Session Bus Policy]
org.freedesktop.Notifications=talk
org.freedesktop.FileManager1=talk
org.mozilla.firefox.*=own
org.mpris.MediaPlayer2.firefox.*=own
org.a11y.Bus=talk
org.freedesktop.ScreenSaver=talk
org.gtk.vfs.*=talk
org.gnome.SessionManager=talk

[System Bus Policy]
org.freedesktop.NetworkManager=talk
(base) ning@bluecoral:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux bookworm/sid
Release:        testing
Codename:       bookworm

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

I've figured out that when "D-Bus session bus" is disabled (via flatseal), which is the default, the FileChooser shows up as per usual.

However, when "D-Bus session bus" is enabled, I run into the bug described above.

We use standard Gtk file dialog here - so you should see the same behavior in Firefox as well as in other Gtk flatpak apps.
Can you try to install gedit from flatpak and check the behavior? https://flathub.org/apps/details/org.gnome.gedit

Blocks: flatpak
Flags: needinfo?(ningyuan.sg)
Priority: -- → P2

You can also try:

flatpak run --devel --command=sh org.mozilla.firefox
gtk3-widget-factory

and on Page 1 click on the (None) button to show the file openg dialog.

Thank you both for your help!

(In reply to Martin Stránský [:stransky] (ni? me) from comment #4)

We use standard Gtk file dialog here - so you should see the same behavior in Firefox as well as in other Gtk flatpak apps.
Can you try to install gedit from flatpak and check the behavior? https://flathub.org/apps/details/org.gnome.gedit

Unfortunately, org.gnome.gedit works fine.

(In reply to Jan Horak [:jhorak] from comment #5)

You can also try:

flatpak run --devel --command=sh org.mozilla.firefox
gtk3-widget-factory

and on Page 1 click on the (None) button to show the file openg dialog.

I had to install org.freedesktop.Sdk/x86_64/21.08 using sudo to get this to work. Without session d-bus enabled, the gtk3-widget-factory window opens instantly, and clicking on the (None) button opens the file chooser dialog as expected. With session d-bus enabled, the gtk3-widget factory window takes about a minute to open, and the file chooser dialog does not open.

In both cases, there are repeated gtk_box_gadget_distribute errors printed in the console. They repeat quite often, so I'll only show one instance of each:

(base) ning@bluecoral:~/org/roam$ flatpak run --devel --command=sh org.mozilla.firefox
error: runtime/org.freedesktop.Sdk/x86_64/21.08 not installed
(base) ning@bluecoral:~/org/roam$ flatpak run --devel --command=sh org.mozilla.firefox
[📦 org.mozilla.firefox ~]$ gtk3-widget-factory
(gtk3-widget-factory:3): Gtk-CRITICAL **: 22:04:48.517: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook

(gtk3-widget-factory:3): Gtk-CRITICAL **: 22:04:48.517: gtk_box_gadget_distribute
0' failed in GtkNotebook

I recently learnt about dbus-monitor. If it helps, I have attached the output after clicking on (None) to this thread as "dbus-monitor.gtk3-widget-factory.with-session-dbus.txt".

Flags: needinfo?(ningyuan.sg)

Does this still reproduce for you?

Flags: needinfo?(ningyuan.sg)
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(ningyuan.sg)
Resolution: --- → INVALID
Resolution: INVALID → INACTIVE

I no longer use Firefox nor Flatpak, so I have closed this as inactive. Thanks!

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: