iamjustkoi / LeechToolkit

Toolkit for adding extra leech and lapse functionality to Anki.
MIT License
4 stars 1 forks source link

Mysterious error while reviewing #5

Closed Nayelianne closed 1 year ago

Nayelianne commented 1 year ago

Bug/Issue Description I'm getting the mysterious error below, it takes a while some times, it some times happens when I hit "Again" on a card, on others it's when I hit "Good" on different cardd.. It doesn't happen if I undo the review and repeat the action. so I'm unsure what's causing it. The one addon I thought could be conflicting is morphman, but it wasn't active on the deck I was reviewing.

To Reproduce Review things for a while, specific trigger yet unknown. I might try to deactivate most of my addons to see if I can narrow it down to a compatibility issue, but some times it takes a lot of cards for the error to happen, so it can prove time consuming for something that could potentially just be a unrelated bug. So I figured I'd register the issue here for starters.

Error Message

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.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 7
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2022-12-02 05:15:14

Caught exception:
Traceback (most recent call last):
  File "aqt\taskman.py", line 101, in _on_closures_pending
  File "aqt\taskman.py", line 71, in <lambda>
  File "aqt\taskman.py", line 90, in wrapped_done
  File "aqt\operations\__init__.py", line 112, in wrapped_done
  File "aqt\reviewer.py", line 414, in after_answer
  File "aqt\reviewer.py", line 426, in _after_answering
  File "aqt\hooks_gen.py", line 3080, in __call__
  File "C:\Users\windows 7\AppData\Roaming\Anki2\addons21\368380974\src\reviewer.py", line 231, in on_answer_v3
    self.on_answer(context, card, ease)
  File "C:\Users\windows 7\AppData\Roaming\Anki2\addons21\368380974\src\reviewer.py", line 370, in on_answer
    self.handle_card_updates(card, handle_card_answer)
  File "C:\Users\windows 7\AppData\Roaming\Anki2\addons21\368380974\src\reviewer.py", line 289, in handle_card_updates
    changes = self.reviewer.mw.col.merge_undo_entries(last_step)
  File "anki\collection.py", line 883, in merge_undo_entries
  File "anki\_backend\generated.py", line 912, in merge_undo_entries
  File "anki\_backend\__init__.py", line 131, in _run_command
anki.errors.InvalidInput: Invalid input: ⁨target undo op not found⁩

