X

Two Spotlight stories

Sometimes Spotlight gets gummed up. Two readers found ways to ungum it.

CNET staff
3 min read

By coincidence, two reports of Spotlight problems came in at the same time - one about Leopard, the other about Tiger.

Reader Randall, who seems to have held off on installing Leopard (not an unwise notion!), did finally install it, and returned to find that Spotlight was hogging the CPU and crashing:

Last night, I installed (via Archive & Install, preserve Users) Leopard onto my PBG4 1.5GHz laptop; I let the install finish as I trotted off to bed. This morning, I came into my office, with the fan going as fast as it ever does, CPU usage pegged at 100% (I use MenuMeters to monitor CPU usage in my menu bar), and messages similar to

ReportCrash[5076]: Formulating crash report for process mdworker[5075]
com.apple.launchd[1](0x10aa30.mdworker[5075]): Exited abnormally: Bus error

filling up my system.log file at a rate of once every few seconds. I finally used 'launchctl' to turn off SL until I figured out what was going on.

A friend suggested I used 'mdutil -as' and '-aE' to check things out and rebuild it, but I had to turn SL back on using 'launchctl load...' first. After I did that, I checked the SL status, and saw that NO indexing whatsoever had been done at all. Trying again a few seconds later, I noticed that indexing was enabled, and I was no longer getting any of those crash messages in my log. Everything seems to be working fine.

Simply turning SL off and back on again "fixed" whatever issue it was having before. Might be useful information for folks to know.

Randall then provides some Terminal voodoo for turning Spotlight off and on:

To turn Spotlight off:

% sudo launchctl unload /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

and to turn it back on:

% sudo launchctl load /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

To make these changes permanent [until you issue another command], add "-w" (without the quotes) after the unload|load word in the command; this writes out a "disabled" key in the plist (or removes it, in the case of 'load'), making the change persistent until you change it again.

There is, however, no need to talk directly to launchctl; instead, let Lingon do it for you! We really cannot recommend Lingon strongly enough, especially now that launchd is being so heavily used by the system for starting up processes. Please note that there are two current versions of Lingon; the one that works on Leopard (2.0.2) is Leopard-only. Just find com.apple.Spotlight in the System Agents list, and disable it (uncheck Enabled). Then enable it again.

Next, here's a story from a user who found that Spotlight was not finding anything after updated to 10.4.11:

After installing 10.4.11 on my MacBook Pro, Spotlight stopped working. It's not that it stopped responding, just that it would not return results. Using mdutil to reset it resulted in the message "could not set indexing status for volume", and deleting the plist had no effect. I even manually deleted the .Spotlight-V!00 directory and reinstalled the combo updater, both useless.

Here is the answer to help others avoid the hours I spent on this: There was a rogue directory in /tmp that was gumming up the works. It was called something like "mds" (unfortunately I didn't make a note to its exact name before deleting it) but, to be on the safe side, I removed everything from /tmp and restarted. Spotlight started indexing right away and has been fine since.

Resources

  • Lingon
  • More from Late-Breakers