View Single Post
Old 12-01-2021, 03:24 PM   #1
Mister L
Groupie
Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Posts: 179
Karma: 91148
Join Date: Jun 2010
Device: Sony 350
How to fix a (minor?) database error?

Kobo Libra H2O, firmware 4.24.15676
I only side-load books, either using Calibre or manually in the file explorer (for testing purposes), and never activate the wifi.
I do not read CBR / CBZ format books.

I am using the Kobo Utilities Calibre plugin to backup my database every time I connect to Calibre. Recently I started getting an error which prevents the backup: "Failed to backup the database".

Spoiler:

calibre, version 5.24.0 (win32, embedded-python: True)
Echec à la sauvegarde de la base de données du dispositif: Échoué: Sauvegarde de la base de données du dispositif Kobo en cours

*** in database main ***
On tree page 56787 cell 0: Rowid 103877 out of order
wrong # of entries in index content_bookid_index
wrong # of entries in index sqlite_autoindex_content_1

Traceback (most recent call last):
File "calibre\gui2\device.py", line 89, in run
File "calibre_plugins.koboutilities.jobs", line 200, in do_device_database_backup
Exception:
*** in database main ***
On tree page 56787 cell 0: Rowid 103877 out of order
wrong # of entries in index content_bookid_index
wrong # of entries in index sqlite_autoindex_content_1


I am still able to load books to the device and Calibre can read all the books already on it, and the plugin appears to continue to update the reading positions, which is why I think it must be a relatively minor error. But series information does not seem to be written. And I would prefer to have an up-to-date backup.

The first time it happened I was in a hurry and everything but the backup seemed to work fine so I crossed my fingers it would resolve itself. It has not. But in the meantime I have read quite a lot, made lots of annotations, and added several books which means at this point the last backup is quite out of date.


After checking the forum I have tried:

- Compact the database:
Spoiler:

calibre, version 5.24.0
Utilitaires Kobo - Compactage de la base de données du dispositif: La base de données du dispositif a été compactée.
Taille originale = 167.294MB
Taille compactée = 158.503MB

- check database:
Spoiler:

Résultat de l'exécution de la commande 'PRAGMA integrity_check' sur la base de données du dispositif Kobo:

*** in database main ***
On tree page 56787 cell 0: Rowid 103877 out of order
wrong # of entries in index content_bookid_index
wrong # of entries in index sqlite_autoindex_content_1


I would really like to avoid losing my notes, reading position, and datestamps of loaded / read because that is my preferred sort order, so I have not logged out.

Questions:
1. Can I fix the error(s) in the database somehow? (How?)

1a. What could have caused this error (how to avoid it in future)? I always safely eject the device before unplugging the usb.

2. If I cannot fix the database, I think I have to logout/login to recreate a new database (thus losing all my activity data): can I reimport the annotations, datestamps, reading positions / status (new, currently reading...) of the books on the device? I have added columns in Calibre for all the options available in the plugin and exported all of this information so at least in theory it is available. If yes, how?

Thanks in advance for any help you can give me. I haven't had this Kobo for very long and am unfamiliar with the various tricks and secrets of using it.
Mister L is offline   Reply With Quote