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 626451 - Error dialog report on saving to mysql
Error dialog report on saving to mysql
Status: RESOLVED NOTABUG
Product: GnuCash
Classification: Other
Component: Backend - SQL
git-master
Other Linux
: Normal normal
: ---
Assigned To: Phil Longstaff
Chris Shoemaker
Depends on:
Blocks:
 
 
Reported: 2010-08-09 15:49 UTC by Mike Evans
Modified: 2018-06-29 22:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mike Evans 2010-08-09 15:49:31 UTC
On saving to a new empty mysql database I get an error dialog with the following message.

The server at URL mysql://USER:PASSWORD@localhost/gnucash experienced an 
error or encountered bad or corrupt data.

System is Fedora 12 with libdbi-dbd-sqlite-0.8.3-5.fc12.i686 and 
libdbi-dbd-mysql-0.8.3-5.fc12.i686.  GnuCash svn r19403.

Despite the error message the data appear to have been saved and can be re-opened with data intact.

There are some CRIT warnings in the log file however.

output from 
grep CRIT  mysql.log (from --logto mysql.log) is:

* 16:41:54  CRIT <GLib>     g_date_get_julian: assertion `g_date_valid (d)' failed
* 16:41:54  CRIT <GLib>     g_date_new_julian: assertion `g_date_valid_julian (j)' failed
* 16:41:54  CRIT <GLib>     g_date_valid: assertion `d != NULL' failed
* 16:41:54  CRIT <GLib>     g_date_get_julian: assertion `g_date_valid (d)' failed
* 16:41:54  CRIT <GLib>     g_date_new_julian: assertion `g_date_valid_julian (j)' failed
* 16:41:54  CRIT <GLib>     g_date_valid: assertion `d != NULL' failed
* 16:41:54  CRIT <GLib>     g_date_get_julian: assertion `g_date_valid (d)' failed
* 16:41:54  CRIT <GLib>     g_date_new_julian: assertion `g_date_valid_julian (j)' failed
* 16:41:54  CRIT <GLib>     g_date_valid: assertion `d != NULL' failed
* 16:41:54  CRIT <GLib>     g_date_get_julian: assertion `g_date_valid (d)' failed
* 16:41:54  CRIT <GLib>     g_date_new_julian: assertion `g_date_valid_julian (j)' failed
* 16:41:54  CRIT <GLib>     g_date_valid: assertion `d != NULL' failed
* 16:41:54  CRIT <GLib>     g_date_get_julian: assertion `g_date_valid (d)' failed
* 16:41:54  CRIT <GLib>     g_date_new_julian: assertion `g_date_valid_julian (j)' failed
* 16:41:54  CRIT <GLib>     g_date_valid: assertion `d != NULL' failed
* 16:41:54  CRIT <GLib>     g_date_get_julian: assertion `g_date_valid (d)' failed
* 16:41:54  CRIT <GLib>     g_date_new_julian: assertion `g_date_valid_julian (j)' failed
* 16:41:54  CRIT <GLib>     g_date_valid: assertion `d != NULL' failed
* 16:41:54  CRIT <gnc.backend.dbi>     [mysql_error_fn()] DBI error: 1048: Column 'account' cannot be null
* 16:41:54  CRIT <gnc.backend.dbi>     [conn_execute_nonselect_statement()] Error executing SQL INSERT INTO taxtable_entries(taxtable,account,amount_num,amount_denom,type) VALUES('7f7e68136249868a939fe0e0fb714743',NULL,800000,100000,2)
* 16:41:54  CRIT <gnc.backend.sql>     [gnc_sql_do_db_operation()] SQL error: INSERT INTO taxtable_entries(taxtable,account,amount_num,amount_denom,type) VALUES('7f7e68136249868a939fe0e0fb714743',NULL,800000,100000,2)
* 16:42:01  CRIT <GLib-GObject> g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
* 16:42:01  CRIT <GLib-GObject> g_object_unref: assertion `G_IS_OBJECT (object)' failed
Comment 1 Geert Janssens 2010-08-12 15:44:35 UTC
Reading your error log, this seems to be an issue with the taxtable part of GnuCash.

This is the relevant bit here:
* 16:41:54  CRIT <gnc.backend.dbi>     [mysql_error_fn()] DBI error: 1048:
Column 'account' cannot be null
* 16:41:54  CRIT <gnc.backend.dbi>     [conn_execute_nonselect_statement()]
Error executing SQL INSERT INTO
taxtable_entries(taxtable,account,amount_num,amount_denom,type)
VALUES('7f7e68136249868a939fe0e0fb714743',NULL,800000,100000,2)
* 16:41:54  CRIT <gnc.backend.sql>     [gnc_sql_do_db_operation()] SQL error:
INSERT INTO taxtable_entries(taxtable,account,amount_num,amount_denom,type)
VALUES('7f7e68136249868a939fe0e0fb714743',NULL,800000,100000,2)

For some reason mysql tries to store a taxtable entry for which the account field is not set, while the database definition requires the account field to be set.

Two things can be wrong here:
* the database definition. If it should be ok to have an empty account field, the database definition should be fixed.
* your source data can be inconsistent. For some reason you have an empty account field in the taxtable entries in your xml file, while this should not be. This would signal a potential bug in the taxtable code.

As a side-note: can't reproduce this problem as I am not using the tax tables. I do the glib critical messages regarding g_date_valid_julian as well on Fedora 13. Not sure where they come from, but so far they don't seem to cause issues.
Comment 2 Mike Evans 2010-08-13 12:12:17 UTC
Problem appears to be my fault again.  I have since obtained a clean SVN snapshot and the fault disappears.  I think I'll take a holiday somewhere without an internet access.  I apologise for wasting peoples time.
Comment 3 Geert Janssens 2010-08-13 12:25:42 UTC
:)

No problem, time is not wasted. Your feedback and testing is invaluable to us !
Comment 4 John Ralls 2018-06-29 22:42:50 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=626451. Please update any external references or bookmarks.