GnuCash
Contact   Instructions
Bug 796789 - Unable to access mounted USB sticks and/or network locations from File Open/File Save As dialogs Ubuntu/Linux Mint
Summary: Unable to access mounted USB sticks and/or network locations from File Open/F...
Status: RESOLVED NOTGNUCASH
Alias: None
Product: GnuCash
Classification: Unclassified
Component: User Interface General (show other bugs)
Version: 3.2
Hardware: PC Linux
: Normal normal
Target Milestone: ---
Assignee: ui
QA Contact: ui
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-27 18:29 EDT by David Cousens DaveC49
Modified: 2018-12-28 14:47 EST (History)
5 users (show)

See Also:


Attachments
gnuCash v3.2 File Open Dialog after selecting Computer (36.65 KB, image/png)
2018-07-27 18:29 EDT, David Cousens DaveC49
no flags Details
LibreOffice Writer File Open after clicking on Other Locations (42.63 KB, image/png)
2018-07-27 18:33 EDT, David Cousens DaveC49
no flags Details
Libre Office dialog after selecting Other Locations->Computer (55.18 KB, image/png)
2018-07-27 18:34 EDT, David Cousens DaveC49
no flags Details
Screenshot on Debian 9 showing mounted thumb drive and full listing of root directory. (70.68 KB, image/png)
2018-07-27 19:31 EDT, John Ralls
no flags Details

Description David Cousens DaveC49 2018-07-27 18:29:59 EDT
Created attachment 372937 [details]
gnuCash v3.2 File Open Dialog after selecting Computer

If I have a USB stick mounted on my desktop (Linux Mint 19) or laptop (Linux Mint 18.3) I am unable to navigate to the USB stick and other networked locations using either the File->Open or File->Save As dialogs from GnuCash V3.2. These do not show up in the dialog sidebar as they do in other programs).

 If I select Other Locations in the Sidebar, then click on Computer in the dialog main pane, I get a limited set of the directories under / which does not include /mnt or /media/<user> where USB sticks are usually mounted in Linux Mint (see attached screenshots of the dialogs from GnuCash and Libre Office Writer).

Networked locations (NAS with networked NFS and Samba shares and NFS shares between laptop and  desktop) also do not show up in the dialog. These are all visible and can be navigated to using Nemo, the Linux Mint file explorer and also the File dialogs in other programs (e.g. Libre Office Writer etc)
Comment 1 David Cousens DaveC49 2018-07-27 18:33:00 EDT
Created attachment 372938 [details]
LibreOffice Writer File Open after clicking on Other Locations

Libre oFFice dialog screen shot
Comment 2 David Cousens DaveC49 2018-07-27 18:34:15 EDT
Created attachment 372939 [details]
Libre Office dialog after selecting Other Locations->Computer

LibreOffice File Open Dialog screenshot
Comment 3 John Ralls 2018-07-27 19:31:07 EDT
Created attachment 372940 [details]
Screenshot on Debian 9 showing mounted thumb drive and full listing of root directory.

Note the mounted flash drive in the sidebar and the media folder in the root directory.
Comment 4 David Carlson 2018-07-27 21:05:41 EDT
I discovered that Ubuntu 16.04 mounted my file on my Network File Server under /run/user/1000/gvfs/smb-share:server=192.168.1.xxx,share=<domainname>/<directoryname>/<subdirectoryname>.
If I carelessly did not include the correct domain name when mounting the server GnuCash could still initially open the file but then later it could not find other files in the same subdirectory.
It seems that domain name is sometimes not important, but for GnuCash 2.6.17 in Ubuntu it is important.
Comment 5 John Ralls 2018-07-27 22:22:30 EDT
So that's the GVFS problem, see bug 769689. As noted there the work around may be to use FUSE.
Comment 6 David Carlson 2018-07-27 23:42:38 EDT
is that https://bugs.gnucash.org/show_bug.cgi?id=796689?
Comment 7 David Carlson 2018-07-27 23:49:33 EDT
is that https://bugs.gnucash.org/show_bug.cgi?id=796689?

and is FUSE something for developers to incorporate into the program or for users to know about?
Comment 8 John Ralls 2018-07-28 09:50:21 EDT
Yes, sorry for the transposition.

