adamreeve / Mendeley-FileSync

A script to synchronise PDF files in Mendeley across multiple machines
GNU General Public License v3.0
24 stars 4 forks source link

sqlite3.DatabaseError: file is encrypted or is not a database #8

Closed fridde closed 8 years ago

fridde commented 10 years ago

This might be a rather basic issue that comes from my nonexistent knowledge on python specific syntax in windows, but I meet problems when using your great script (thank god I googled before writing one on my own).

I have copied your script into the same folder as my Mendeley data directory. There I first tried mendeleyfilesync.py my.name@somwhere.com@www.mendeley.com.sqlite document_locations.txt C:/Users/My.Name/Dropbox/exjobbet/sources/mendeley/

I got errors, so

C:\Users\My.Name\AppData\Local\Mendeley Ltd\Mendeley Desktop>mendeleyfilesync.py "C:/Users/My.Name/AppData/Local/Mendeley Ltd/Mendeley Desktop/my.name@somwhere.com@www.mendeley.com.sqlite" "C:/Users/My.Name/AppData/Local/Mendeley Ltd/Mendeley Desktop/document_locations.txt" "C:/Users/My.Name/Dropbox/exjobbet/sources/mendeley/"  

Traceback (most recent call last):   File "C:\Users\My.Name\AppData\Local\Mendeley Ltd\Mendeley Desktop\mendeleyfilesync.py", line 401, in <module>
main()   File "C:\Users\My.Name\AppData\Local\Mendeley Ltd\Mendeley Desktop\mendeleyfilesync.py", line 69, in main
args.dry_run, args.force_update)   File "C:\Users\My.Name\AppData\Local\Mendeley Ltd\Mendeley Desktop\mendeleyfilesync.py", line 338, in run_synchronisation     mendeley_entries = set(mendeley_db.document_files())
File "C:\Users\My.Name\AppData\Local\Mendeley Ltd\Mendeley Desktop\mendeleyfilesync.py", line 163, in document_files
self.cursor.execute("SELECT documentId, hash FROM DocumentFiles") sqlite3.DatabaseError: file is encrypted or is not a database  

Do you see my error somewhere? The error "file is encrypted or is not a database" can't be true, I can access the contents of the file via sql-editors.

adamreeve commented 10 years ago

This can happen if Python's version of sqlite is older than the one used by Mendeley. Eg. see http://support.mendeley.com/customer/en/portal/questions/722830-sqlite-database-structure-changed- and https://github.com/adamreeve/Mendeley-FileSync/issues/4.

You can try upgrading the sqlite used by Python by downloading it from http://www.sqlite.org/download.html.