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
178 stars 24 forks source link

Error on startup & in add window #159

Closed eckinger closed 3 years ago

eckinger commented 3 years ago

I just downloaded the add-on on my ubuntu (20.04) laptop and I'm getting some errors. On startup I get this one:

Debug info: Anki 2.1.35 (84dcaa86) Python 3.8.1 Qt 5.15.1 PyQt 5.15.1 Platform: Linux Flags: frz=True ao=True sv=2 Add-ons, last update check: 2020-11-09 09:23:01 Add-ons possibly involved: ⁨Searching PDF Reading Note-Taking in Add Dialog⁩

Caught exception: Traceback (most recent call last): File "aqt/progress.py", line 53, in handler File "aqt/main.py", line 142, in on_window_init File "aqt/main.py", line 231, in setupProfile File "aqt/main.py", line 427, in loadProfile File "aqt/gui_hooks.py", line 2027, in call File "/home/alex/.local/share/Anki2/addons21/1781298089/src/index/indexing.py", line 40, in build_index state.index_data = get_notes_in_collection() File "/home/alex/.local/share/Anki2/addons21/1781298089/src/index/indexing_data.py", line 51, in get_notes_incollection for (id, title, text, source, tags, nid, created, modified, reminder, , , , , ) in other_notes: ValueError: not enough values to unpack (expected 14, got 12)

I've tried disabling all other add-ons and the problem persists.

Then I hit "close" on the error window and go to the add window. My first impression is that something's wrong because the UI looks all wonky, although this could be because it's indexing all my flashcards (I have a large collection). Also I haven't used the add-on for many months so maybe this is just what it looks like when it first indexes things. Screenshot from 2020-11-09 15-36-20 In any case, I get another error when I click on, say, the "Queue" text. Here's the message:

Debug info: Anki 2.1.35 (84dcaa86) Python 3.8.1 Qt 5.15.1 PyQt 5.15.1 Platform: Linux Flags: frz=True ao=True sv=2 Add-ons, last update check: 2020-11-09 09:23:01 Add-ons possibly involved: ⁨Searching PDF Reading Note-Taking in Add Dialog⁩

Caught exception: Traceback (most recent call last): File "aqt/webview.py", line 37, in cmd File "aqt/webview.py", line 123, in _onCmd File "aqt/webview.py", line 541, in _onBridgeCmd File "aqt/gui_hooks.py", line 2959, in call File "/home/alex/.local/share/Anki2/addons21/1781298089/src/command_parsing.py", line 572, in expanded_on_bridge_cmd notes = get_priority_list() File "/home/alex/.local/share/Anki2/addons21/1781298089/src/notes.py", line 1233, in get_priority_list return _to_notes(res) File "/home/alex/.local/share/Anki2/addons21/1781298089/src/notes.py", line 1643, in _to_notes notes.append(SiacNote(tup)) File "/home/alex/.local/share/Anki2/addons21/1781298089/src/models.py", line 64, in init self.extract_end : Optional[int] = props[12] IndexError: tuple index out of range

Thanks in advance.

fonol commented 3 years ago

Hi, the error is because you haven't used the add-on for a longer time, and the database has been extended since then. The solution would be to look for what it says in the add-on's config for addonNoteDBFolderPath, in that folder, you should find the siac-notes.db file. Simply deleting that file and restarting should solve your problem.

eckinger commented 3 years ago

It worked! Easy fix. Thanks for the quick response.