View Single Post
Old 08-14-2013, 05:06 AM   #5
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
Quote:
Originally Posted by davidfor View Post
The code to delete empty shelves is three SQL statements that will either delete the shelves or mark them for deletion at the next sync to Kobo. There are no checks beforehand to see if anything will be deleted. If you uncheck the "delete empty shelves" option in the driver configuration, they don't get run.
This is the tail end of the debug log I got when the problem was occurring :

Spoiler:
DEBUG: 128.1 KoboTouch:update_device_database_collections - end for category='Historic'
DEBUG: 128.1 KoboTouch:update_device_database_collections - category='Espionage' books=9
DEBUG: 128.4 KoboTouch:update_device_database_collections - end for category='Espionage'
DEBUG: 128.4 KoboTouch:update_device_database_collections - category='Nordic' books=4
DEBUG: 128.5 KoboTouch:update_device_database_collections - end for category='Nordic'
DEBUG: 128.5 KoboTouch:update_device_database_collections - managing bookshelves and series.
DEBUG: 153.9 KoboTouch:update_device_database_collections - about to clear empty bookshelves
DEBUG: 153.9 KoboTouch:delete_empty_bookshelves - start
DeviceJob: 3 Send metadata to device done, calling callback
unable to open database file

Traceback (most recent call last):
File "site-packages\calibre\gui2\device.py", line 85, in run
File "site-packages\calibre\gui2\device.py", line 506, in _sync_booklists
File "calibre_plugins.kobotouch_extended.device.driver" , line 282, in sync_booklists
File "site-packages\calibre\devices\kobo\driver.py", line 888, in sync_booklists
File "site-packages\calibre\devices\kobo\driver.py", line 2242, in update_device_database_collections
File "site-packages\calibre\devices\kobo\driver.py", line 2498, in delete_empty_bookshelves
OperationalError: unable to open database file

DeviceJob: 3 Send metadata to device callback returned
Job: 3 Send metadata to device finished
unable to open database file

Traceback (most recent call last):
File "site-packages\calibre\gui2\device.py", line 85, in run
File "site-packages\calibre\gui2\device.py", line 506, in _sync_booklists
File "calibre_plugins.kobotouch_extended.device.driver" , line 282, in sync_booklists
File "site-packages\calibre\devices\kobo\driver.py", line 888, in sync_booklists
File "site-packages\calibre\devices\kobo\driver.py", line 2242, in update_device_database_collections
File "site-packages\calibre\devices\kobo\driver.py", line 2498, in delete_empty_bookshelves
OperationalError: unable to open database file


It appeared from this as though the problem occurred after the "Delete" instructions were sent.

Quote:
Originally Posted by davidfor View Post
Where do you see an "Im_Reading" shelf? Are you referring to what is in the calibre device list? If so, that isn't a real shelf. ...
Yes, I have only seen "Im_Reading" in the Device View "Collections" column along with all the Shelves. I though I had seen a reference to it in the SQL database but can no longer locate it so perhaps that was just an organic memory glitch.

Quote:
Originally Posted by davidfor View Post
I'm glad it fixed it, but I can't think of why. The only difference I can think of is the total size of the database due to not having these books.
Overall it appeared that Calibre was doing "something" that, with the Glo's database in perhaps a conflicting state, caused the Glo to disconnect and that the solution was to build a new database without the conflicts. All my books should be sideloaded kepubs but there have been a few downloaded from Kobo (sometimes with the same name as the sideloaded ones) and it seems like purging the Kobo ones and synching is what resolved the issue. Originally I thought the problem was in transferring the books themselves (possibly the size of the books) and that it was the USB Mass Storage Gadget on the Glo that was at fault; I'm now coming round to the way of thinking that it is some form of database conflict that is at the root of the problem. As the problem has survived a number of factory resets it clearly wasn't a "corrupt" database in the usual sense. It may even be to do with some of the Name/Titles in my sideloaded books as I have had issues with multiple authors and punctuation in titles which seems to make it difficult for Calibre to match the books it has uploaded to ones shown as "On Device".


BobC
BobC is offline   Reply With Quote