-
Notifications
You must be signed in to change notification settings - Fork 949
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
mo optimize crashes silently with exit code 1 during "App State Cleanup" when it encounters a .savedState directory that requires Full Disk Access permissions. Instead of skipping the protected directory and continuing, the script terminates.
Steps to reproduce
- Run command:
mo optimize - Script proceeds normally through "DNS & Spotlight Check" and "Finder Cache Refresh"
- Script crashes during "App State Cleanup" when encountering a permission-denied directory
Expected behavior
The script should gracefully skip directories it cannot access due to permission restrictions and continue with the remaining optimization tasks.
Debug logs
mo optimize --debugDebug output
[DEBUG] === App Saved State Cleanup ===
[DEBUG] Remove old application saved states
[DEBUG] Method: Find and remove .savedState folders older than 30 days
[DEBUG] Location: /Users/liamchalcroft/Library/Saved Application State
[DEBUG] Expected outcome: Reduced disk usage, apps start with clean state
[DEBUG] Risk Level: LOW, Old saved states, apps will create new ones
[2026-02-09 11:48:26] DEBUG: Removing: /Users/liamchalcroft/Library/Saved Application State/net.maxon.appinstaller.savedState
[2026-02-09 11:48:26] DEBUG: get_path_size_kb: Failed to get size for /Users/liamchalcroft/Library/Saved Application State/net.maxon.appinstaller.savedState (returned: )
[2026-02-09 11:48:26] DEBUG: Permission denied: /Users/liamchalcroft/Library/Saved Application State/net.maxon.appinstaller.savedState, may need Full Disk Access
Environment
Mole version 1.25.0
macOS: 26.2
Architecture: arm64
Kernel: 25.2.0
SIP: Enabled
Disk Free: 11Gi
Install: Homebrew
Shell: /bin/bash
Additional context
The safe_remove function appears to fail in a way that causes the set -e flag to terminate the script, rather than catching the error and continuing. The problematic directory is net.maxon.appinstaller.savedState which has restricted permissions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working