MacOS Spotlight Privacy List Error
When attempting to add a folder to the exclusion list in Spotlight in MacOS Catalina, the UI would return a “Privacy List Error.” After many maddening hours of troubleshooting and research. Here’s how I fixed it:
Boot into recovery mode and disable System Integrity Protection by opening the Terminal from the Utilities menu, and entering the following:
csrutil disable
Reboot (you can just type reboot into the terminal, and press enter to accomplish this
Login to your mac as an administrative user.
Open System preferences > Users & Groups
Click the lock icon at the bottom of the screen to unlock the settings.
Click Login Options > Join (Beside Network Account Server) > Open Directory Utility…
In Directory Utility, click the lock icon at the bottom of the screen to unlock the settings.
In the Directory Utility menu at the top of the screen, click Edit > Enable Root User and give it a password you will remember.
Close Directory Utility and System Preferences.
Open Terminal
Disable the Spotlight daemon by running
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Use your own password for sudo commands
Disable Spotlight indexing by running
sudo mdutil -a -i off
Become the root user by running
su
Enter the password you just made for the root user
Delete the Spotlight index by running
rm -rf /System/Volumes/Data/.Spotlight-V100
Quit su by running
exit
Enable the Spotlight daemon by running
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Enable Spotlight indexing by running
sudo mdutil -a -i on
Reindex all volumes by running
sudo mdutil -aE
Go back into Directory Utility and disable the root user from the same menu where you enabled the root user.
When indexing is complete, reboot into recovery mode, open the terminal and run the following to enable System Integrity Protection.
csrutil enable