FUSE is a file system. It for system admins to set up and configure, not something that an app can do on its own. GVFS, on the other hand, requires both that the sysadmin install and configure it *and* that applications incorporate the necessary library functions into their file-access code. FUSE can paper over the latter by mapping the GVFS directories onto the normal POSIX directory structure.
Comment 9 David Cousens DaveC49 2018-07-29 08:33:27 EDT
Just an update. 

The above all refereed to the flathub v3.2 version of GnuCash not a native build which I should have mentioned.

I have been converting from LM18.3 to LM 19 on my desktop and didn't have it setup for building GnuCash for the past week which is why I had been using the flatpack version.

I've just completed building GnuCash 3.2 from sources in LM 19 with all the options and I now see USB sticks in the sidebar and can open them. Other Locations is not however showing shares from my NAS but I usually mount these into directories under my home directory and they are accessible from there. I am still getting all my networking sorted under LM19

It may be the flatpak version that is limiting access. I will build v3.2 on LM18.3 on my laptop tomorrow to see if it is OS version but the flatpak is definitely limited so it may be a flatpak problem
Comment 10 Geert Janssens 2018-10-01 07:51:52 EDT
I can confirm that by default USB sticks and network shares are 
not accessible under flatpak. I have found this is due to flatpak's security policy which states: by default allow as little access as possible. This clearly excludes mounted media and network shares.

This limitation can be relaxed though with the "flatpak override" command. In 
particular by running
  flatpak override org.gnucash.GnuCash --filesystem=<path-to-allow>

<path-to-allow> can be any filesystem path you wish to access from within 
gnucash. For example on Fedora usb sticks are mounted under /run/media so I 
have run

  flatpak override org.gnucash.GnuCash --filesystem=/run/media

And now USB sticks appear in the gnucash File->Open dialog.

It appears on Ubuntu and derivatives however usb sticks are mounted under 
/media so on those platforms the command would become

  flatpak override org.gnucash.GnuCash --filesystem=/media

The same can be done for any network share that is not mounted under your 
home directory. For example if you have a mounted network share under /mynet
you can allow access by running 

  flatpak override org.gnucash.GnuCash --filesystem=/mynet

One caveat:
I had some permission issues on my system, which I don't know were due to how 
my system is set up or a bug in flatpak. As my flatpaks are installed system 
wide, the flatpak information is stored in /var/lib/flatpak and only the root 
user has write access there.

So I had to prefix each command with 'sudo'. With this the commands ran fine, 
but I still had issues because the file permissions of the generated override 
file and its parent directory, "overrides", didn't grant access to ordinary 
users.

I fixed this by running following two commands:
sudo chmod o=rx /var/lib/flatpak/overrides
sudo chmod o+r /var/lib/flatpak/overrides/org.gnucash.GnuCash


So in conclusion: if you're talking about the flatpak version of gnucash:
1. this is not a bug, but by design. Any user can override but has to make that decision him/herself.
2. we don't control the flatpak builds on flathub so even if it were a bug, this should have been reported in the flathub issue tracker. I think there it would be closed though with "works as intended".

Question: is there still an issue for the non-flatpak edition of gnucash (except for the GVFS one which we can't solve) ?
Comment 11 David Carlson 2018-10-01 12:26:23 EDT
It seems that GVFS has fixed their problem in Ububntu 16.04 as GnuCash release 2.6.17 is now able to see mounted SMB shares by their IP address/directoryname
Comment 12 Geert Janssens 2018-12-28 14:47:59 EST
Ok. The GVFS bug was being tracked as bug 796689 which is now fixed (and confirmed by David Carlson here as well).

So this leaves the flatpak issue. I don't know if this is something gnucash should handle. It's a flatpak choice to restrict the sandbox by default and the user is able to override as described in comment 10 should that be needed. I don't think gnucash is any different from other typical applications in that respect. I mean, gnucash doesn't need usb access more or less than other typical applications to work properly. So the debate on whether flatpak should allow this by default should be held at the flatpak level, not at the gnucash level.

So with these considerations written down I think the best way forward is to close this bug as "Not GnuCash". Feel free to take this up with the flatpak developers. The workaround can help in the meantime.

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