Database locked after crash - python bindings

Christoph Holtermann c.holtermann at gmx.de
Fri Nov 5 18:12:35 EDT 2010


 Hello !

Am 05.11.2010 22:58, schrieb John Ralls:
> On Nov 5, 2010, at 2:09 PM, Christoph Holtermann wrote:
>
>> Hello !
>>
>> Am 05.11.2010 21:46, schrieb John Ralls:
>>> On Nov 5, 2010, at 12:58 PM, Christoph Holtermann wrote:
>>>
>>>> Hello !
>>>>
>>>> In addition to the previous :
>>>>
>>>> I just tried to find out what actually crashes the reports. I put it to
>>>> some instability in my system. Crash means Segmentation fault.
>>>>
>>>> Access to database is also not possible with python anymore. Is there a
>>>> possibility from there or anywhere to reset the database lock or by hand
>>>> in Mysql (which I use, I forgot to tell) ?
>>> Yes, open the database with mysql and either drop the GNCLOCK table or delete the row (there should be only one) with DELETE * FROM GNCLOCK.
>>>
>>> I just tested again with mysql on Debian, and it worked fine. (start gnucash, connect to mysql db, kill gnucash from the command line, restart gnucash. It prompts to break the lock, then opens the database, and checking the GNCLOCK table shows the new pid.)
>>>
>>> What happens when you try to connect? 
>>>
>>> Regards,
>>> John Ralls
>>>
>>>
>> My Python skripts leads to following output :
>>
>> * 22:06:24  WARN <gnc.backend.dbi> [gnc_dbi_unlock()] There was no lock entry in the Lock table
>> ---------------------------------------------------------------------------
>> GnuCashBackendException                   Traceback (most recent call last)
>>
>> /home/christoph/Computer/Programmieren/Python/gnucash/IGnc.py in <module>()
>>    104
>>    105 ipshell= IPShellEmbed()
>> --> 106 main()
>>    107
>>    108 print
>>
>> /home/christoph/Computer/Programmieren/Python/gnucash/IGnc.py in main()
>>     88
>>     89   print "Öffne URL '"+url+"'."
>> ---> 90   session, book, root_account = connect_to_db(url)
>>     91   #print_recursively(root_account,'')
>>
>>     92
>>
>> /home/christoph/Computer/Programmieren/Python/gnucash/GncBasic.pyc in connect_to_db(url)
>>    564   if not url:
>>    565     url=**COMMENTED OUT**
>> --> 566   session=Session(url)
>>    567   book=session.book
>>    568   root_account=session.book.get_root_account()
>>
>> /usr/lib/python2.6/site-packages/gnucash/gnucash_core.pyc in __init__(self, book_uri, is_new)
>>     86         if book_uri is not None:
>>     87             try:
>> ---> 88                 self.begin(book_uri, False, is_new)
>>     89                 if not is_new:
>>     90                     self.load()
>>
>> /usr/lib/python2.6/site-packages/gnucash/gnucash_core.pyc in new_function(self, *args)
>>    127         def new_function(self, *args):
>>    128             return_value = function(self, *args)
>> --> 129             self.raise_backend_errors(function.__name__)
>>    130             return return_value
>>    131         return new_function
>>
>> /usr/lib/python2.6/site-packages/gnucash/gnucash_core.pyc in raise_backend_errors(self, called_function)
>>    105                 "call to %s resulted in the "
>>    106                 "following errors, %s" % (called_function, errors),
>> --> 107                 errors )       
>>    108                                                                                                                                                                            
>>    109     def generate_errors(self):
>>
>> GnuCashBackendException: call to begin resulted in the following errors, (7,)
>>
>> gnucash starts, I get that "force open" window. When I say yes it gets stuck somewhere.
>>
>> bye and thanks for your assistance,
> By "gets stuck somewhere" I trust that you mean that it hangs rather than segfaulting.
Yes, that´s it and that´s not it because it actually doesn´t get stuck. I was misled because the startup screen went away
after that "Force open Dialogue" ( in german : ) and I didn´t realize that it was still loading normally - I have a very long
loading report.

-> So gnucash actually starts normal, It´s just a bit surprising that the splash screen doesn´t continue after that window.
> Without a stack trace at least showing where it's hanging I don't think that there's much we can do to help.
Thanks, everything fine ;-)
> Commenting on your python trace, it's a bit odd, because the warning about not finding a lock entry is issued when the database is closed, not when it's opened. (It doesn't expect to find a lock entry on open. The db isn't supposed to be locked.)
>
> Note that the python bindings are contributed code, so at this point I think it's up to the guys who contributed to take over.
Yes. So the python bindings don´t have that option to force open yet and the error message is not yet very informative.
> Regards,
> John Ralls
>
Thanks very much for your help,

bye,

C.Holtermann



More information about the gnucash-devel mailing list