Known firmware glitch. The database doesn't always close itself properly. Mostly happens if you connect with a kepub open, but there's other circumstances that can trigger.
Restore DB from backup or logout/login. The latter will re-import all sideloaded books so you'll lose reading positions and annotations and the like.
For prevention: use Kobo Utilities to auto-backup the db. Make sure you're on the home screen before connecting, you may want to reboot the device to be safe.
|