System/Debug Info

    Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
    Platform: Windows 7
    Flags: frz=True ao=True sv=3
    Add-ons, last update check: 2022-12-02 05:15:14

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    '' ['browser_field_to_tags', 0, 'None', '']
    Add a tag to notes with missing media ['2027876532', 2022-06-04T21:28, 'None', '']
    Add-on folder with readable names ['519936472', 2020-03-07T00:36, 'None', '']
    Advanced Browser ['874215009', 2022-09-26T21:28, 'None', '']
    Advanced Copy Fields ['1898445115', 2019-05-03T15:46, 'None', '']
    Advanced Review Bottom Bar ['1136455830', 2022-09-29T10:31, 'None', '']
    Always On Top ['1760080335', 2019-06-29T03:45, 'None', '']
    Anki Zoom ['538879081', 2020-04-03T21:20, 'v1.1.3', mod]
    AnkiWebView Inspector ['31746032', 2022-04-08T16:44, 'None', '']
    Batch Editing ['291119185', 2019-06-02T15:47, 'None', '']
    Browser external editor ['1463430836', 2022-05-18T04:31, 'None', '']
    CTRLF5 to Refresh the Browser ['1347728560', 2019-07-30T03:36, 'None', '']
    Colorful Browser Sidebar ['929609616', 2021-09-09T15:03, 'None', mod]
    Copy notes ['1566928056', 2021-12-24T16:56, 'None', '']
    Custom Styles font color background colour classes ['1899278645', 2021-03-02T21:41, 'None', '']
    Customize Keyboard Shortcuts ['24411424', 2022-06-29T03:13, 'None', '']
    Doublethink Disables Normalization ['1654528592', 2020-01-22T05:02, 'None', '']
    Fastbar- with nightmode support ['46611790', 2022-11-28T10:10, 'None', '']
    Japanese Automatic Flashcard Creation from Jishoorg - Anki 21 port ['907064139', 2018-05-11T16:46, 'None', '']
    Japanese Example Sentences ['2413435972', 2020-01-15T18:19, 'None', mod]
    Japanese Pitch Accent ['148002038', 2022-03-26T06:00, 'None', '']
    Japanese Support ['3918629684', 2020-01-15T17:23, 'None', mod]
    Japanese Vocab Frequency Generator ['1004691625', 2022-09-07T15:45, 'None', mod]
    JapaneseFurigana ['678316993', 2022-10-20T12:24, 'None', '']
    Kanji Colorizer stroke order diagrams ['1964372878', 2020-11-03T15:33, 'None', mod]
    KanjiEaters Heisig RTK Rebooting the Kanji - Related Vocab on Sentence Cards ['1855482626', 2019-06-09T13:58, 'None', '']
    KanjiVocab - smart automatic vocab for RTK ['1600796261', 2020-04-20T09:30, 'None', '']
    Korean Support ['1336389630', 2021-07-31T17:19, 'None', mod]
    Leech Toolkit ['368380974', 2022-10-12T19:27, 'None', '']
    MassAdd - Create multiple cards from raw text ['1909156369', 2021-08-16T10:26, 'None', '']
    MecabUnidic ['MecabUnidic', 0, 'None', '']
    MorphMan for Anki 21 ['900801631', 2022-01-29T19:23, 'None', '']
    Quick Lookup ['1778631913', 2022-09-18T21:46, 'None', '']
    See Previous Card Ratings in Reviewer ['1906641654', 2021-08-19T18:32, 'None', '']
    Sticky Tags ['1433159067', 2021-12-17T08:52, 'None', '']
    Toggle Tags via ReviewerEditorBrowser Context Menu ['2088508994', 2018-12-31T20:50, 'None', '']
    True Retention ['613684242', 2020-01-22T05:16, 'None', '']
    batch change fonts ['1479177943', 2021-12-06T11:53, 'None', '']
    extended html editor for fields and card templates with some versioning ['1043915942', 2022-09-10T11:40, 'None', '']
    numbers2stripes ['2088639269', 2021-11-05T02:16, 'None', '']

    ===IDs of active AnkiWeb add-ons===
    1004691625 1043915942 1136455830 1336389630 1347728560 1433159067 1463430836 1479177943 148002038 1566928056 1600796261 1654528592 1760080335 1778631913 1855482626 1898445115 1899278645 1906641654 1909156369 1964372878 2027876532 2088508994 2088639269 2413435972 24411424 291119185 31746032 368380974 3918629684 46611790 519936472 538879081 613684242 678316993 874215009 900801631 907064139 929609616

    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    AJT Flexible Grading ['1715096333', 2022-08-25T14:30, 'None', mod]
    Add tags by shortcuts in Reviewer window one shortcut for one tag ['171767752', 2019-07-11T11:53, 'None', mod]
    Anki Dojo ['433778282', 2022-11-13T13:24, 'None', '']
    Card Layout Editor - syntax highlighting monospace font ['1483620388', 2018-01-17T12:11, 'None', '']
    Cloze Anything ['330680661', 2021-12-09T04:34, 'None', '']
    Field AutoComplete ['511710206', 2022-02-25T07:03, 'None', mod]
    Find and Replace in Card templatesNotetypesHTML ['992153575', 2021-09-17T03:34, 'None', '']
    Migaku Kanji GOD ['1872210448', 2022-03-15T11:48, 'None', mod]
    Nihongo Companion ['1946501448', 2022-04-12T19:07, 'None', '']
    Paste Images As WebP ['1151815987', 2022-10-23T12:19, 'None', mod]
    Pokemanki ['633922407', 2021-02-24T15:49, 'None', '']
    browser search aliasesabbreviations ['546509374', 2022-08-16T07:38, 'None', mod]

Additional Context These are my settings: image On the Actions tab, I have an Add Tag active in the Leech Actions, and on Unleech I have it adding a tag and removing the previous Leech tag. From the Advanced tab I only have "Show options in Tools menu" active, and the default filled "Use a custom tag to keep track of toolkit updates across devices"

Since I was unsure if Leech was a special tag that only Anki itself was allowed to use, I changed the Leech tag to LeechT just in case. I almost thought I had it sorted out, but the same error eventually occurred regardless.

iamjustkoi commented 1 year ago

Hey! Thanks for reporting, appreciate all the detail.

Since I was unsure if Leech was a special tag that only Anki itself was allowed to use, I changed the Leech tag to LeechT just in case. I almost thought I had it sorted out, but the same error eventually occurred regardless.

Oh yeah, very good point actually! Should probs mention that somewhere to be honest but, yep, "Leech" is pretty much reserved by Anki so you might run into issues using it like ya thought.

Either way, looks like a duplicate of #4. I posted a hot-fix version there if you wanna give it a try and see how that goes. Wish you the best! (https://drive.google.com/file/d/103Bio5kbizH7znIh1BiqF10uTHtHUgeK/view?usp=sharing)