Anki is stuck at 'Checking...'

Hi everyone,

Unfortunately for the last couple of months, my anki desktop version has stopped working because it get stuck at this constant ‘Checking…’ process. I have installed the latest version of Anki but still won’t solve the issue.

I tried to reinstall the Anki app and try to log in to a new account that I sign up. However, even if reinstalling the latest version of anki, Anki will still log in to my old account and get stuck in the ‘Checking…’ process again.

TBH this is really frustrating for the last couple of months for me. Your help will be much appreciated :slight_smile:

Hi everyone,

I just came up with a solution and it works for me! Hope it might work for someone who is also experiencing the same issue.

After you reinstall Anki, ALWAYS DISCONNECT THE WIFI CONNECTION before you open Anki. In that case, Anki would not enter the data syncing mode but only open your deck.

After that, you can click on the ‘switch profile’ under the ‘files’ tab.

Screen Shot 2022-02-07 at 12.48.02 am

Then log out your previous account and then reconnect the wifi. You can now either log in to your previous account or your new account! I have tried to log in to my old account and there is no longer any ‘Checking…’ process involved. Instead it managed to bypass the ‘Checking…’ and complete the uploading process.

Everything is now back on track!

I’ve been experiencing the same issue for some time now. Everytime an add-on update prompt appears, Anki gets stuck with this checking process after successfully updating. I have to force-quit the app each time this happens.

I’ll start Anki from the console from now on to see if there’s an error message.

@kleinerpirat does it happen in the beta?

Yes it should, as I’ve been running from source over the past few months. I’ll do some testing this evening.

I wasn’t able to reproduce it here, and it probably comes down the particular timings of the auto sync and the add-on check. Perhaps the following will make it easier for you to trigger it there:

diff --git a/qt/aqt/main.py b/qt/aqt/main.py
index 0d7e11a19..06c06add0 100644
--- a/qt/aqt/main.py
+++ b/qt/aqt/main.py
@@ -941,7 +941,7 @@ title="{}" {}>{}</button>""".format(
         last_check = self.pm.last_addon_update_check()
         elap = int_time() - last_check
 
-        if elap > 86_400 or self.pm.last_run_version() != point_version():
+        if True:  # elap > 86_400 or self.pm.last_run_version() != point_version():
             check_and_prompt_for_updates(
                 self,
                 self.addonManager,

You can also manually edit an addon’s meta.json and change the modtime to cause a notification.

Presumably it’s some interaction between the modal progress window of the auto sync, and the modal update pop-up. addons.py:1397 already covers the full sync case; maybe we could solve this by also deferring in the regular sync case? As a test, you could try checking mw.progress._levels to see if there’s an existing progress window.

Thanks, Damien! This made it easy to replicate the issue.

It’s actually not “Checking” that gets stuck for me, but the sync progress window:
image

It stays at 0 and cannot be quit. There seems to be an active progress window at the time of the add-on check:

diff --git a/qt/aqt/main.py b/qt/aqt/main.py
index 0d7e11a19..1a394c0eb 100644
--- a/qt/aqt/main.py
+++ b/qt/aqt/main.py
@@ -941,7 +941,8 @@ title="{}" {}>{}</button>""".format(
         last_check = self.pm.last_addon_update_check()
         elap = int_time() - last_check
 
-        if elap > 86_400 or self.pm.last_run_version() != point_version():
+        if True or self.pm.last_run_version() != point_version():
+            print(self.progress._levels)
             check_and_prompt_for_updates(
:

outputs 0

What is _levels set to at https://github.com/ankitects/anki/blob/62426279ffca8a454ec4e3f5c22e6729932403f7/qt/aqt/addons.py#L1398? If the sync window had already popped up at that point, we should defer the display further.

diff --git a/qt/aqt/addons.py b/qt/aqt/addons.py
index 472419556..b32fd33b4 100644
--- a/qt/aqt/addons.py
+++ b/qt/aqt/addons.py
@@ -1396,6 +1396,7 @@ def check_for_updates(
     def update_info_received(future: Future) -> None:
         # if syncing/in profile screen, defer message delivery
         if not mgr.mw.col:
+            print(mgr.mw.progress._levels)
             mgr.mw.progress.timer(
                 1000,
                 lambda: update_info_received(future),

It’s 0 at that point as well.

What about after the save statement?

main.py @maybe_check_for_addon_updates: 0
Starting main loop...
addons.py @update_info_received: 0
addons.py @update_info_received: 0
sync.py after mw.col.save: 0

(cut out Qt Wayland warnings)

diff
diff --git a/qt/aqt/addons.py b/qt/aqt/addons.py
index 472419556..8d3b751be 100644
--- a/qt/aqt/addons.py
+++ b/qt/aqt/addons.py
@@ -1396,6 +1396,7 @@ def check_for_updates(
     def update_info_received(future: Future) -> None:
         # if syncing/in profile screen, defer message delivery
         if not mgr.mw.col:
+            print(f"addons.py @update_info_received: {mgr.mw.progress._levels}")
             mgr.mw.progress.timer(
                 1000,
                 lambda: update_info_received(future),
diff --git a/qt/aqt/main.py b/qt/aqt/main.py
index 0d7e11a19..4ed9dc91d 100644
--- a/qt/aqt/main.py
+++ b/qt/aqt/main.py
@@ -941,7 +941,8 @@ title="{}" {}>{}</button>""".format(
         last_check = self.pm.last_addon_update_check()
         elap = int_time() - last_check
 
-        if elap > 86_400 or self.pm.last_run_version() != point_version():
+        if True or self.pm.last_run_version() != point_version():
+            print(f"main.py @maybe_check_for_addon_updates: {self.progress._levels}")
             check_and_prompt_for_updates(
                 self,
                 self.addonManager,
diff --git a/qt/aqt/sync.py b/qt/aqt/sync.py
index 7e8eb83ed..26ca60c10 100644
--- a/qt/aqt/sync.py
+++ b/qt/aqt/sync.py
@@ -117,6 +117,7 @@ def sync_collection(mw: aqt.main.AnkiQt, on_done: Callable[[], None]) -> None:
             full_sync(mw, out, on_done)
 
     mw.col.save(trx=False)
+    print(f"sync.py after mw.col.save: {mw.progress._levels}")
     mw.taskman.with_progress(
         lambda: mw.col.sync_collection(auth),
         on_future_done,
[kleinerpirat@X1-Yoga anki]$ 

The next thing I might try is to add some print statements to functions like start/update/finish and showWin in progress.py. You may need to experiment a bit :slight_smile: