-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anki crashes on start #205
Comments
I'm very sorry to hear that! Thanks for reporting! However, in my testing (on Linux with Anki 23.12.1 Qt6), manual snapshots (via (Edit (in case you read the previous version of this comment): snapshots on closing also seem to work — I got confused...) Could you please:
Thanks and sorry again! |
|
The application just crashes unexpectedly. I managed to only export my data in a JSON file just once. After that when the add-on is enabled, Anki just crashes on start. Auto sync on open/close is enabled. |
Oh no, this looks like a dulwich/git issue! :( (i.e. it's possible that it's indirectly caused by incompatibility between CrowdAnki and the newest version of Anki, but it might just be bad luck). The direct issue is that at some point, when creating a snapshot, CrowdAnki (precisely the (otherwise amazing!) dulwich library which we use to handle git operations) did not remove a temporary git lock file (the lock files are there to make sure that all git operations are atomic). (For some as yet unknown reason — hopefully just a very rare timing issue, but possibly not.) This lock file now persists and prevents CrowdAnki from doing anything with that git repository (because dulwich sees the lock file and believes that there is a stale/unfinished operation). I believe that it should be safe to just remove the mv -i /home/chris/.local/share/Anki2/addons21/1788670778/user_files/Chris/MyDeck__Medicine__a_YelloW_deck__The_ABSITE_Review__5th_edition__Chapter_15__Trauma/.git/objects/3c/9a31cef15582487e1dad1fde925062de89958a.lock ~/temporary_lockfile and then try opening Anki with CrowdAnki enabled. Hopefully this was a one-off issue and snapshots will continue as normal. (If not please complain here!) |
Followed your instructions and removed the .lock file but another one appears. Keep in mind that my collection is relatively big and the JSON exported file is over 100 Mb, that git normally handles. Would git lfs be a better option? Is it combatible with CrowdAnki?
|
I'll try to see if I can reproduce your issue with a large deck — if I can that will make debugging/testing smoother since I won't need to ask you to try things.
Unfortunately, we don't directly use git, but instead use dulwich which has a ground-up pure-python implementation of git. (It has to be pure-python to be uploadable to AnkiWeb. We can't just "shell out" to git because most users won't have git installed.) If the issue turns out to be a not-easily-workaroundable performance issue in dulwich, then one solution might be to have an option (off-by-default) for CrowdAnki to directly call git (if the user has it installed). (Or possibly use libgit, but that's tricky because Anki doesn't access the "normal" python site packages.)
Possibly. Just allowing normal git to be called would be the first step, though. (To use git lfs we'd need to call the binary anyway, as dulwich doesn't fully support LFS (yet?).) |
To keep you informed, I've tested with heavy decks (3 GB deck.json) and with large-ish amounts of media (10000 (small-ish) randomly generated images), and I'm still unable to reproduce the issue where the lock file is generated. When I have more time I'll test some more situations (e.g. on Wayland), but for the time being I have no idea. (My best guess is that on your system Anki is (for some reason) killed before the creation of the snapshot is complete, but I have no idea why.) If/when I have more time I'll also see if adding the option to use git directly might be straightforward and if it might help you. As an alternative way of keeping a history of your deck you might, perhaps, in the meantime want to try ki. (Not affiliated and haven't actually tried it, but the creator had reached out to me suggesting it for another project, and it looks cool — its main disadvantage is that it's a separate tool.) |
Thank you very much for your quick response and your time !! :) |
I recently tried the add-on on Anki 23.12.1, but unfortunately although I could create a json file, snapshots do not work.
Could you please update the add-on to be compatible with the latest Anki version?
I find it very useful for version control of my changes. I would really be thankful.
Christos Longros
The text was updated successfully, but these errors were encountered: