1

tl;dr (10 January 2022): Spotlight can no longer find any files except applications. It's been using a lot of %CPU for days to reindex but has not made any progress.

tl;dr (2 March 2022): To my horror, the problem persists after wiping my disk and reinstalling macOS from scratch. This time, Spotlight is not using much %CPU.

10 January 2022

See "2 March 2022" section below for more up-to-date info

I use a MacBook Pro Retina (13-inch, Mid 2014) running macOS Big Sur 11.6.2. [2 March 2022 update: macOS 11.6.4] 256 GB SSD, 8GB RAM. 2 cores @ 2.8GHz.

Spotlight has stopped being able to find any files except applications. Spotlight is just indexing forever. My battery drains much faster from all the reindexing (mdsync typically uses between 20% and 80% of my CPU according to Activity Monitor). [2 March 2022 update: mdsync no longer appears to be working at all] I have left the indexing run for 48 hours and there was no progress whatsoever. It still couldn't find files sitting on the desktop.

enter image description here

Here's what I've tried, among many others:

  1. Rebuilding the spotlight index using Apple's official method (https://support.apple.com/en-us/HT201716). This involves adding the home folder to the Privacy exclusion list in System Preferences → Privacy.
  2. Rebuilding Spotlight with the terminal (method 1 here https://www.makeuseof.com/tag/cant-find-mac-apps-spotlight-fix/).
  3. The method described in this question (Spotlight re-indexing takes too long or doesn't work), which kills the Launch Services Database.
  4. sudo rm -R .Spotlight-V100/ (returns rm: .Spotlight-V100/: No such file or directory).
  5. sudo mdutil -E / and sudo mdutil -s / (returns Indexing enabled with no improvement).

Apart from the above, most command line solutions I have tried returns some kind of error, regardless of whether I use sudo or not.

How can I get Spotlight working again?


2 March 2022

tl;dr: The problem persists after wiping my disk and reinstalling macOS from scratch!

A few days (at some point between 15 and 30 January) after the above post (10 January), Spotlight randomly started working again. Perhaps it started working when I updated from macOS 11.6.2 to 11.6.3 although I cannot confirm this. It then worked fine until 24 February when I updated from 11.6.3 to 11.6.4. At this point, the problem described above resurfaced in the exact same form: One morning Spotlight could find any file on my system. Then a few hours later it could not find anything except applications.

After spending hours and hours in vain trying to solve the problem, I decided to reinstall macOS. To solve the problem once and for all, I did a "clean" reinstall: I put my important files on an external drive, I wiped my Macbook's SSD, and I reinstalled macOS 11.6.4 on the empty SSD.

I then added back about 70 GB of important files that I had backed-up. About 30GB of these are PDF files with textual data. I absolutely need these 30GB of data indexed by Spotlight in order to be able to work. But now, two days after the reinstall, Spotlight can't find any PDF file (except sometimes for "ENERGY STAR.pdf", which is a file that it could also find back in January when the problem first arose):

enter image description here

I have not run any terminal commands since I reinstalled macOS except for a few to try to view the status of the indexing. I have not run any commands that could have modified or damaged the index or the indexing process.

I don't know of any way of knowing whether Spotlight is actually indexing or just pretending to index without making any actual progress. From the activity monitor, it looks like Spotlight's "mdworkers" are doing very little work (but not zero):

enter image description here

Something that may be related is that in Console.app → system.log, I get thousands of messages like this:

Mar  2 12:42:06 MacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.01000000-0000-0000-0000-000000000000[45791]): Service exited due to SIGKILL | sent by mds[45785]
Mar  2 12:42:14 MacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.03000000-0000-0000-0000-000000000000[45792]): Service exited due to SIGKILL | sent by mds[45785]
Mar  2 12:42:14 MacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.01000000-0100-0000-0000-000000000000[45804]): Service exited due to SIGKILL | sent by mds[45785]
Mar  2 12:42:14 MacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.06000000-0000-0000-0000-000000000000[45797]): Service exited due to SIGKILL | sent by mds[45785]

A strange observation

2 March 2022

