GnuCash
Contact   Instructions
Bug 797175 - GnuCash 3.5 Fails to Start
Summary: GnuCash 3.5 Fails to Start
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: General (show other bugs)
Version: 3.5
Hardware: PC Windows
: Normal blocker
Target Milestone: ---
Assignee: general
QA Contact: general
URL:
Whiteboard:
Keywords:
: 797258 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-04-04 15:49 EDT by Robert Chapin
Modified: 2019-06-23 07:54 EDT (History)
7 users (show)

See Also:


Attachments
screenshot of error (18.97 KB, image/png)
2019-04-11 00:18 EDT, Chris Murphy
no flags Details
gnucash --debug trace (67.04 KB, text/plain)
2019-04-15 12:38 EDT, Chris Murphy
no flags Details
screenshot of path to .gnucash datafile (44.19 KB, image/png)
2019-04-16 12:29 EDT, Chris Murphy
no flags Details

Description Robert Chapin 2019-04-04 15:49:22 EDT
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.

😢
Comment 1 Robert Chapin 2019-04-04 15:52:30 EDT
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.
Comment 2 Robert Chapin 2019-04-04 16:07:20 EDT
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.
Comment 3 John Ralls 2019-04-04 20:12:22 EDT
So UNC paths no longer work? You'd reported in 796871 that they did.
Comment 4 Robert Chapin 2019-04-05 08:33:29 EDT
Correct.  UNC paths always worked until 3.5.  The other bug was for file browsing only.
Comment 5 Scott Sekuterski 2019-04-05 10:34:56 EDT
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.
Comment 6 Chris Murphy 2019-04-11 00:18:49 EDT
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
Comment 7 Bob 2019-04-11 06:31:00 EDT
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...
Comment 8 Bob 2019-04-12 09:51:43 EDT
I have pushed a fix so should be in the next nightly if you could try that would be great.
Comment 9 Robert Chapin 2019-04-14 09:32:29 EDT
Now running gnucash-3.5-2019-04-13-git-3.5-27-g0f6465ca6+.setup.exe

Works for me 🏆
Comment 10 Chris Murphy 2019-04-15 12:36:30 EDT
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.
Comment 11 Chris Murphy 2019-04-15 12:38:28 EDT
Created attachment 373237 [details]
gnucash --debug trace

This is with 3.5+ (3.5 with commit 0f6465ca)
Comment 12 Bob 2019-04-15 18:43:27 EDT
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.
Comment 13 Chris Murphy 2019-04-15 19:30:48 EDT
It is not a flatpak build. Why would additional settings required to open the file from a network, when 3.4 didn't?
Comment 14 Chris Murphy 2019-04-15 21:44:13 EDT
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]$
Comment 15 Chris Murphy 2019-04-15 22:06:36 EDT
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.
Comment 16 Bob 2019-04-16 09:56:16 EDT
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...
Comment 17 Chris Murphy 2019-04-16 12:27:50 EDT
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'
Comment 18 Chris Murphy 2019-04-16 12:29:30 EDT
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.
Comment 19 Chris Murphy 2019-04-16 13:08:33 EDT
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
Comment 20 Bob 2019-04-17 08:48:20 EDT
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...
Comment 21 Chris Murphy 2019-04-17 16:23:04 EDT
- 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.
Comment 22 Bob 2019-04-23 10:43:59 EDT
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.
Comment 23 Chris Murphy 2019-04-23 17:55:23 EDT
cherry-picking 20e2b6b5 onto tag 3.5 does resolve the problem.
Comment 24 Bob 2019-06-23 07:54:11 EDT
*** Bug 797258 has been marked as a duplicate of this bug. ***

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