After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763279 - GnuCash has empty reports
GnuCash has empty reports
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: User Interface General
2.6.11
Other Linux
: Normal normal
: ---
Assigned To: gnucash-ui-maint
gnucash-ui-maint
Depends on:
Blocks:
 
 
Reported: 2016-03-08 01:41 UTC by Maciej (Matthew) Piechotka
Modified: 2018-06-29 23:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
XHTML doctype patch to html-document.scm (1.01 KB, patch)
2016-03-10 17:43 UTC, dxklann
rejected Details | Review

Description Maciej (Matthew) Piechotka 2016-03-08 01:41:03 UTC
I haven't been able to pinpoint regression point but it looks like gnucash stopped displaying reports (the report always is blank screen). There is no obvious error in stdout:

(...)
No bp log location saved, using default.
[000:000] Cpu: 6.58.9, x8, 3700Mhz, 15674MB
[000:000] Computer model: Not available
[000:000] Warning(optionsfile.cc:30): Load: Could not open file, err=2
[000:000] No bp log location saved, using default.
[000:001] Cpu: 6.58.9, x8, 3700Mhz, 15674MB
[000:001] Computer model: Not available
Comment 1 John Ralls 2016-03-08 01:46:32 UTC
GnuCash doesn't normally write to stdout, it writes to a log file: http://wiki.gnucash.org/wiki/Tracefile. Please have a look there and attach it here if it doesn't make sense to you.

What Distro and version?
Comment 2 Maciej (Matthew) Piechotka 2016-03-08 16:21:34 UTC
Version: 2.6.10/2.6.11 as indicated by version field
Distro: Gentoo

Tracefile is empty.
Comment 3 John Ralls 2016-03-08 16:57:35 UTC
Yeah, I meant what version of the distro, though I guess that's not really relevant with Gentoo.

Anyway, it's probably a WebKit issue. I don't really know enough about the WebKit API to say whether it might be because GnuCash uses the old WebKit1 API, but that might be an avenue worth investigating.

There are some logging options to GnuCash can get some more info into the tracefile that might help you troubleshoot. In particular try --log gnc.html=debug.
Comment 4 Maciej (Matthew) Piechotka 2016-03-09 01:59:11 UTC
(In reply to John Ralls from comment #3)
> Yeah, I meant what version of the distro, though I guess that's not really
> relevant with Gentoo.
> 

Oh, ~amd64

> Anyway, it's probably a WebKit issue. I don't really know enough about the
> WebKit API to say whether it might be because GnuCash uses the old WebKit1
> API, but that might be an avenue worth investigating.
> 

Not sure, but webkit1 and webkit on gtk2 is long time not supported by upstream (see https://blogs.gnome.org/mcatanzaro/2016/02/01/on-webkit-security-updates/) so I don't expect much help from upstream to track this down...

> There are some logging options to GnuCash can get some more info into the
> tracefile that might help you troubleshoot. In particular try --log
> gnc.html=debug.

* 17:36:45  INFO <gnc.html> [gnc_html_webkit_init] webkit_settings: Set default font to [Cantarell]
* 17:36:45 DEBUG <gnc.html> [leave gnc_html_webkit_init()] retval 0x399b160
* 17:36:45 DEBUG <gnc.html> [gnc_build_url]  
* 17:36:45 DEBUG <gnc.html> [gnc_html_parse_url] parsing gnc-report:id=0, base_location (null base_location)
* 17:36:45 DEBUG <gnc.html> [extract_base_name]  
* 17:36:45 DEBUG <gnc.html> [impl_webkit_show_url] resetting base location to (null)
* 17:36:45 DEBUG <gnc.html> [load_to_stream] type report, location id=0, label (null)
* 17:36:45 DEBUG <gnc.html> [gnc_build_url]  
(...)
* 17:36:50 DEBUG <gnc.html> [gnc_build_url]  
* 17:36:50 DEBUG <gnc.html> [enter gnc-html-webkit.c:impl_webkit_show_data()] datalen 57624, data <!DOCTYPE html PUBLI
* 17:36:50 DEBUG <gnc.html>     [impl_webkit_show_data] Loading uri 'file:////tmp/gnc-report-A7FIDY.html'
* 17:36:50 DEBUG <gnc.html>     [enter gnc-html-webkit.c:webkit_navigation_requested_cb()] requesting file:////tmp/gnc-report-A7FIDY.html
* 17:36:50 DEBUG <gnc.html>         [gnc_html_parse_url] parsing file:////tmp/gnc-report-A7FIDY.html, base_location (null base_location)
* 17:36:50 DEBUG <gnc.html>     [leave webkit_navigation_requested_cb()] URI type is 'file'
* 17:36:50 DEBUG <gnc.html> [leave impl_webkit_show_data()] 

The file is generated correctly (tested in FireFox) so it is definitely problem with rendering. Epiphany attempts to download page when I try to open, which is fixed by renaming file - at least to xhtml. Would it be possible that there is some MIME handling issue? I'll try to modify gnucash to generate .xhtml instead.
Comment 5 Maciej (Matthew) Piechotka 2016-03-09 02:17:35 UTC
This patch at least WAR the problem for me:

diff -ur gnucash-2.6.11.old/src/html/gnc-html-webkit.c gnucash-2.6.11/src/html/gnc-html-webkit.c
--- gnucash-2.6.11.old/src/html/gnc-html-webkit.c	2015-12-19 11:54:35.000000000 -0800
+++ gnucash-2.6.11/src/html/gnc-html-webkit.c	2016-03-08 18:02:02.946131012 -0800
@@ -725,7 +725,7 @@
 {
     GncHtmlWebkitPrivate* priv;
 #if HAVE(WEBKIT_WEB_VIEW_LOAD_URI)
-#define TEMPLATE_REPORT_FILE_NAME "gnc-report-XXXXXX.html"
+#define TEMPLATE_REPORT_FILE_NAME "gnc-report-XXXXXX.xhtml"
     int fd;
     gchar* uri;
     gchar *filename;
Comment 6 John Ralls 2016-03-09 04:17:11 UTC
Interesting.
grep doctype returns

src//report/report-system/html-document.scm:                (push "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">")

but also 
src//report/business-reports/receipt.eguile.scm:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
and
src//report/business-reports/taxinvoice.eguile.scm:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

What happens if instead of changing the output filename to xhtml you change the doctype in html-document.scm to html? It's scheme, so you can just edit the installed file.
Comment 7 dxklann 2016-03-10 17:43:14 UTC
Created attachment 323655 [details] [review]
XHTML doctype patch to html-document.scm

The attached patch to html-document.scm (with the previous code preserved as comments) corrected the missing reports for me on version 2.6.11 on Gentoo ~amd64, and webkit-gtk-2.4.9-r200 (1.0?). Thanks for the tip in IRC jralls!
Comment 8 John Ralls 2016-03-10 17:53:26 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Once that release is available, you may want to check for a software upgrade provided by your Linux distribution.
Comment 9 Geert Janssens 2016-03-10 18:29:01 UTC
It looks like the fix hasn't made it into the main repository ? At least I don't see it yet, about two hours after you closed this bug.
Comment 10 John Ralls 2018-06-29 23:47:53 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=763279. Please update any external references or bookmarks.