Stvad / CrowdAnki

Plugin for Anki SRS designed to facilitate cooperation on creation of notes and decks.
MIT License
536 stars 43 forks source link

Trouble trying to upgrade Ultimate Geography deck #120

Closed gitonthescene closed 3 years ago

gitonthescene commented 3 years ago

I'm having trouble uploading the latest version of the Ultimate Geography deck. I just upgraded both Anki and CrowdAnki and so there are a lot of moving parts. I tried removing and reinstalling CrowdAnki but got the same error.

There's not a lot to go on with the error message and I'm not sure where aqt is. I'm happy to debug further, but I'm going to need some guidance. I would appreciate any help you could offer.

Regards,

Debug info:
Anki 2.1.40 (cf446733) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-02-11 11:18:45
Add-ons possibly involved: ⁨CrowdAnki JSON exportimport Edit history Collaborate on deck creation⁩

Caught exception:
Traceback (most recent call last):
  File "/Users/douglasmennella/Library/Application Support/Anki2/addons21/1788670778/anki/ui/action_vendor.py", line 31, in <lambda>
    lambda: AnkiJsonImporter.import_deck(self.window.col, self.directory_vendor))
  File "/Users/douglasmennella/Library/Application Support/Anki2/addons21/1788670778/importer/anki_importer.py", line 112, in import_deck
    AnkiJsonImporter.import_deck_from_path(collection, Path(directory_path))
  File "/Users/douglasmennella/Library/Application Support/Anki2/addons21/1788670778/importer/anki_importer.py", line 101, in import_deck_from_path
    if importer.load_deck(directory_path):
  File "/Users/douglasmennella/Library/Application Support/Anki2/addons21/1788670778/importer/anki_importer.py", line 36, in load_deck
    aqt.mw.backup()
  File "aqt/main.py", line 588, in backup
AssertionError

[EDIT: I found aqt on PyPI, but I'm still not sure where the AssertionError is coming from. Also, I don't think the lines are matching up so it's tough to figure out if this is the same code.]

aplaice commented 3 years ago

Thanks for reporting!

This is due to an incompatibility between CrowdAnki and Anki 2.1.40 (each release of Anki slightly changes the "base" that CrowdAnki relies on, in some cases leading to incompatibility, and since Anki 2.1.40 was a fresh release, there hadn't been time to update CrowdAnki).

The fix has now been applied in the git repository, and will probably be available tomorrow on ankiweb.net.

You can wait until then or temporarily downgrade to Anki 2.1.39 (just for the import).

gitonthescene commented 3 years ago

Awesome! Thanks very much. I found some more advice on debugging here and here, but I still couldn't see aqt/main.py. Do you mind sharing how you tracked this down?

aplaice commented 3 years ago

I cloned the main anki repository, found aqt/main.py (it's under the qt directory, which makes it slightly harder to find), found the matching line (the line numbers have shifted slightly, but this is the only assertion in the backup method), used git blame to determine what was the relevant change and guessed/thought how best to fix the issue here.

gitonthescene commented 3 years ago

Thanks very much. This should improve my bug reporting for next time. :) FWIW, I didn't see any assertion in the PyPI version I referred to above. I guess the Anki folks don't sync it as regularly as releases? Worth reporting there??

aplaice commented 3 years ago

FWIW, I didn't see any assertion in the PyPI version I referred to above.

That's weird. It should be there, since the version numbers are the same.

Worth reporting there??

Probably not unless something similar happens again.

gitonthescene commented 3 years ago

Interestingly, the PyPI version is missing the comments and the assertion. Perhaps they were stripped for that, but I would have thought they'd be stripped in the binary release as well.

In any event. Thanks for the quick turnaround.

gitonthescene commented 3 years ago

FWIW, I was able to update this deck just now. Thanks again for your fix.

gitonthescene commented 3 years ago

I think this issue can be closed

aplaice commented 3 years ago

I think only the owner of the repo and you as the creator of this issue, can close it! (I can't!)

gitonthescene commented 3 years ago

Okay. I’ll just close it then. Thanks.