LaunchServices database mapping error while trying to rebuild Spotlight index

Hi,


This is a followup to this closed thread:


https://discussions.apple.com/thread/8151912?login=true


Spotlight stopped finding things in the recent days. The date of the .spotlight-v100 file was very old (August, four months ago), and this is probably when the issue started to appear, preventing it from adding new items to the search.


I have used Cocktail to force rebuilding of the LaunchServices database, and after the reboot of the Spotlight database. I also added and removed the main drive from the Spotlight preferences.


However, Spotlight continues not to work (both in the Finder and in Mail). The Console continues to give me these repeated error messages:


error	12:13:24.566946 +0100	mds	LaunchServices: store or url (null) was nil -10813, retrying
error	12:13:24.566993 +0100	mds	LaunchServices: Database mapping failed with result -10813, retries = 3


I've no clue on what to do. I followed a lot of hints from the web, with the only result that I had to reformat my main drive and reinstall a backup. I can't seem to find a way to solve this issue. Any idea?


Paolo



Mac Pro

Posted on Dec 17, 2020 3:19 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 22, 2020 3:42 AM

A first success: the "LaunchServices database mapping error while trying to rebuild Spotlight index" message seems to have gone. The issue seems to have been caused by the lack of the /private/var/db/lsd directory. Oddly, none of the Terminal commands of the utilities could create it. I don't know why it was missing.


I followed the instructions found in these two pages:


https://discussions.apple.com/thread/7270354


https://helmschrott.de/blog/launchservices-database-mapping-failed


The commands in this latter seem to have solved the issue:


  1. sudo mkdir /private/var/db/lsd
  2. sudo /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -seed -lint -r -f -v -dump -domain local -domain system -domain user -domain network


At the moment, md* is working hard. The error messages are not showing. Mail is populating the smart folders. Let's see if it is indexing.


Paolo


27 replies
Question marked as Top-ranking reply

Dec 22, 2020 3:42 AM in response to PaoloT.

A first success: the "LaunchServices database mapping error while trying to rebuild Spotlight index" message seems to have gone. The issue seems to have been caused by the lack of the /private/var/db/lsd directory. Oddly, none of the Terminal commands of the utilities could create it. I don't know why it was missing.


I followed the instructions found in these two pages:


https://discussions.apple.com/thread/7270354


https://helmschrott.de/blog/launchservices-database-mapping-failed


The commands in this latter seem to have solved the issue:


  1. sudo mkdir /private/var/db/lsd
  2. sudo /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -seed -lint -r -f -v -dump -domain local -domain system -domain user -domain network


At the moment, md* is working hard. The error messages are not showing. Mail is populating the smart folders. Let's see if it is indexing.


Paolo


Dec 21, 2020 2:14 PM in response to PaoloT.

Sort of an answer to myself on this point: I removed an external drive containing MacOS from the Privacy list, and Spotlight immediately started showing its results. Apps appear as 'Packages' there also. Maybe this is it should be.


More apps are slowly appearing in the Spotlight search. Maybe it is just extremely slow in rebuilding its index. Let's wait and see.


Paolo


Dec 18, 2020 7:24 AM in response to BDAqua

BDAqua, and now things go even more complicate. I've left the Mac turned on to complete the work, and now all the mds* tasks are 0% or next to it.


I've tried repeating my search on "App Store". Now, all I get is a couple email messages in the "Show all in the Finder". What it had found earlier is now gone. And it is no longer searching hard.


I've tried to read the spindump and sampling of the mds* tasks, and there are those two errors I reported in the first post. Nothing that can help me understand what is going wrong.


Yes, the error '-10813' should mean that there are no matching data of a particular type. What does it mean? Is there some metadata missing? How can I know it? How can I fix it, if all that was suggested for years in the web is not working in my case?


Paolo


Dec 18, 2020 4:02 AM in response to PaoloT.

Something that I must add is that association of documents with apps seems to work fine. If I right-click a document and choose "Open with…", I get a list of the apps that can really open it. It seems that the LaunchServices database is actually working.


But, despite the heavy work, the mds tasks are not rebuilding my Spotlight index.


Paolo


Dec 18, 2020 1:46 PM in response to BDAqua

Something else I noticed: when an app is found, the search result window in the Finder says that it is of 'Package' type. If I ask information on that file, I see that it appears as an 'Application'.


Why this difference between the search result window and what the Finder Info floating window says? Is it as it should, or is there an error somewhere?


Paolo


Dec 19, 2020 3:57 PM in response to PaoloT.

I would kindly ask my fellow forum members if Spotlight, on their Mac, is showing the apps type as 'Package' or 'Application'. I'm still not convinced it is not the latter.


The way it is in my Mac, the few apps that are found appear in the Documents section, and I'm sure they should be in a separate Applications section.


I must add that I'm now working with High Sierra and the Security Updated 2020-005 and 006 reinstalled. So, my system (and its metadata references) should be quite clean. I've also erased the LaunchServices and Spotlight databases before reinstalling the system.


Paolo


Dec 19, 2020 4:57 PM in response to BDAqua

Thank you for checking, BDAqua! Yes, I have 'Applications' checked in Spotlight's Preferences.


For the moment, I would be inclined to exclude a hardware problem with the internal drive (and SSD). First, Disk Utility, EtreCheckPro and Apple's own Diagnostic Tool are not reporting anything wrong.


Then, I did reformat the main partition (not the Recovery one) just a couple days ago. Would this be enough to let the SSD driver and system check if something is wrong with it?


Applications are shown as such in the Finder's Info window. Devon EasyFind also shows them as Applications (app). It's just in the Spotlight search results window that they appear as 'Packages'.


When rebuilding the LaunchServices database from the Terminal, something went fine and something went wrong. Some .plist items didn't register (successful were those relative to the system and local domains; unsuccessful those relative to the user and network domains, and I seem to remember another one).


Unfortunately, I can no longer find the logs referring to that event. I suspect, in any case, some problems with those files. To know what happened, I fear I have to rebuild the LaunchServices database again.


Paolo


Dec 20, 2020 6:31 AM in response to PaoloT.

An additional information: while rebuilding the LaunchServices database via the Terminal's lsregister task, a "-10811" error can populate the report. There is no need to worry, because this just reports the non-app files in the directories and packages. By looking at the log, 'app' files seem to register correctly.


Paolo


Dec 20, 2020 1:04 PM in response to PaoloT.

Missing link from the previous post:


https://eclecticlight.co/2019/08/02/spotlight-search-can-skip-files/


BDAqua, I suspect that the Finder's Find function is not relying on Spotlight, but on an alternative search system. Not sure, however. I could be supported in this by the fact that the menus to select the type of data are not available in the Spotlight search result window that can be opened in the Finder.


Paolo


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

LaunchServices database mapping error while trying to rebuild Spotlight index

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.