fknorr / studip-client

CLI Client for the Stud.IP University Access Portal
GNU General Public License v3.0
3 stars 3 forks source link

Error: Unable to open database […]/.studip/cache.sqlite: near "WITH": syntax error #28

Closed n-st closed 7 years ago

n-st commented 7 years ago

Occurs during initial studip.py sync on an empty directory:

$ ~/bin/studip-client/studip.py sync
Sync directory [~/StudIP]: /mnt/lethe/extra/uni/StudIP
Error: Unable to open database /mnt/lethe/extra/uni/StudIP/.studip/cache.sqlite: near "WITH": syntax error

Later syncs also fail because the database hasn't been populated correctly:

Traceback (most recent call last):
  File "/home/nst/bin/studip-client/studip.py", line 6, in <module>
    application.main()
  File "/home/nst/bin/studip-client/studip/application.py", line 414, in main
    app.run()
  File "/home/nst/bin/studip-client/studip/application.py", line 394, in run
    self.update_database()
  File "/home/nst/bin/studip-client/studip/application.py", line 172, in update_database
    self.session.update_metadata()
  File "/home/nst/bin/studip-client/studip/session.py", line 140, in update_metadata
    select_sync_metadata_only=True, select_sync_no=False)
  File "/home/nst/bin/studip-client/studip/database.py", line 231, in list_files
    """.format(", ".join(sync_modes)))
  File "/home/nst/bin/studip-client/studip/database.py", line 137, in query
    cursor.execute(sql)
sqlite3.OperationalError: no such table: file_details
n-st commented 7 years ago
$ /usr/bin/env python3 --version
Python 3.4.3
$ sqlite3 --version
3.8.2 2013-12-06 14:53:30 27392118af4c38c5203a04b8013e1afdb1cebd0d
fknorr commented 7 years ago

Support for WITH RECURSIVE was not added until SQLite 3.8.3. This feature is crucial to the database schema, so backwards compatibility cannot be guaranteed here without refactoring a significant portion of the code into inferior SQL.

The problem of the incomplete database file resulting from this bug will still be tracked as #31 .