Just upgraded from 3.4 to 3.5. On every start, GnuCash throws this error: The file/URI /\ \<myserver>\<mypath>\GnuCash\mydata.gnucash could not be found. 😢
After using End Task and clicking around, I was able to browse to the file, but I get the same error. Picking the file from the recent list in the file menu throws the same error. I've tried everything I can think of so far except for relocating my GnuCash data.
Workaround: After relocating my GnuCash data files to a mapped drive letter, GnuCash starts normally. Most functionality has been restored by that workaround, but this bug would prevent some people from using v3.5.
So UNC paths no longer work? You'd reported in 796871 that they did.
Correct. UNC paths always worked until 3.5. The other bug was for file browsing only.
I was just about to post the same bug. I can confirm that GNUCash 3.5 will not open files from a UNC path. If I map the drive, the file opens without issue. The file opened successfully from UNC path in version 3.4.
Created attachment 373236 [details] screenshot of error I can reproduce the same bug on Fedora using samba file sharing. The problem happens with gnucash-3.5-1.fc30.x86_64, and the problem is resolved by downgrading to gnucash-3.4-4.fc30.x86_64. Server hosting the file via samba is Fedora 29, samba-4.9.5-0.fc29.x86_64 Client running gnucash is Fedora 30, samba-client-4.10.1-0.fc30.x86_64
I think I saw this when I was working on transaction associations and have an idea that it was down to gnc_uri_create_uri. I will have a look at this...
I have pushed a fix so should be in the next nightly if you could try that would be great.
Now running gnucash-3.5-2019-04-13-git-3.5-27-g0f6465ca6+.setup.exe Works for me 🏆
I tried a Fedora Rawhide build with the fix that should fix this, but it doesn't. I had to downgrade back to 3.4-4.
Created attachment 373237 [details] gnucash --debug trace This is with 3.5+ (3.5 with commit 0f6465ca)
I am confused, how is your fault the same as the one reported. The original fault was about using windows UNC file paths, \\myserver\share\path Is this a flatpack build ? If it is raise a new fault against that, I do seem to recall additional setting required for network access, searching the lists may help.
It is not a flatpak build. Why would additional settings required to open the file from a network, when 3.4 didn't?
I did a git bisect on gnucash source, marking 3.4 as good and 3.5 as bad. 5eb6f76e63a8cb18cad953561a287a32787c284c is the first bad commit commit 5eb6f76e63a8cb18cad953561a287a32787c284c Author: Robert Fewell <14uBobIT@gmail.com> Date: Fri Mar 29 17:34:45 2019 +0000 Change uri functions to work with valid Windows file uri's Windows file uri's can be of the form 'file:///N:/bob.txt' so change the gnc_uri_get_components to remove a left over '/' at the start so gnc_resolve_file_path gets the absolute path correctly. Also change gnc_uri_create_uri to add an extra '/' for Windows file uri's. :040000 040000 c6205879246644472492210e9475e0ab85e99717 6c9eda71ff2f03614fc19cb6f75a660d99305438 M libgnucash [chris@flap gnucash]$
OK I did `git cherry-pick 0f6465ca` on top of 3.5, and that does not fix the regression that 5eb6f76e6 introduced on Linux. Likewise, if I checkout 3.5 and revert 5eb6f76e6, the problem doesn't happen.
I can not see what I have done to effect your setup but from what you have done I have. Tried all morning setting up a samba server which I can mount the shares for but not connect the way you are. Would it be possible for you to add two print statements on the following lines of gnc-uri-utils.c line 163, g_print("uri is '%s'\n", uri); line 320, g_print("path is '%s', '%s'\n", path, abs_path); and then rebuild. Now run gnucash from a terminal and the above commands should print the file paths to the terminal which you can paste here making sure there is nothing personal and hopefully that should point me in the right direction. I will keep trying with my setup, may just download Fedora 30 if I can not get any where...
This is run on tag 3.5 clean. uri is '/run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' uri is '/run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' uri is '/run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' uri is '/run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' Found Finance::Quote version 1.47 uri is '/run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' path is '/run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash', '/run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' uri is 'file:///run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' uri is 'file:///run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' uri is 'file:///run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' uri is 'file:///run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' uri is 'file:///run/user/1000/gvfs/smb-share:server=fnuc.local,share=finance/accounting and taxes/gnucash datafiles/colorremedies.gnucash' path is '/home/chris/.local/share/gnucash/data/run_user_1000_gvfs_smb-share_server=fnuc.local,share=finance_accounting and taxes_gnucash datafiles_colorremedies.gnucash', '/home/chris/.local/share/gnucash/data/run_user_1000_gvfs_smb-share_server=fnuc.local,share=finance_accounting and taxes_gnucash datafiles_colorremedies.gnucash' uri is 'file:///home/chris/.local/share/gnucash/data/run_user_1000_gvfs_smb-share_server=fnuc.local,share=finance_accounting and taxes_gnucash datafiles_colorremedies.gnucash'
Created attachment 373239 [details] screenshot of path to .gnucash datafile I'm not sure if this helps make it unambiguous, screenshot of Terminal listing the path to the file.
I can reproduce the problem on Fedora 28, using Fedora 28 packages. gnucash-3.5-1.fc28.x86_64 fails gnucash-3.4-4.fc28.x86_64 works Same errors. Also, the downstream bug I've filed with Fedora, someone says the problem happens with sftp as well, so it's not samba specific. https://bugzilla.redhat.com/show_bug.cgi?id=1698706
I see the problem... Incoming to gnc_uri_get_components we have the following example... /run/user/1000/gvfs/smb-share:server=192.168.1.11,share=public/test-xml-file.gnucash and on line 181 I test for ":" in the path assuming only Windows have paths with a ":" but as you see above there is "smb-share:" so that is where it is going wrong. So can you try changing that line so it is testing for ":/" and that should fix your problem. I need to do some more testing to see if that is a good fix...
- if (g_str_has_prefix (splituri[1], "/") && g_strstr_len (splituri[1], -1, ":") != NULL) + if (g_str_has_prefix (splituri[1], ":/") && g_strstr_len (splituri[1], -1, ":") != NULL) That does fix the problem.
Thanks for the feed back, I have pushed a slightly different change, if you want to try that would be good otherwise I will just mark this as resolved.
cherry-picking 20e2b6b5 onto tag 3.5 does resolve the problem.
*** Bug 797258 has been marked as a duplicate of this bug. ***