Skip to content
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

[BUG] Getting "Anki has encountered an unexpected error when closing Anki. #400

Closed
jonahspear-toast opened this issue May 1, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@jonahspear-toast
Copy link

Describe the bug

Getting "Anki has encountered an unexpected error when closing Anki. Anki is saying that it is an issue with fsrs4anki-helper. Here is the debug info:

Anki 23.12.1 (1a1d4d54) (ao)
Python 3.9.15 Qt 6.5.3 PyQt 6.5.3
Platform: macOS-14.3.1-arm64-arm-64bit

Traceback (most recent call last):
File "aqt.taskman", line 142, in _on_closures_pending
File "aqt.taskman", line 86, in
File "/Users/jspear/Library/Application Support/Anki2/addons21/759844606/schedule/reschedule.py", line 171, in on_done
mw.reset()
File "aqt.main", line 851, in reset
File "aqt.main", line 803, in _synthesize_op_did_execute_from_reset
File "_aqt.hooks", line 3840, in call
File "aqt.deckchooser", line 120, in on_operation_did_execute
File "aqt.deckchooser", line 82, in _update_button_label
RuntimeError: wrapped C/C++ object of type QPushButton has been deleted

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Advanced Review Bottom Bar ['1136455830', 2024-02-04T13:38, 'None', mod]
FSRS4Anki Helper ['759844606', 2024-04-26T13:38, 'None', mod]
Image Occlusion Enhanced ['1374772155', 2022-04-09T03:15, 'None', '']
PassFail 2 Remove the Easy and Hard buttons ['876946123', 2023-01-23T20:59, 'None', '']
Progress Bar cards done cards left secondscard time spentleft and ETA ['1097423555', 2023-10-02T04:05, 'None', mod]
Puppy Reinforcement ['1722658993', 2023-11-16T07:59, 'None', '']
Reset Ease ['947935257', 2023-11-11T20:22, 'None', '']
Review Heatmap ['1771074083', 2022-06-29T21:43, 'None', '']
right hand reviews hjkl answer shortcuts Handy Answer Keys configurable ['850294128', 2023-05-24T05:00, 'None', '']

===IDs of active AnkiWeb add-ons===
1097423555 1136455830 1374772155 1722658993 1771074083 759844606 850294128 876946123 947935257

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

  • Anki version: [e.g. 2.1.55]
  • OS: [e.g. iOS]
  • Scheduler version: [e.g. v1.0.0]
  • Optimizer version: [e.g. v1.0.3]
  • Simulator version: [e.g. v1.1.0]

Additional context
Add any other context about the problem here.

@jonahspear-toast jonahspear-toast added the bug Something isn't working label May 1, 2024
@L-M-Sherlock
Copy link
Member

Which feature do you enable in the helper add-on?

@jonahspear-toast
Copy link
Author

jonahspear-toast commented May 2, 2024

image

here are my enabled features. Please let me know if there's anything else I can provide

@L-M-Sherlock
Copy link
Member

Sorry for this delayed reply. I have come back from my vacation just now. I cannot reproduce your issue. How many times do you meet this error?

@L-M-Sherlock
Copy link
Member

It will be fixed in Anki's part: ankitects/anki#3190

@RichFS-Liao
Copy link

I'm not sure if others have encountered the same issue, but I've noticed that when I close Anki, it remains in the background processes. This prevents me from reopening Anki next time, requiring me to manually close Anki from the Task Manager.

I've made several attempts to troubleshoot, and as a conclusion, the error seems to occur during the synchronization process when closing Anki, and it only happens when there's nothing to synchronize.

I've found that commenting out lines 96 and 97 in sync_hook.py can avoid this situation (for testing purposes, not as a solution). This might help in pinpointing the entry point of the problem.

@L-M-Sherlock
Copy link
Member

It's a problem related to Orphan Process. FSRS helper add-on runs rescheduling and dispersing in subprocess of Anki. Sometimes the main process of Anki has been terminated, but the subprocess is still running.

@Yell0whead
Copy link

Hi there,

For what it's worth, I've also been encountering this issue.

I'm currently using Anki version:

24.04.1 (ccd9ca1a)⁩
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1

where having the add-on enabled prevents Anki from properly closing/quitting. This is on MacOS:

Sonoma 14.5 (23F79)

This issue occurs whether one A) closes via the red "x" button on the top-left of the window, B) closes by right-clicking the app and selecting "Quit", or C) closes by using the Cmd + Q hotkey.

I've confirmed the following other troubleshooting steps, and isolated it to this add-on. FYI, the following add-on also causes the same behaviour, and you can find a submitted bug report here:

Auto Sync (501542723)

@L-M-Sherlock
Copy link
Member

fixed by ankitects/anki#3190

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants