Stale auth-profiles.lock blocks all RPC calls — user stuck in error loop
Summary
A stale auth-profiles.lock file prevents the auth profile from being read, causing every RPC call (including app_state_snapshot) to fail. The lock is never cleaned up, so the user gets stuck in a rapid-fire error loop — 16 errors in 30 seconds from a single user.
Sentry Issues
- OPENHUMAN-TAURI-CM — 16 events (macOS, single user)
- OPENHUMAN-TAURI-CE — 1 event (Windows)
- OPENHUMAN-TAURI-CD — 1 event (Windows)
Error: Failed to create auth profile lock at <user_home>/.openhuman/users/<id>/auth-profiles.lock
Environment: production
Platforms: macOS (aarch64) + Windows (x86_64)
Analysis
- All 16 macOS events are from the same user within a 30-second window (06:37:03 → 06:37:33), fired every ~2 seconds by
app_state_snapshotpolling - The lock file from a previous crash or concurrent process is never cleaned up
- Every subsequent RPC call fails because it can't acquire the lock
- The app is effectively completely broken for this user until they manually delete the lock file
Suggested Fix
- Stale lock detection — check if the process that created the lock is still alive; if not, remove the stale lock
- Lock timeout — auto-expire locks older than N seconds
- Graceful degradation — if the lock can't be acquired for
app_state_snapshot, return cached/stale data instead of erroring - Crash cleanup — on startup, clean up any lock files left by a previous instance
Priority: High — completely blocks one user, cross-platform
Picking this up. Plan: write PID into the lock on acquire, then on subsequent acquires check whether that PID is still alive — if not, remove the stale file and retry. Also clean up any leftover lock on startup so a previous crash does not block the next run. Will keep the change scoped to the lock acquisition path and add Rust unit tests for the dead-PID / alive-PID / missing / malformed cases.