I've actually found a way to get Spotlight to work very briefly on particular folders, see screenshots below.

enter image description here

enter image description here

enter image description here

How can I get Spotlight working again? This is driving me nuts!


Added 4 March 2022 Here is the output of mdimport -L as requested by @Gilby:

user@MacBook-Pro ~ % mdimport -L

Paths: id(501) ( "/System/Library/Spotlight/SystemPrefs.mdimporter", "/System/Library/Spotlight/Chat.mdimporter", "/System/Library/Spotlight/iWork.mdimporter", "/System/Library/Spotlight/iPhoto.mdimporter", "/System/Library/Spotlight/PDF.mdimporter", "/System/Library/Spotlight/RichText.mdimporter", "/System/Library/Spotlight/Office.mdimporter", "/System/Library/Spotlight/PS.mdimporter", "/System/Library/Spotlight/MIDI.mdimporter", "/System/Library/Spotlight/Archives.mdimporter", "/System/Library/Spotlight/Audio.mdimporter", "/System/Library/Spotlight/iPhoto8.mdimporter", "/System/Library/Spotlight/Automator.mdimporter", "/System/Library/Spotlight/Application.mdimporter", "/System/Library/Spotlight/Font.mdimporter", "/System/Library/Spotlight/Mail.mdimporter", "/System/Library/Spotlight/QuartzComposer.mdimporter", "/System/Library/Spotlight/vCard.mdimporter", "/System/Library/Spotlight/Image.mdimporter", "/System/Library/Spotlight/iCal.mdimporter", "/System/Library/Spotlight/CoreMedia.mdimporter", "/Library/Spotlight/iBooksAuthor.mdimporter" )

  • When you did a "clean install", did you recover apps and settings from backup or did you reinstall or something else? 2. What is the output of mdimport -L which lists all spotlight importers.
  • – Gilby Mar 04 '22 at 03:15
  • @Gilby Thanks for your help. 1. Before reinstalling the OS I copied all the .app files of my Applications folder to an external drive. I also went into a few specific applications to export the settings profiles. Finally, in a single application (which was first installed after the Spotlight problem first surfaced) I also copied a .plist file. After wiping the disk and reinstalling the OS, I pasted the apps into my new Applications folder. I reinstalled the settings in most apps manually and in the others by importing the profiles I had exported. 2. I added this to the end of the main post – Pertinax Mar 04 '22 at 15:33
  • That rules out it being caused by rogue importer. mdimport -L on my Mac shows about 20 3rd party importers. – Gilby Mar 04 '22 at 22:37
  • @Gilby Just so I'm sure I'm following you: A rogue importer would be a 3rd party importer that's misbehaving, but you're ruling that out because there are no 3rd party importers in the mdimport -L output, correct? Is there a possibility that Spotlight is actually working this time, but it just needs a giant amount of time to index my very large number of PDF files? – Pertinax Mar 05 '22 at 15:47
  • 1
    Yes, I had been thinking the indexer might be getting stuck due to a faulty 3rd-party importer. Regarding time it takes: best to leave overnight (the less activity by you the faster the index). – Gilby Mar 05 '22 at 21:53
  • I have exactly the same problem (up to date Monterey) and did all those steps as well. I tested it with pdf and also saw this "ENERGY STAR.pdf" myself and nothing else. It resides in Utilities folder which comes by OS. – nurp Jun 01 '22 at 07:11
  • @nurp My sympathies. How old is your Macbook? Are you often near the maximum capacity of your harddrive? I've had my MBP for 7.5 years and I had often kept it with only a few GBs of free space. I learned that the Solid State Drive wears down more quickly when you don't have much space left. So this may be the early signs of disk failure (especially if your computer is old). Also I see that you're in Switzerland. I bought my MBP when I was living in Switzerland (January 2015). Probably a coincidence, but maybe not? – Pertinax Jun 01 '22 at 21:38
  • @Pertinax, mine is also from 2015, so strange coincidence! Indeed, I had disk space running out around the time this problem started. Now I have 100 GB free space but it didn't matter. I will run First Aid within Disk Utility app. Thanks for the hint. – nurp Jun 02 '22 at 10:56