fonol / anki-search-inside-add-card

An add-on providing full-text-search and PDF reading functionality to Anki's Add card dialog
https://ankiweb.net/shared/info/1781298089
GNU Affero General Public License v3.0
179 stars 24 forks source link

Changing to indexing only one deck raises a problem #174

Closed sasank89 closed 3 years ago

sasank89 commented 3 years ago

Hi,

I have the following issue.

Steps to reproduce the problem -

  1. I installed the add-on. Startup all good. It indexed my entire collection. Everything works good.
  2. I changed the config.json file via the add-ons dialog box in Anki - added a single deck which I wanted to include in the index. This deck has very few cards <50.
  3. Restarted Anki. The following error message appears.

Debug info: Anki 2.1.35 (84dcaa86) Python 3.9.0 Qt 5.15.2 PyQt 5.15.2 Platform: Linux Flags: frz=False ao=True sv=2 Add-ons, last update check: 2020-12-09 22:19:37 Add-ons possibly involved: ⁨Searching PDF Reading Note-Taking in Add Dialog⁩

Caught exception: Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/aqt/progress.py", line 53, in handler func() File "/usr/lib/python3.9/site-packages/aqt/main.py", line 142, in on_window_init fn() File "/usr/lib/python3.9/site-packages/aqt/main.py", line 231, in setupProfile self.loadProfile() File "/usr/lib/python3.9/site-packages/aqt/main.py", line 427, in loadProfile gui_hooks.profile_did_open() File "/usr/lib/python3.9/site-packages/aqt/gui_hooks.py", line 2027, in call hook() File "/home/sasank/.local/share/Anki2/addons21/1781298089/src/index/indexing.py", line 41, in build_index state.index_data_size = index_data_size() File "/home/sasank/.local/share/Anki2/addons21/1781298089/src/index/indexing_data.py", line 76, in index_data_size c_anki = mw.col.db.scalar("select count() from (select distinct notes.id, did, mid from notes left join cards on notes.id = cards.nid where did in %s" %(deckStr)) File "/usr/lib/python3.9/site-packages/anki/dbproxy.py", line 74, in scalar rows = self._query(sql, args, first_row_only=True, **kwargs) File "/usr/lib/python3.9/site-packages/anki/dbproxy.py", line 55, in _query return self._backend.db_query(sql, args2, first_row_only) File "/usr/lib/python3.9/site-packages/anki/rsbackend.py", line 221, in db_query return self._db_command( File "/usr/lib/python3.9/site-packages/anki/rsbackend.py", line 244, in _db_command raise proto_exception_to_native(err) anki.rsbackend.DBError: DBError { info: "SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some(\"incomplete input\"))", kind: Other }

Steps taken to solve the problem

  1. Restarted Anki and the entire system
  2. Updated the system
  3. Deleted the entire .siac-notes.db file and rebuilt entire index from scratch by specifying the name of the deck on initial startup itself

No changes with the above measures.

fonol commented 3 years ago

Thanks, there was syntax error in the sql query (missing closing bracket). A fixed version is on Ankiweb.

sasank89 commented 3 years ago

Thank you for the quick edit and correction!!