Unable to launch Anki macOS Sonoma 14.2.1 Apple silicon

Unable to launch Anki macOS Sonoma 14.2.1 Apple silicon

ENVIRONMENT:

  • Anki 23.12.1 Qt6 Apple silicon installed via Homebrew
  • Apple M2, macOS Sonoma 14.2.1

STEPS TO REPRODUCE:

  • Launch Anki from Finder (or Spotlight or LaunchBar)
  • Confirm downloaded from internet
  • Select language

EXPECTED RESULT:

  • Anki window appears for editing and reviewing cards

ACTUAL RESULT:

  • Anki appears in dock
  • No dot indicating Anki is open
  • No Anki window appears
  • No Anki menubar appears
  • Anki hangs requires force quit to exit

ATTEMPTED WORKAROUNDS:

  • Force quit Anki and relaunch
  • Delete Anki2 folder in Application Support
  • Restart machine

From github releases installed earlier Apple silicon versions:

  • 23.12
  • 23.10.1
  • 23.10
  • 2.1.66
  • 2.1.56

From github releases installed INTEL versions:

  • 23.12.1 qt6
  • 23.12.1 qt5
  • 2.1.56 qt6
  • 2.1.56 qt5

OTHER NOTES:

  • I think Anki was working in Sonoma 14.1.2, but I don’t recall clearly. I recently migrated to this machine.

It runs fine on an M2/14.2.1 machine here. I’m guessing there’s something about your environment that is causing problems. Do you use an external monitor? Do you have other apps/tools running in the background? If you create a new macOS user and run Anki from the new login, does it work?

@dae Thanks for your reply.

  1. No external monitor.
  2. Created a new standard user account. Anki does not load properly.
  3. Made new account an admin and tried opening Anki. Same issue.
  4. In new account disabled all background process and login items in login items system setting. Anki still hangs and does not load properly.

A clarification: ACTUAL RESULT behavior occurs after opening Anki for first time and setting language, then force quitting, then opening again. Nonetheless, Anki still hangs after first launch and setting language.

Any further guidance is appreciated.

Ah, more info. Here’s a log I captured when I force quit Anki and then am asked whether I want to report.

Hmmm . . . not able to attach a file or post a link to a Dropbox file. I’ll think of a way to get the info to you.

UPDATE
I couldn’t find a way to DM you on the forum or over at the github repo. I didn’t want to open an issue since it’s for developers. Please, let me know how I can get the log to you.

Here’s a sample of the report (which is HUGE):

Date/Time:        2024-01-03 19:45:03.420 -0600
End time:         2024-01-03 19:45:18.726 -0600
OS Version:       macOS 14.2.1 (Build 23C71)
Architecture:     arm64e
Report Version:   44
Incident Identifier: 83724756-C08B-46E8-B34E-ABE345D66A53
Share With Devs:  Yes

Data Source:      Stackshots
Shared Cache:     F9DDD844-7F3F-34BD-BE29-F0C72D5E5449 slid base address 0x18c560000, slide 0xc560000 (System Primary)
Shared Cache:     2BF5B417-CD87-34D6-A876-2BBD0F25330F slid base address 0x1cbad4000, slide 0x4bad4000 (DriverKit)
Shared Cache:     AA32606F-3F8A-36DC-89AB-9C1BD7BF3104 slid base address 0x7ff806c34000, slide 0x6c34000 (Rosetta)

Command:          anki
Path:             /Applications/Anki.app/Contents/MacOS/anki
Identifier:       net.ankiweb.dtop
Version:          23.12.1 (???)
Team ID:          7ZM8SLJM4P
Is First Party:   No
Architecture:     arm64
Parent:           launchd [1]
PID:              3948
Time Since Fork:  12s

Event:            hang
Duration:         15.31s
Duration Sampled: 4.30s (process was unresponsive for 11 seconds before sampling)
Steps:            43 (100ms sampling interval)

...

