Mds and lsd going crazy

launch-servicesmdsspotlight

I have noticed big peaks of activity of processes:

  • mds
  • mds_stores
  • lsd
  • mdworker (multiple processes)

The console loops over two messages from mds:

  1. LaunchServices: Database mapping failed with result -10813, retries = X
  2. LaunchServices: storeXPCRepresentation or url (null) was nil -10813, retrying

I tried to reset Spotlight via mdutil, following https://apple.stackexchange.com/a/191503/204565. The first step kills the processes using the CPU, but after following all the steps, the problem came back (not only the CPU usage which would seem normal when reindexing the system, but the errors in the console failure messages too).

I saw https://discussions.apple.com/thread/8158217 but unlike him, my Time Machine saves seem to work.

My computer is a MacBook Pro mid-2012. I changed the HDD to a Samsung 850 EVO some time ago (more than 3 years).

I also noticed that the modification date of some folders doesn't make any sense.

At some point, I noticed failures of lsd:

  1. *** CSStore corruption detected (2). ffff6d74 54 4ce74318 3

I looked at the console during a backup and backupd shows the same messages as mds (1. and 2.)

Even after sudo mdutil -a -i off, which solves the CPU usage problem, symptomsd logs 1. and 2..

Best Answer

3 months later, I can confirm my comment.

I solved my problem by rebuilding Launch Services with Onyx.

Maintenance > Rebuilding > Launch Services