Zackriya-Solutions/meetily · warning · anyhow::Error
Failed to open System Settings: {}
Error message
Failed to open System Settings: {} What it means
request_screen_recording_permission (macOS only) spawns the system 'open' binary with a System Settings deep link to send the user to Privacy & Security. The error means Command::spawn itself failed - the child process could not be created. It does not mean Settings failed to open, and it says nothing about the permission state.
Source
Thrown at frontend/src-tauri/src/audio/permissions.rs:52
#[cfg(target_os = "macos")]
pub fn request_screen_recording_permission() -> Result<()> {
info!("🔐 Opening System Settings for Audio Capture permission...");
// Open System Settings to Privacy & Security page
// Note: There's no direct URL for Audio Capture, so we open the main Privacy page
let result = Command::new("open")
.arg("x-apple.systempreferences:com.apple.preference.security")
.spawn();
match result {
Ok(_) => {
info!("✅ Opened System Settings - navigate to Privacy & Security → Audio Capture");
info!("👉 Please enable Audio Capture permission and restart the app");
Ok(())
}
Err(e) => {
error!("❌ Failed to open System Settings: {}", e);
Err(anyhow::anyhow!("Failed to open System Settings: {}", e))
}
}
}
#[cfg(not(target_os = "macos"))]
pub fn request_screen_recording_permission() -> Result<()> {
Ok(()) // Not required on other platforms
}
/// Check and request Audio Capture permission if not granted
/// Returns true if permission is granted, false otherwise
pub fn ensure_screen_recording_permission() -> bool {
if check_screen_recording_permission() {
return true;
}
warn!("Audio Capture permission not granted - requesting...");
View on GitHub (pinned to 0281737d87)
Solutions
- Invoke open by absolute path: /usr/bin/open
- Launch the app from a normal login session (Finder or a terminal with the user's full environment)
- If spawn still fails, treat it as best-effort: show the user the manual path (System Settings > Privacy & Security) instead of erroring
Example fix
// before
let result = Command::new("open")
.arg("x-apple.systempreferences:com.apple.preference.security")
.spawn();
// after - absolute path survives stripped PATH environments
let result = Command::new("/usr/bin/open")
.arg("x-apple.systempreferences:com.apple.preference.security")
.spawn(); Defensive patterns
Strategy: fallback
Validate before calling
// Check the binary by absolute path before spawning
let open_path = if std::path::Path::new("/usr/bin/open").exists() {
"/usr/bin/open"
} else {
"open"
}; Try / catch
Treat spawn failure as best-effort: log warn!, then return Ok(()) after telling the user how to open System Settings manually (System Settings > Privacy & Security > Audio Capture). Never block the permission flow on this call.
Prevention
- Always spawn system tools by absolute path (/usr/bin/open) - GUI apps often inherit stripped PATH variables
- Keep permission-helper side effects non-fatal: failure to open Settings must not fail the permission request
- Provide the manual navigation path in UI copy as a standing fallback
When it happens
Trigger: The 'open' executable is not resolvable via PATH because the app was launched from a stripped environment (launchd, ssh session, some IDE runners); a sandbox or MDM policy blocks child-process creation; security software intercepts process spawning.
Common situations: App auto-started by a launcher daemon or run over ssh where PATH lacks /usr/bin; endpoint security blocking process creation; unusual macOS hardening configurations.
Related errors
- Failed to spawn ffmpeg process: {}
- Failed to get default input config: {}
- Failed to create Core Audio capture: {}
- Failed to create temporary WAV file: {}
- Failed to open audio file '{}': {}
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/b0c3748be96e41d9.
Report an issue: GitHub.