Process:          anki (Anki) [3948]
UUID:             A478762F-93C4-3F43-99E4-07D82C9C2412
Path:             /Applications/Anki.app/Contents/MacOS/anki
Identifier:       net.ankiweb.dtop
Version:          23.12.1 (???)
Team ID:          7ZM8SLJM4P
Is First Party:   No
Shared Cache:     F9DDD844-7F3F-34BD-BE29-F0C72D5E5449 slid base address 0x18c560000, slide 0xc560000 (System Primary)
Architecture:     arm64
Parent:           launchd [1]
UID:              501
Footprint:        86.44 MB
Time Since Fork:  12s
Num samples:      43 (1-43)
CPU Time:         0.001s (1130.8K cycles, 530.2K instructions, 2.13c/i)
Note:             Unresponsive for 11 seconds before sampling
Note:             3 idle work queue threads omitted

  Thread 0x17e1a    DispatchQueue "com.apple.main-thread"(1)    Thread name "CrBrowserMain"    43 samples (1-43)    priority 47 (base 47)    cpu time <0.001s (587.8K cycles, 194.9K instructions, 3.02c/i)
  <process frontmost, thread QoS user interactive (requested user interactive), process unclamped, IO tier 0>
  43  start + 2360 (dyld + 24800) [0x18c61d0e0] 1-43
    43  main + 1180 (anki + 24020) [0x102031dd4] 1-43
      43  std::sys_common::backtrace::__rust_begin_short_backtrace::h654a6c9cd5039fff + 12 (anki + 16396) [0x10203000c] 1-43
        43  anki::main::h6f7efa0d73b239c5 + 1500 (anki + 19024) [0x102030a50] 1-43
          43  Py_RunMain + 340 (anki + 2233500) [0x10224d49c] 1-43
            43  PyRun_SimpleStringFlags + 64 (anki + 4248284) [0x1024392dc] 1-43
              43  PyRun_StringFlags + 152 (anki + 4248504) [0x1024393b8] 1-43
                43  run_mod + 152 (anki + 4251228) [0x102439e5c] 1-43
                  43  PyEval_EvalCode + 80 (anki + 3907140) [0x1023e5e44] 1-43
                    43  _PyEval_EvalCode + 532 (anki + 3945260) [0x1023ef32c] 1-43
                      43  _PyEval_EvalFrameDefault + 20256 (anki + 3927656) [0x1023eae68] 1-43
                        43  _PyFunction_Vectorcall + 240 (anki + 2884872) [0x1022ec508] 1-43
                          43  _PyEval_EvalFrameDefault + 16432 (anki + 3923832) [0x1023e9f78] 1-43
                            43  _PyFunction_Vectorcall + 720 (anki + 2885352) [0x1022ec6e8] 1-43
                              43  _PyEval_EvalFrameDefault + 23972 (anki + 3931372) [0x1023ebcec] 1-43
                                43  _PyObject_MakeTpCall + 136 (anki + 2880608) [0x1022eb460] 1-43
                                  43  type_call + 316 (anki + 3288776) [0x10234eec8] 1-43
                                    43  slot_tp_init + 256 (anki + 3328160) [0x1023588a0] 1-43
                                      43  _PyObject_Call_Prepend + 160 (anki + 2885948) [0x1022ec93c] 1-43
                                        43  _PyFunction_Vectorcall + 412 (anki + 2885044) [0x1022ec5b4] 1-43

It may not reveal anything, but could you put the full file on somewhere like pastebin.com, then link to it here? Surround the link with backticks (eg http://foo.com) and you should be able to include it.

You may access the log here: https://www.dropbox.com/scl/fi/06qj9vqaw7s13jjx3ejg2/20240103-194619-anki-hang-report.txt?rlkey=3dezajgyiywxpvtlrty3flsd8&dl=0

Thanks for that. Unfortunately I didn’t spot anything that would identify why it is happening :frowning:. Does the same problem happen when running Anki from Python?

https://betas.ankiweb.net/#via-pypipip

I followed the Via PyPI/pip instructions for Mac. Anki does not run successfully. Using Python 3.12.1. Below is the result of running pyenv/bin/anki

macos_helper: dlopen(/Users/iota/pyenv/lib/python3.12/site-packages/_aqt/data/lib/libankihelper.dylib, 0x0006): tried: '/Users/iota/pyenv/lib/python3.12/site-packages/_aqt/data/lib/libankihelper.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/iota/pyenv/lib/python3.12/site-packages/_aqt/data/lib/libankihelper.dylib' (no such file), '/Users/iota/pyenv/lib/python3.12/site-packages/_aqt/data/lib/libankihelper.dylib' (no such file)
Preparing to run...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/iota/.pyenv/versions/3.12.1/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/Users/iota/pyenv/lib/python3.12/site-packages/aqt/mediasrv.py", line 103, in run
    self.server = create_server(
                  ^^^^^^^^^^^^^^
  File "/Users/iota/pyenv/lib/python3.12/site-packages/waitress/server.py", line 78, in create_server
    last_serv = TcpWSGIServer(
                ^^^^^^^^^^^^^^
  File "/Users/iota/pyenv/lib/python3.12/site-packages/waitress/server.py", line 244, in __init__
    self.bind_server_socket()
  File "/Users/iota/pyenv/lib/python3.12/site-packages/waitress/server.py", line 361, in bind_server_socket
    self.bind(sockaddr)
  File "/Users/iota/pyenv/lib/python3.12/site-packages/waitress/wasyncore.py", line 396, in bind
    return self.socket.bind(addr)
           ^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 49] Can't assign requested address

Anki tries to bind to 127.0.0.1:0, which should usually work fine. Maybe you have a firewall or something blocking Anki from creating the connection, or all ports on your system are already in use.

@dae Your mention of Ank trying to bind 127.0.0.1:0 gave me an idea that solved the issue. Sometime ago I had created a network service on Loopback in order to create an ad hoc peer-to-peer computer network.

Steps to resolve:

  1. At command line delete the service using networksetup -deletepppoeservice <service name>
  2. Delete Library/Application Support/Anki2
  3. Reboot
  4. Open Anki and follow setup

Thank you for all your help!

1 Like

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