Anki can't be launched without internet connection

I am running Anki 23.12.1 on Windows.

If I try to launch Anki without an internet connection, the following pop-ups come up and can’t be dismissed. Anki is unusable in this state, and I have to kill the process using the Task Manager.

Anki starts normally if I hold Shift when opening it, presumably because this disables automatic syncing.

You can turn off automatic syncing in Tools / Preferences / Syncing by unchecking the “Automatically sync on profile open/close” option. Remember to manually sync once in a while by clicking on Sync in the main window menu (Deck Add Browse Stats Sync).

Thanks for the suggestion. But, I want to sync my collection when starting Anki (and internet is usually available).

This was intended to be more of a bug report than a support request.

1 Like

Ah, you want Anki to handle automatic-sync failure on startup more gracefully.

But there may be a danger in letting the user continue in this situation. What if the user studied a bunch of cards on their iPhone a bit earlier, and by habit they are counting on the desktop app to just pick up where they left off? Letting the user continue here could result in lost work.

Yes, you could have a suitable warning pop up to “continue at your own risk”, but ordinary users tend to ignore or skim such warning messages.

But Anki has consistently been usable offline in every 2.1.x version that I’ve used. The “Please check your internet connection” message appears, you click OK, it works just fine.

That 2nd “Checking” box is something different. If 23.12.x requires internet to run, that’s a pretty big change (and I’m not going to be able to upgrade to it).

I think that’s an excellent argument for a better error message here than “Please check your internet …” (like how about “Anki could not sync …”) – but not an argument that the program should suddenly be locked and unusable without internet.

+1

Same problem here: Anki definitely needs to be usable offline for me. It should just fail to sync and let me know that it failed. But now I’m stuck in a train and have no way of using Anki when the signal is bad (error message below).

This is a pretty big, unexpected, and breaking change if it’s intended.


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

Traceback (most recent call last):
  File "aqt.sync", line 110, in on_future_done
  File "concurrent.futures._base", line 439, in result
  File "concurrent.futures._base", line 391, in __get_result
  File "concurrent.futures.thread", line 58, in run
  File "aqt.sync", line 129, in <lambda>
  File "anki.collection", line 1111, in sync_collection
  File "anki._backend_generated", line 103, in sync_collection
  File "anki._backend", line 166, in _run_command
anki.errors.NetworkError: Connection timed out. Please try again. If you see frequent timeouts, please try a different network connection.

Error details: <U+2068><U+2069>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "urllib3.connection", line 203, in _new_conn
  File "urllib3.util.connection", line 85, in create_connection
  File "urllib3.util.connection", line 73, in create_connection
TimeoutError: [Errno 60] Operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "urllib3.connectionpool", line 790, in urlopen
  File "urllib3.connectionpool", line 491, in _make_request
  File "urllib3.connectionpool", line 467, in _make_request
  File "urllib3.connectionpool", line 1096, in _validate_conn
  File "urllib3.connection", line 611, in connect
  File "urllib3.connection", line 218, in _new_conn
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x135ae71c0>: Failed to establish a new connection: [Errno 60] Operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "requests.adapters", line 486, in send
  File "urllib3.connectionpool", line 844, in urlopen
  File "urllib3.util.retry", line 515, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.beeminder.com', port=443): Max retries exceeded with url: /api/v1/users/me/goals/mprog/datapoints/create_all.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x135ae71c0>: Failed to establish a new connection: [Errno 60] Operation timed out'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aqt.taskman", line 142, in _on_closures_pending
  File "aqt.taskman", line 86, in <lambda>
  File "aqt.taskman", line 106, in wrapped_done
  File "aqt.sync", line 113, in on_future_done
  File "/Users/howtodowtle/Library/Application Support/Anki2/addons21/1928083890/addon.py", line 176, in update_on_done
    update(mw.col)
  File "/Users/howtodowtle/Library/Application Support/Anki2/addons21/1928083890/addon.py", line 114, in update
    beeminder_result = beeminder.add_datapoints(auth_token,
  File "/Users/howtodowtle/Library/Application Support/Anki2/addons21/1928083890/beeminder.py", line 43, in add_datapoints
    res = requests.post(url, data={"datapoints": json.dumps(datapoints),
  File "requests.api", line 115, in post
  File "requests.api", line 59, in request
  File "requests.sessions", line 589, in request
  File "requests.sessions", line 703, in send
  File "requests.adapters", line 519, in send
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.beeminder.com', port=443): Max retries exceeded with url: /api/v1/users/me/goals/mprog/datapoints/create_all.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x135ae71c0>: Failed to establish a new connection: [Errno 60] Operation timed out'))

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Batch Editing ['291119185', 2023-10-26T02:38, 'None', '']
Button Colours Good Again ['2494384865', 2022-09-27T12:18, 'None', mod]
Customize Keyboard Shortcuts ['24411424', 2023-11-01T10:17, 'None', mod]
Deck name in title 21 ['699175524', 2019-06-01T03:05, 'None', '']
FSRS4Anki Helper ['759844606', 2023-12-31T11:46, 'None', mod]
LPCG LyricsPoetry Cloze Generator ['2084557901', 2023-12-07T04:43, 'None', '']
Review Heatmap ['1771074083', 2022-06-30T03:43, 'None', '']
extended editor for field for tables searchreplace ['805891399', 2023-07-31T16:12, 'None', mod]

===IDs of active AnkiWeb add-ons===
1771074083 2084557901 24411424 2494384865 291119185 699175524 759844606 805891399

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Advanced Review Bottom Bar ['1136455830', 2023-11-17T12:57, 'None', '']
Beemind maintained progress ['1928083890', 2020-08-16T01:27, 'None', mod]
Image Occlusion Enhanced ['1374772155', 2022-04-09T09:15, 'None', '']
Randomize Fonts ['1603486068', 2021-03-19T20:50, 'None', '']
Study Time Stats ['1247171202', 2023-09-28T18:30, 'None', '']
SwiftAnki Quick Anki Navigation with Keyboard Shortcuts ['1467361433', 2023-12-28T16:24, 'None', '']
True Retention ['613684242', 2017-11-19T21:43, 'None', '']
anki-automatic-case ['1750883788', 2021-10-25T13:23, 'None', '']

Edit: I see that the issue came from contacting beeminder.com, but in the end it’s an anki.errors.NetworkError so I thought it was related to some Anki (not Beeminder) behavior and would fit here. Also, it’s weird that Anki even tries to contact beeminder since I disable the add-on when the issue occurred first.

This is a pretty big, unexpected, and breaking change if it’s intended.

I don’t actually believer the current behavior is intended:

  • A Network error occurs
  • Anki shows an error message
  • Anki stays open, but I cannot do anything: no studying cards, opening browser, settings etc. I cannot even close it.

Ah but it doesn’t require the Internet to run if you turn off the “Automatically sync on profile open/close” option in Preferences like I mentioned above.

For users who frequently experience loss of connectivity, it’s probably better to turn off the automatic sync option and just exercise manual awareness of whether there’s a pending sync from another device.

I don’t know if the old behavior was changed deliberately or inadvertently, but if it was deliberate, it may have been because users were just unthinkingly clicking OK and later finding that they had data loss because their unsynced changes were overwritten.

Make sure to restart Anki. Your issue is caused by the add-on.

If you disable all add-ons in the add-on screen, and restart Anki without holding down shift, are you able to reproduce the problem?

I have found out that this issue is caused by the Spell Checker add-on.

As other users suggested, what’s your opinion on making the error message clearer than simply saying “Please check your internet connection.”?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.