异常现象

最近在使用 macOS 时遇到了非常诡异的问题,具体表现如下:

最令人头疼的是,系统层面并没有给出任何明确的错误提示框来指明到底是什么服务出了问题。

排查过程

起初,结合网上的资料和过往经验,我高度怀疑是网络或者代理导致的问题。为此,我花了不少时间排查网络设置,但并没有发现任何异常。

既然排除了网络原因,且图形界面没有任何有用的提示,只能求助于命令行,通过系统日志来抓取底层错误。因为怀疑是账号或认证相关的问题,我使用了 log stream 监听 akd (AuthKit 守护进程) 的相关日志:

log stream --info --predicate 'process == "akd" or message contains "AuthKit"'

通过实时查看系统日志,终于抓到了蛛丝马迹:日志中大量抛出了与 Keychain(钥匙串)相关的解锁失败和授权错误。具体的报错日志如下,可以看到 AuthKit credential is completely MIA!Code=-25308 (errSecInteractionNotAllowed) 等提示,明确指向了 Keychain 的读取/解锁问题:

2026-07-24 19:00:44.292583+0800 0x6f5f     Activity    0x44628              780    0    akd: (Accounts) accounts/accounts-with-type-with-options-sync
2026-07-24 19:00:44.292617+0800 0x6f5f     Default     0x446b1              780    14   akd: [com.apple.authkit:core] New Authentication Detected: <private>
2026-07-24 19:00:44.292626+0800 0x6f5f     Activity    0x44629              780    0    akd: (Accounts) accounts/accounts-with-type-with-options-sync
2026-07-24 19:00:44.292646+0800 0x6f5f     Activity    0x4462a              780    0    akd: (Accounts) accounts/accounts-with-type-with-options-sync
2026-07-24 19:00:44.292662+0800 0x6f5f     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Requesting clearance to begin auth with context <private>...
2026-07-24 19:00:44.293807+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Ignoring password cache
2026-07-24 19:00:44.293829+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Invoking traffic request with qos 25 for <private>
2026-07-24 19:00:44.293836+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Cleared to begin auth with context <private>!
2026-07-24 19:00:44.293841+0800 0x6dca     Activity    0x4462b              780    0    akd: (Accounts) accounts/accounts-with-type-with-options-sync
2026-07-24 19:00:44.293856+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Determining if interactive auth is required for context <private>...
2026-07-24 19:00:44.293861+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Has proxied anisette data: NO - Easy Sign In: NO - Long Distance Op: NO isInAgeMigrationFlow - NO isMagicFamilyJoinFlow - NO
2026-07-24 19:00:44.293868+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Sanitizing context...
2026-07-24 19:00:44.293872+0800 0x6dca     Activity    0x4462c              780    0    akd: (Accounts) accounts/accounts-with-type-with-options-sync
2026-07-24 19:00:44.294017+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] <private>: Validating authentication context (<private>)
2026-07-24 19:00:44.294081+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Current context permits passwordless auth.
2026-07-24 19:00:44.294097+0800 0x6dca     Activity    0x4462d              780    0    akd: (Accounts) accounts/accounts-with-type-with-options-sync
2026-07-24 19:00:44.294127+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Found an existing IDMS account <private>
2026-07-24 19:00:44.294139+0800 0x6dca     Default     0x446b1              780    14   akd: (AuthKit) [com.apple.authkit:core] Attempting to perform block in persona: (null)
2026-07-24 19:00:44.294147+0800 0x6dca     Default     0x446b1              780    14   akd: (AuthKit) [com.apple.authkit:core] No persona ID on account proceeding without setting context.
2026-07-24 19:00:44.294165+0800 0x6dca     Default     0x446b1              780    14   akd: (AuthKit) [com.apple.authkit:core] Performing block within persona Personal
2026-07-24 19:00:44.294174+0800 0x6dca     Activity    0x4462e              780    0    akd: (Accounts) accounts/credential-for-account
2026-07-24 19:00:44.298842+0800 0x6dca     Error       0x4462e              780    3    akd: (Accounts) [com.apple.accounts:core] "Error returned from daemon: Error Domain=com.apple.accounts Code=10 UserInfo={NSLocalizedDescription=<private>, NSUnderlyingError=0x9beee3e10 {Error Domain=com.apple.accounts.keychain Code=-25308}}"
2026-07-24 19:00:44.298868+0800 0x6dca     Default     0x446b1              780    14   akd: (AuthKit) [com.apple.authkit:core] Performed block within persona Personal
2026-07-24 19:00:44.298878+0800 0x6dca     Error       0x446b1              780    14   akd: (AuthKit) [com.apple.authkit:core] AuthKit credential is completely MIA! Account: <private>. Fetch error: Error Domain=com.apple.accounts Code=10 UserInfo={NSLocalizedDescription=<private>, NSUnderlyingError=0x9beee3e10 {Error Domain=com.apple.accounts.keychain Code=-25308}}
2026-07-24 19:00:44.298930+0800 0x6dca     Default     0x446b1              780    7    akd: (AAAFoundation) [com.apple.aaafoundation:analytics] <AAFAnalyticsReporter: 0x9bed18550> Sending event: [<private>] with transport: [<private>]
2026-07-24 19:00:44.298970+0800 0x6dca     Error       0x446b1              780    14   akd: [com.apple.authkit:core] We don't have a CK for <private> (Error: Error Domain=com.apple.accounts Code=10 UserInfo={NSLocalizedDescription=<private>, NSUnderlyingError=0x9beee3e10 {Error Domain=com.apple.accounts.keychain Code=-25308}}), so that's that.
2026-07-24 19:00:44.298979+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Canceling auth attempt because credential access is unavailable.
2026-07-24 19:00:44.299005+0800 0x6dca     Default     0x446b1              780    14   akd: [com.apple.authkit:core] Cleared to end auth with context <private>.
2026-07-24 19:00:44.299011+0800 0x6dca     Activity    0x4462f              780    0    akd: (Accounts) accounts/accounts-with-type-with-options-sync
2026-07-24 19:00:44.299069+0800 0x6dca     Default     0x446b1              780    7    akd: (AAAFoundation) [com.apple.aaafoundation:analytics] <AAFAnalyticsReporter: 0x9bed18550> Sending event: [<private>] with transport: [<private>]
2026-07-24 19:00:44.299727+0800 0x6dca     Default     0x0                  780    0    akd: (libxpc.dylib) [com.apple.xpc:connection] [0x9bed7c900] invalidated because the client process (pid 1473) either cancelled the connection or exited

根本原因

结合日志分析,我回忆起之前修改过系统密码。在正常情况下,修改系统密码会自动同步更新 Keychain 的密码。但这一次,系统可能卡在了某个同步环节,导致 Keychain 仍然在使用旧密码加密。

由于 Keychain 被锁住,所有依赖它获取凭证的系统服务(如 iCloud 认证)和应用(如腾讯会议、相册)自然就崩溃或无法正常工作了。

解决方案

定位到问题后,解决起来就比较简单了:当系统或应用需要访问 Keychain 时,系统其实是在尝试用新密码解锁,由于密码不匹配导致静默失败。最终,在触发 Keychain 验证的地方手动输入了系统旧密码,成功将 Keychain 解锁。

解锁后,所有异常的软件立刻恢复了正常,登录状态的问题也迎刃而解。

附上成功恢复后的截图:

成功结果