Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database issue with anki 2.1.24 #116

Open
AnTuanHa opened this issue Apr 29, 2020 · 2 comments
Open

Database issue with anki 2.1.24 #116

AnTuanHa opened this issue Apr 29, 2020 · 2 comments

Comments

@AnTuanHa
Copy link

After updating to anki 2.1.24, it seems to have broken creating the database:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.24 (359b9f5c) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-04-28 21:06:24

Caught exception:
Traceback (most recent call last):
  File "C:\Users\An\AppData\Roaming\Anki2\addons21\900801631\__init__.py", line 14, in onMorphManRecalc
    main.main()
  File "C:\Users\An\AppData\Roaming\Anki2\addons21\900801631\morph\main.py", line 443, in main
    knownDb = updateNotes(allDb)
  File "C:\Users\An\AppData\Roaming\Anki2\addons21\900801631\morph\main.py", line 395, in updateNotes
    mw.col.db.executemany(
  File "lib\site-packages\anki\dbproxy.py", line 92, in executemany
  File "lib\site-packages\anki\rsbackend.py", line 459, in db_execute_many
  File "lib\site-packages\anki\rsbackend.py", line 471, in _db_command
ankirspy.DBError: JSONError { info: "invalid type: map, expected a sequence" }

Here is Anki 2.1.24 changelog: https://changes.ankiweb.net/#/
This seems to be the relevant breaking changes:

  • Custom sql functions are no longer supported, and named DB arguments (eg “where id = :id”) are deprecated.

I believe the fix here is to use the question mark style now instead of named placeholders.

@deannacodes
Copy link

What do you mean by "question mark style"? I'm trying to fix this on my machine...

@AnTuanHa
Copy link
Author

AnTuanHa commented May 13, 2020

Here is an example from another repo: lovac42/ReMemorize#22
And the corresponding patch: lovac42/ReMemorize@f53d3e5

Here is python docs explaining the question mark style: https://docs.python.org/3/library/sqlite3.html
And sqlite language: https://www.sqlite.org/lang.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants