False positive in test for libdbi bug

John W. O'Brien john at saltant.com
Sun Sep 11 23:45:10 EDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/11/2011 10:44 PM, John Ralls wrote:
> 
> On Sep 11, 2011, at 5:43 PM, John W. O'Brien wrote:
> 
>> Summary
>> - -------
>>
>> I just solved a mystery involving my use of GnuCash with a SQL backend
>> and this message documents that scenario in the hopes that it will help
>> other users.
>>
>> GnuCash performs a test for a known bug in libdbi which can badly
>> corrupt your data, and refuses to proceed if the bug is found. The test
>> can succeed (or fail, depending on your perspective) for reasons
>> unrelated to the bug, including misconfiguration of the permissions set
>> in the backing database.
>>
>> [Note: If the developers think it would be appropriate for me to open a
>> bug for this, please say so and I will.]
>>
>>
>> Details

[mostly omitted]

>> The SQL backend is MySQL 5.1.56 running on a different computer.

[...]

>> The permissions that caused me to encounter this issue were of the form,
>>
>>   GRANT ALL PRIVILEGES ON `$GNCDB`.`$GNCDB` to '$GNCUSER'@'GNCHOST'
>>
>> where $GNCDB, $GNCUSER, and $GNCHOST are as you might expect. This was
>> evidently a typo, and the fix was to change this to,
>>
>>   GRANT ALL PRIVILEGES ON `$GNCDB`.* to '$GNCUSER'@'GNCHOST'

[...]

>> Bonus round
>> - -----------
>>
>> Too late to be useful in this case, I learned about the logging
>> capabilities [2] of GnuCash, which most likely would have saved me some
>> time and hair pulling.

[...]

>> [2] http://wiki.gnucash.org/wiki/Logging

> 
> Nice diagnosis. 
> 
> I suspect that your use of backticks ('`') is inadvertent; in unix shell, it means "execute this and give me the result". Probably not what you meant.

In the MySQL shell (where I was mucking about with permissions),
backticks don't have that /bin/{ba,}sh-ish meaning. My (ab)use of
shell-style variables for semantically redacting personal information in
my post probably muddied the waters.

> Anyway, is there anything we could put in the error message, documentation, or on the wiki that would have made your diagnosis of the problem quicker or easier?

The silver bullet would have been to avoid the problem in the first
place. To do that, conn_test_dbi_library() needs a way to signal its
caller that the test could not be completed, not just "yes, the bug is
present" or "no, the bug is not present". Would that be a worthwhile
thread to pull on over on -devel?

As for aiding my diagnosis, and aside from correcting my own missteps
when I was in the thick of troubleshooting, the things that might have
helped are:

1. The help manual is unusually silent on topics concerning the nuts and
bolts of troubleshooting GNC. Perhaps a high-level overview of the
user-visible diagnostic interfaces would be appropriate, at least to
give an idea of the kinds of things to seek in the wiki. Evidently most
of the documentation effort is directed toward accounting concepts (much
appreciated), and the application thereof using GNC (very appropriate),
while the wiki remains the everything-else bucket.

2. For the error message, it would have been brilliant to have a "show
me the applicable trace" button. Then without knowing squat, or having
to do hard things like read help and search the wiki, I could quickly
review some relevant internals. I could be persuaded to elaborate on
this idea, if others find it interesting.

3. I probably should have started probing the wiki sooner, but the
general challenge (which I tried to address in 1.) was not knowing what
I was looking for. Now I know there is good stuff in /tmp/gnucash.trace,
and that it is associated with a facility GNC thinks of as "logging,"
but has nothing special to do with the "log" files that show up when I
use the standard XML backend. There is a ton of content in the wiki, but
it admits mine-ability better than it does navigability.

Regards,
John
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJObYBDAAoJEEdKvTwaez9wq30IAIEe8oSep0hSj+z07iQa58mY
aK4TWtc/dwyqY+/ajjLpL5DYEOChWwNq3Hm8Rhs1Bk2wsMJ01uWAIYBaPdxATp1t
E9iIngt0AESiHOVIqLaOT0skiyC2pwxVWbUulnwEGn6a7LvrFWNkvwEapoy6FUhM
wGggSWwc2Rinc7e8DldZyqFWBGGxQS78x0QbrYDA/9ksIo0jCsKEwkzku6H4dkSK
T4Mc9wXyHbw6N5aR0ARxX2wQnmxxL+/QrpX08R5OzBzHfjWbQbenRqyoS8WMYhPy
04pWscPubc/plurexOOj5ZN5oRXlp4RkBTCp8dSHfdlA9na/7vlN6DV4PDk5FEc=
=dXDp
-----END PGP SIGNATURE-----


More information about the gnucash-user mailing list