geigi / cozy

🎧 Listen to audio books 📚 on Linux
https://cozy.sh
GNU General Public License v3.0
1.1k stars 85 forks source link

An error occurred while updating the database #670

Closed Bidski closed 2 years ago

Bidski commented 2 years ago

Bug/Feature description

When loading cozy a dialog appears stating that there was an error updating the database and that I should use version 0.9.5 until the issue is resolved.

$ XDG_DATADIRS=/usr/local/share:$XDG_DATADIRS PYTHONPATH=/usr/local/lib/python3.9/site-packages:$PYTHONPATH /usr/local/bin/com.github.geigi.cozy 
['/usr/local/bin/com.github.geigi.cozy']
12:19:47 [MainThread  ] [applicatio] [INFO ]  ('arch', 'rolling', 'n/a')
12:19:47 [MainThread  ] [applicatio] [INFO ]  Starting up cozy 1.1.2
12:19:47 [MainThread  ] [db        ] [INFO ]  SQLite version: 3.36.0
12:19:47 [MainThread  ] [db_updater] [INFO ]  Backing up DB...
12:19:47 [Thread-1    ] [peewee.sql] [INFO ]  writer received shutdown request, exiting.
12:19:47 [MainThread  ] [db_updater] [INFO ]  Migrating to DB Version 9...
12:19:47 [Thread-10   ] [peewee.sql] [INFO ]  writer received shutdown request, exiting.
12:19:47 [MainThread  ] [db_updater] [INFO ]  Generating File and TrackToFile objects...
12:19:48 [MainThread  ] [db_updater] [INFO ]  Inserting File and TrackToFile objects...
12:19:48 [MainThread  ] [db_updater] [ERROR]  int() argument must be a string, a bytes-like object or a number, not 'track'
12:19:48 [Thread-11   ] [peewee.sql] [INFO ]  writer received shutdown request, exiting.
12:19:48 [MainThread  ] [db_updater] [INFO ]  Restoring DB...
12:19:48 [MainThread  ] [db_updater] [INFO ]  Copying db file
12:19:48 [MainThread  ] [db_updater] [INFO ]  Copying shm file
12:19:48 [MainThread  ] [db_updater] [INFO ]  Copying wal file

Steps to reproduce

Install or build version 1.1.2. Launch cozy.

System Information

Bidski commented 2 years ago

Deleting both

~/.local/share/cozy
~/.cache/cozy

Resolves the issue. This option is fine for me as I was going to recreate my databases anyway, but may not be a wise choice for others?

geigi commented 2 years ago

Thanks for reporting :) The error you've encountered hasn't appeared a long time. It's probably a rare bug. Do you have the cozy.log file from the ~/.local/share/cozy directory by any chance? Otherwise it'll be nearly impossible to find the issue unfortunately.

Bidski commented 2 years ago

Unfortunately not, I should have thought to look for that, sorry.

geigi commented 2 years ago

No worries :) I found the issue. It was probably introduced with a new version of a library Cozy is using: peewee.