[Bug 1971168] Re: [snap] Files on local network shares are not opened / written
Bug Watch Updater
1971168 at bugs.launchpad.net
Tue Jun 21 15:27:10 UTC 2022
Launchpad has imported 30 comments from the remote bug at
https://bugzilla.mozilla.org/show_bug.cgi?id=1773624.
If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.
------------------------------------------------------------------------
On 2022-06-10T07:20:49+00:00 Lissyx+mozillians wrote:
This is a somewhat recent regression, I could do that a few weeks ago.
STR:
- Mount a CIFS share in GNOME's
- Right click, "Save link target as"
- Select a folder within CIFS share where you have credentials
Expected:
- File is downloaded
Actual:
- Nothing happens, and no error is reported.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/18
------------------------------------------------------------------------
On 2022-06-10T07:34:36+00:00 Lissyx+mozillians wrote:
from `journalctl`
```
juin 10 09:33:47 ubuntu-2204-snap xdg-desktop-por[1865]: g_path_get_basename: assertion 'file_name != NULL' failed
juin 10 09:33:47 ubuntu-2204-snap xdg-desktop-por[1865]: g_path_get_dirname: assertion 'file_name != NULL' failed
juin 10 09:33:47 ubuntu-2204-snap xdg-desktop-por[1865]: Failed to register smb://192.168.1.36/documents/Patches/QPdfPresenterConsole-2.7.0-Windows-AMD64.zip: Failed to open smb://192.168.1.36/documents/Patches/QPdfPresenterConsole-2.7.0-Windows-AMD64.zip
```
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/19
------------------------------------------------------------------------
On 2022-06-10T08:27:24+00:00 Lissyx+mozillians wrote:
`Failed to open` comes from https://github.com/flatpak/xdg-desktop-
portal/blob/e3ca5567a2dbb5b763a383bba5ff1c0437a7e851/src/documents.c#L91-L92
called from https://github.com/flatpak/xdg-desktop-
portal/blob/e3ca5567a2dbb5b763a383bba5ff1c0437a7e851/src/file-
chooser.c#L121
>From the asserts, it means that somehow `path` ends up `nullptr`:
https://github.com/flatpak/xdg-desktop-
portal/blob/e3ca5567a2dbb5b763a383bba5ff1c0437a7e851/src/documents.c#L79-L82
```
(gdb) call g_file_get_uri (file)
XDP: No background permissions found: Le d\u00e9lai d\u2019attente est d\u00e9pass\u00e9
$3 = 0x7fffe8008110 "smb://192.168.1.36/documents/Patches/QPdfPresenterConsole-2.7.0-Darwin-x86_64.zip"
(gdb) call g_file_get_uri_scheme (file)
$4 = 0x7fffec00d140 "smb"
(gdb) call g_file_get_path (file)
XDP: Checking background permissions
$5 = 0x0
(gdb)
```
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/20
------------------------------------------------------------------------
On 2022-06-10T09:22:49+00:00 Lissyx+mozillians wrote:
I cant repro the behavior outside of `snap` it seems:
```
#include <stdio.h>
#include <glib.h>
#include <gio/gio.h>
void
print_type (const char* file_uri)
{
GFile* my_file = g_file_new_for_uri(file_uri);
char* path = g_file_get_path(my_file);
fprintf (stdout, "uri:%s => path:%s\n", file_uri, path);
g_object_unref(my_file);
}
int
main (void)
{
const char* files[] = {
"smb://192.168.1.36/documents/Patches/QPdfPresenterConsole-2.7.0-Darwin-x86_64.zip",
};
int num_files = sizeof(files)/sizeof(files[0]);
for(int f = 0; f < num_files; ++f) {
print_type(files[f]);
}
return 0;
}
```
build with
```
gcc gio-test-files.c `pkg-config --cflags --libs glib-2.0 --libs gio-2.0` -o gio-test-files
```
and running:
```
$ ./gio-test-files
uri:smb://192.168.1.36/documents/Patches/QPdfPresenterConsole-2.7.0-Darwin-x86_64.zip => path:/run/user/1000/gvfs/smb-share:server=192.168.1.36,share=documents/Patches/QPdfPresenterConsole-2.7.0-Darwin-x86_64.zip
```
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/21
------------------------------------------------------------------------
On 2022-06-10T12:11:59+00:00 Lissyx+mozillians wrote:
The same code packaged as a snap, installed in `devmode` returns
`nullptr` :(
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/22
------------------------------------------------------------------------
On 2022-06-10T12:14:05+00:00 Lissyx+mozillians wrote:
Created attachment 9280651
gio.zip
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/23
------------------------------------------------------------------------
On 2022-06-10T13:16:46+00:00 Lissyx+mozillians wrote:
>From https://forum.snapcraft.io/t/interface-suggestion-gvfs/17080/8
there's a similar situation. Indeed, there is no
`$SNAP/usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so` at all.
Also, building and running outside of snap and making this
`libgvfsdbus.so` unavailable, I can repro, so it's likely because we are
missing it?
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/24
------------------------------------------------------------------------
On 2022-06-10T13:43:03+00:00 Lissyx+mozillians wrote:
GIMP fixed it with:
https://github.com/snapcrafters/gimp/blob/d4280e0d3f8b88a73501cb778479ee6ec68f5580/desktop-
launch/common/desktop-exports#L291-L292
I cannot find where is coming from `snap/command-chain/desktop-launch`
on firefox' snap
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/25
------------------------------------------------------------------------
On 2022-06-10T14:11:35+00:00 Lissyx+mozillians wrote:
Ok, it looks like `desktop-launch` comes from third-party dependency. This is really starting to get very snap specific, and gimp has some workaround:
- https://github.com/snapcrafters/gimp/blob/d4280e0d3f8b88a73501cb778479ee6ec68f5580/snap/snapcraft.yaml#L38-L41
- https://github.com/snapcrafters/gimp/blob/d4280e0d3f8b88a73501cb778479ee6ec68f5580/desktop-launch/common/desktop-exports#L291-L292
Now, if gimp already has a workaround and we need the same, maybe it's
time to do what was asked in https://forum.snapcraft.io/t/interface-
suggestion-gvfs/17080/8 and expose the requirements within `gnome-
platform` directly ?
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/26
------------------------------------------------------------------------
On 2022-06-10T16:21:00+00:00 Markus W wrote:
(In reply to Alexandre LISSY :gerard-majax from comment #1)
> from `journalctl`
>
> ```
> juin 10 09:33:47 ubuntu-2204-snap xdg-desktop-por[1865]: g_path_get_basename: assertion 'file_name != NULL' failed
> juin 10 09:33:47 ubuntu-2204-snap xdg-desktop-por[1865]: g_path_get_dirname: assertion 'file_name != NULL' failed
> juin 10 09:33:47 ubuntu-2204-snap xdg-desktop-por[1865]: Failed to register smb://192.168.1.36/documents/Patches/QPdfPresenterConsole-2.7.0-Windows-AMD64.zip: Failed to open smb://192.168.1.36/documents/Patches/QPdfPresenterConsole-2.7.0-Windows-AMD64.zip
> ```
Can confirm, seeing this journal entry as well when trying to open an image from an SMB share:
```
Jun 10 18:16:01 mysys xdg-desktop-por[4507]: g_path_get_basename: assertion 'file_name != NULL' failed
Jun 10 18:16:01 mysys xdg-desktop-por[4507]: g_path_get_dirname: assertion 'file_name != NULL' failed
Jun 10 18:16:01 mysys xdg-desktop-por[4507]: Failed to register smb://192.168.1.3/share/image.jpg: Failed to open smb://192.168.1.3/share/image.jpg
```
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/27
------------------------------------------------------------------------
On 2022-06-10T16:25:27+00:00 Lissyx+mozillians wrote:
*** Bug 1767316 has been marked as a duplicate of this bug. ***
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/28
------------------------------------------------------------------------
On 2022-06-13T09:09:11+00:00 Lissyx+mozillians wrote:
(In reply to Alexandre LISSY :gerard-majax from comment #2)
> `Failed to open` comes from https://github.com/flatpak/xdg-desktop-portal/blob/e3ca5567a2dbb5b763a383bba5ff1c0437a7e851/src/documents.c#L91-L92 called from https://github.com/flatpak/xdg-desktop-portal/blob/e3ca5567a2dbb5b763a383bba5ff1c0437a7e851/src/file-chooser.c#L121
>
> From the asserts, it means that somehow `path` ends up `nullptr`: https://github.com/flatpak/xdg-desktop-portal/blob/e3ca5567a2dbb5b763a383bba5ff1c0437a7e851/src/documents.c#L79-L82
>
> ```
> (gdb) call g_file_get_uri (file)
> XDP: No background permissions found: Le d\u00e9lai d\u2019attente est d\u00e9pass\u00e9
> $3 = 0x7fffe8008110 "smb://192.168.1.36/documents/Patches/QPdfPresenterConsole-2.7.0-Darwin-x86_64.zip"
> (gdb) call g_file_get_uri_scheme (file)
> $4 = 0x7fffec00d140 "smb"
> (gdb) call g_file_get_path (file)
> XDP: Checking background permissions
> $5 = 0x0
> (gdb)
> ```
It looks like it is done on purpose: https://github.com/flatpak/xdg-
desktop-portal/blob/fe9c5a11a199c966b32f6b7327136782544b845e/src/xdg-
desktop-portal.c#L380-L381
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/30
------------------------------------------------------------------------
On 2022-06-13T09:21:01+00:00 Lissyx+mozillians wrote:
So, while using the `smb://` from file picker is blocked and seems not
to be hideable for the moment, directly using the mount point should
work. if you navigate through the UI via `Other Locations` -> `Computer`
-> `/var` -> `run` -> `user` -> `XXX` (your user id) -> `gvfs` −> the
directory matching your mountpoint -> then you can access your remote
location.
This is working for me. While not optimal, at least you can make use of
the remote file server.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/31
------------------------------------------------------------------------
On 2022-06-13T09:29:56+00:00 Lissyx+mozillians wrote:
The upstream issue tracking being able to perform that operation is
https://github.com/flatpak/xdg-desktop-portal/issues/213. Until this is
addressed, I believe the UI should not expose mount points it cannot
handle, as reported on https://gitlab.gnome.org/GNOME/xdg-desktop-
portal-gnome/-/issues/48
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/32
------------------------------------------------------------------------
On 2022-06-13T09:53:38+00:00 Markus W wrote:
(In reply to Alexandre LISSY :gerard-majax from comment #12)
> So, while using the `smb://` from file picker is blocked and seems not to be hideable for the moment, directly using the mount point should work. if you navigate through the UI via `Other Locations` -> `Computer` -> `/var` -> `run` -> `user` -> `XXX` (your user id) -> `gvfs` −> the directory matching your mountpoint -> then you can access your remote location.
>
> This is working for me. While not optimal, at least you can make use of the remote file server.
Thanks for investigating further! I can confirm that this workaround
works for me as well. Not sure why I didn't try that before (see next
paragraph).
Unfortunately this entire issue here is yet another sad example for me
of a major functionality regression on desktop Linux caused by changes
behind the scenes. Going through `/var/run/...` is something that has
not been necessary in years with Firefox packaged in APT. And seeing
that [this](https://github.com/flatpak/xdg-desktop-portal/issues/213) is
already open for four years, I have a feeling we'll see a fix in 2030...
In any case, at least the path forward is clear now.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/33
------------------------------------------------------------------------
On 2022-06-13T14:24:38+00:00 Al Savage wrote:
" if you navigate through the UI via Other Locations -> Computer -> /var
-> run -> user -> XXX (your user id) -> gvfs −> the directory matching
your mountpoint -> then you can access your remote location."
Via that path, I have no mountpoints listed in the FF picker here.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/34
------------------------------------------------------------------------
On 2022-06-13T14:26:24+00:00 Al Savage wrote:
Created attachment 9281035
Screenshot from 2022-06-13 07-22-50.png
FF snap file picker shows non-functioning mountpoints on left, and none
via gvfs on right.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/35
------------------------------------------------------------------------
On 2022-06-13T14:54:38+00:00 Markus W wrote:
(In reply to Al Savage from comment #16)
> Created attachment 9281035
> Screenshot from 2022-06-13 07-22-50.png
>
> FF snap file picker shows non-functioning mountpoints on left, and none via gvfs on right.
Did you mount these shares e.g. via Nautilus before navigating to the
`gvfs` subfolder? If you mount only when the file picker is already
showing this folder, the file picker view is not refreshed. Either close
the picker then and go to the location again or navigate one folder
higher (`1000`) and then back into `gvfs`. You should then see the
shares.
If still not, what does running `ls -al /var/run/user/1000/gvfs` in a
console print out?
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/36
------------------------------------------------------------------------
On 2022-06-13T16:06:38+00:00 Al Savage wrote:
Yes, the shares were/are mounted via Nautilus prior to using FF to
attempt to save a file, in that screenshot.
```
asavage at Ubuntu1:~$ ls -al /var/run/user/1000/gvfs
total 0
drwx------ 2 asavage asavage 40 Jun 11 00:20 .
drwx------ 21 asavage asavage 660 Jun 11 08:57 ..
```
I use Nautilus to move files to/from shares without issue, but the file
pickers in FF (snap), Thunderbird, and Chrome (deb) all show the shares
but cannot work with them.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/37
------------------------------------------------------------------------
On 2022-06-13T16:26:56+00:00 Lissyx+mozillians wrote:
(In reply to Al Savage from comment #15)
> " if you navigate through the UI via Other Locations -> Computer -> /var -> run -> user -> XXX (your user id) -> gvfs −> the directory matching your mountpoint -> then you can access your remote location."
>
> Via that path, I have no mountpoints listed in the FF picker here.
This is not "Firefox picker", it's the portal one. And if your
mountpoints are not visible there, this is another issue, unrelated to
Firefox itself.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/38
------------------------------------------------------------------------
On 2022-06-13T16:51:43+00:00 Markus W wrote:
(In reply to Al Savage from comment #18)
> Yes, the shares were/are mounted via Nautilus prior to using FF to attempt to save a file, in that screenshot.
>
> ```
> asavage at Ubuntu1:~$ ls -al /var/run/user/1000/gvfs
> total 0
> drwx------ 2 asavage asavage 40 Jun 11 00:20 .
> drwx------ 21 asavage asavage 660 Jun 11 08:57 ..
> ```
>
> I use Nautilus to move files to/from shares without issue, but the file pickers in FF (snap), Thunderbird, and Chrome (deb) all show the shares but cannot work with them.
Then your user probably has a different user ID than `1000` (run `echo
$UID` or `id` in a terminal and adjust your folder accordingly). I agree
with [comment
#19](https://bugzilla.mozilla.org/show_bug.cgi?id=1773624#c19) though
that this is an unrelated issue.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/39
------------------------------------------------------------------------
On 2022-06-13T17:51:27+00:00 Al Savage wrote:
Just to be clear, when I'm using FF, and choose RMB "Save Image as",
that's FF's File Picker. You can call it whatever you like, but from a
user perspective, you can't argue it's called something else. I'm a
user, not a developer, and I won't cater to your nomenclature whims. If
you have misunderstood what I was relating, my apology in advance. I
have made considerable effort in both documenting this issue weeks ago,
and posting links to the bug in other fora, in an attempt to drive
others with the issue to the bug, which you then marked as duplicate
because you couldn't bother to search for the existing bug, and decided
that your 'discovery' of it was the proper bug-chasing path, instead of
marking your newer bug report as a duplicate of the older. I do not
appreciate your choice, but because you are actually reading and chasing
the issue, I let it be.
You can see in the screenshot fragment above that the shares are shown
as mounted in the left pane, in the FF file picker.
```
asavage at Ubuntu1:~$ echo $UID
1000
asavage at Ubuntu1:~$ id
uid=1000(asavage) gid=1000(asavage) groups=1000(asavage),4(adm),7(lp),24(cdrom),27(sudo),29(audio),30(dip),44(video),46(plugdev),110(lxd),114(sambashare),119(lpadmin),128(pulse),129(pulse-access)
```
Again, Nautilus allows use of these mounted shares without issue.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/40
------------------------------------------------------------------------
On 2022-06-13T18:23:19+00:00 Lissyx+mozillians wrote:
(In reply to Al Savage from comment #21)
> Just to be clear, when I'm using FF, and choose RMB "Save Image as", that's FF's File Picker. You can call it whatever you like, but from a user perspective, you can't argue it's called something else. I'm a user, not a developer, and I won't cater to your nomenclature whims. If you have misunderstood what I was relating, my apology in advance.
It is not "nomenclature whims", there's a very simple problem if it's
not our code: we can't fix it, and we depend on upstream to fix and
deploy. Even if I could fix the issue myself (which from the discussion
I had with people of upstream is non trivial).
> I have made considerable effort in both documenting this issue weeks
ago, and posting links to the bug in other fora, in an attempt to drive
others with the issue to the bug, which you then marked as duplicate
because you couldn't bother to search for the existing bug, and decided
that your 'discovery' of it was the proper bug-chasing path, instead of
marking your newer bug report as a duplicate of the older. I do not
appreciate your choice, but because you are actually reading and chasing
the issue, I let it be.
Who said your investigation was useless? I found 4 differents dupes
after, because the issue is hitting many people and they were filed
differently enough. There's no judgement whatsoever when marking as
dupe, I just found it after and I was already working on it.
>
> You can see in the screenshot fragment above that the shares are shown as mounted in the left pane, in the FF file picker.
>
> ```
> asavage at Ubuntu1:~$ echo $UID
> 1000
> asavage at Ubuntu1:~$ id
> uid=1000(asavage) gid=1000(asavage) groups=1000(asavage),4(adm),7(lp),24(cdrom),27(sudo),29(audio),30(dip),44(video),46(plugdev),110(lxd),114(sambashare),119(lpadmin),128(pulse),129(pulse-access)
> ```
> Again, Nautilus allows use of these mounted shares without issue.
Again, there's no code we have direct control over in this file picker.
We ask GTK to show one, and GTK under Snap does the job. We dont control
anything.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/41
------------------------------------------------------------------------
On 2022-06-13T18:32:24+00:00 Lissyx+mozillians wrote:
(In reply to Al Savage from comment #18)
> Yes, the shares were/are mounted via Nautilus prior to using FF to attempt to save a file, in that screenshot.
>
> ```
> asavage at Ubuntu1:~$ ls -al /var/run/user/1000/gvfs
> total 0
> drwx------ 2 asavage asavage 40 Jun 11 00:20 .
> drwx------ 21 asavage asavage 660 Jun 11 08:57 ..
> ```
>
> I use Nautilus to move files to/from shares without issue, but the file pickers in FF (snap), Thunderbird, and Chrome (deb) all show the shares but cannot work with them.
So you have nothing in that folder, I dont know why, but it's consistent
with the folder being empty within the file picker.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/42
------------------------------------------------------------------------
On 2022-06-14T10:27:17+00:00 Sebastien Bacher wrote:
Could you check if you have gvfs-fuse installed? That's the component in
charge of creating the local mountpoints
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/43
------------------------------------------------------------------------
On 2022-06-16T08:40:02+00:00 Lissyx+mozillians wrote:
There's a draft PR to fix it
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/44
------------------------------------------------------------------------
On 2022-06-16T09:21:16+00:00 Lissyx+mozillians wrote:
(In reply to Alexandre LISSY :gerard-majax from comment #25)
> There's a draft PR to fix it
I had one weird hiccup, but I cant reproduce anymore, looks like this PR
is working and fixing our issue.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/45
------------------------------------------------------------------------
On 2022-06-17T13:54:49+00:00 Olivier Tilloy wrote:
If I understand the latest developments on this bug correctly, this has
to be fixed in the XDG desktop portal, and [Sergio's
PR](https://github.com/flatpak/xdg-desktop-portal/pull/814) is an
attempt to do that.
There's also an issue in Firefox where it should be calling `SaveFiles`
instead of `SaveFile`. Or is that fixed already?
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/46
------------------------------------------------------------------------
On 2022-06-17T13:58:02+00:00 Lissyx+mozillians wrote:
(In reply to Olivier Tilloy from comment #27)
> If I understand the latest developments on this bug correctly, this has to be fixed in the XDG desktop portal, and [Sergio's PR](https://github.com/flatpak/xdg-desktop-portal/pull/814) is an attempt to do that.
It seems, I dont know when we can expect this to hit your distro.
>
> There's also an issue in Firefox where it should be calling `SaveFiles` instead of `SaveFile`. Or is that fixed already?
This is a separate problem.
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/47
------------------------------------------------------------------------
On 2022-06-21T12:48:11+00:00 Gpascutto wrote:
Marking this one as P5 because the fix needs to happen in Snap (where
there is a proposed patch).
Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1971168/comments/48
** Changed in: firefox
Status: Unknown => Confirmed
** Bug watch added: github.com/flatpak/xdg-desktop-portal/issues #213
https://github.com/flatpak/xdg-desktop-portal/issues/213
** Bug watch added: gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues #48
https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/48
--
You received this bug notification because you are a member of Mozilla
Bugs, which is subscribed to firefox in Ubuntu.
https://bugs.launchpad.net/bugs/1971168
Title:
[snap] Files on local network shares are not opened / written
To manage notifications about this bug go to:
https://bugs.launchpad.net/firefox/+bug/1971168/+subscriptions
More information about the Ubuntu-mozillateam-bugs
mailing list