Spotlight broken after sleep
Most of the time after my iMac sleeps and wakes spotlight does not work properly. It will find applications and system files but not anything in my user directory. I have tried the instructions in this support document and they don't fix it. The terminal commands described here work temporarily (until the next sleep) but the output in my terminal does not match what that site shows in their instructions and shows several errors. (I have also deleted the spotlight preferences file and that only helps until the next sleep). I am hoping the errors in the terminal output below will help diagnose the issue.
My terminal looks like this:
username:~ username$ sudo -i
Password:
username:~ root# mdutil -Ea
/:
Indexing enabled.
/System/Volumes/Data:
Indexing enabled.
/System/Volumes/Preboot:
Error: unknown indexing state.
username:~ root# mdutil -ai off
/:
2023-02-27 10:21:37.626 mdutil[6944:110848] mdutil disabling Spotlight: / -> kMDConfigSearchLevelFSSearchOnly
Indexing disabled.
/System/Volumes/Data:
2023-02-27 10:21:38.717 mdutil[6944:110848] Volume /System/Volumes/Data is transitioning, waiting 5 seconds (try 1 of 15)
2023-02-27 10:21:43.723 mdutil[6944:110848] mdutil disabling Spotlight: /System/Volumes/Data -> kMDConfigSearchLevelFSSearchOnly
Indexing disabled.
/System/Volumes/Preboot:
Error: invalid operation.
Error: unknown indexing state.
username:~ root# mdutil -ai on
/:
Indexing enabled.
/System/Volumes/Data:
Indexing enabled.
/System/Volumes/Preboot:
Error: invalid operation.
Error: unknown indexing state.
username:~ root#
I had this problem under Monterrey (when I got the computer) and upgrading to Ventura did not solve it.
iMac