mortii / anki-morphs

A MorphMan fork rebuilt from the ground up with a focus on simplicity, performance, and a codebase with minimal technical debt.
https://mortii.github.io/anki-morphs/
Mozilla Public License 2.0
55 stars 8 forks source link

Crashes on start-up since 0.5.3 alpha #66

Closed soliviantar closed 9 months ago

soliviantar commented 9 months ago

Opening Anki immediately shows the following 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 to the add-on author.
Debug info:
Anki 2.1.66 (70506aeb) Python 3.9.15 Qt 6.5.2 PyQt 6.5.2
Platform: Windows-10-10.0.22621
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-11-20 16:20:09
Add-ons possibly involved: ⁨ankimorphs-alpha⁩

Caught exception:
Traceback (most recent call last):
  File "aqt.progress", line 118, in handler
  File "aqt.main", line 217, in on_window_init
  File "aqt.main", line 264, in setupProfileAfterWebviewsLoaded
  File "aqt.main", line 316, in setupProfile
  File "aqt.main", line 495, in loadProfile
  File "_aqt.hooks", line 3977, in __call__
  File "C:\Users\user\AppData\Roaming\Anki2\addons21\472573498\__init__.py", line 192, in init_db
    read_config_filters: list[AnkiMorphsConfigFilter] = get_read_enabled_filters()
  File "C:\Users\user\AppData\Roaming\Anki2\addons21\472573498\config.py", line 147, in get_read_enabled_filters
    config_filters = _get_filters_config()
  File "C:\Users\user\AppData\Roaming\Anki2\addons21\472573498\config.py", line 191, in _get_filters_config
    filters.append(AnkiMorphsConfigFilter(_filter))
  File "C:\Users\user\AppData\Roaming\Anki2\addons21\472573498\config.py", line 29, in __init__
    self.unknowns_field_: str = _get_filter_str(_filter, "unknowns_field")
  File "C:\Users\user\AppData\Roaming\Anki2\addons21\472573498\config.py", line 232, in _get_filter_str
    filter_item = _filter[key]
KeyError: 'unknowns_field'

It also makes other add-ons crash (like Chinese Support 3) when closing Anki.

mortii commented 9 months ago

Thank you for reporting it!

This is the same error that was described in the v0.4.1-alpha changelog:

THIS UPDATES CAUSES AN ERROR! This happens because I renamed a config variable (focus_morph_field -> unknowns_field). To fix this error go to Tools -> Add-ons -> select 'ankimorphs-alpha' -> click Config -> Restore Defaults. This resets your AnkiMorphs settings, so you need to redo your settings and save the changes.

Do you know which version you updated from?

soliviantar commented 9 months ago

I restored defaults and now it's working fine, thanks!

I think I installed this addon in the first or second alpha, so it's been updating automatically ever since. I might have skipped one of the 0.5, but I don't think so.

mortii commented 9 months ago

Huh, that is very weird... Hopefully this is an edge-case and it doesn't happen for other people.

Glad it works! :raised_hands:

github-actions[bot] commented 6 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.