Mail search completely broken in Catalina - tried every trick on the Internet but to no avail

Hi all,

Got a curly one - macOS mail will not show ANY search entries. I've been able to get it intermittently while rebuilding or redownloading, but as the download completes, it breaks again. This seems to be the same as the issue experienced in another thread - https://discussions.apple.com/thread/250711804


So far, I've tried:

  • Disabling and re-enabling Spotlight indexing, both via the GUI and the command line
  • Rebuilding all mailboxes
  • Reindexing mailboxes (i.e. deleting Envelope files). Tried this several times and it corrupted some of my local stores, too.
  • Various iterations of loading Mail in safe mode (shift+open)
  • Checking for corrupt plists


There have been several reboots between trying the above. I've run out of options.


Whenever I rebuild the mailboxes, search works - partially, and temporarily. As more emails are downloaded, the search results become incomplete, and then hit zero. It's almost as if search works for all emails that are not downloaded.


The rest of Spotlight works fine


In system logs, when I perform searches, I do see some syslogs that look similar to:

error 01:55:07.225146+1000 corespotlightd <private>

error 01:55:07.225224+1000 corespotlightd ContentIndexDocSet_Step:1974: Caught mach exception

error 01:55:00.650105+1000 corespotlightd <private>

error 01:55:00.650199+1000 corespotlightd ContentIndexDocSet_PositionRead:2072: Caught mach exception

error 01:55:00.650461+1000 corespotlightd <private>

error 01:55:00.650525+1000 corespotlightd ContentIndexDocSet_PositionRead:2135: Caught mach exception


and:


default 01:31:23.211066+1000 corespotlightd Flush starting at 654449483.211059

default 01:31:24.054445+1000 corespotlightd Flush ending at 654449484.054438

default 01:31:25.104496+1000 corespotlightd copy file <private> to <private>

default 01:31:30.254679+1000 corespotlightd copy file <private> to <private>

default 01:31:30.257175+1000 corespotlightd copy file <private> to <private>

default 01:31:30.606148+1000 corespotlightd copy file <private> to <private>

default 01:31:31.508435+1000 corespotlightd (1903)Unlinked journal <private>

error 01:32:24.318372+1000 corespotlightd "Error returned from daemon: Error Domain=com.apple.accounts Code=9"

fault 01:32:24.318264+1000 accountsd Unentitled access by client 'corespotlightd' (selector: accountsWithAccountType:handler:)

error 01:32:24.320126+1000 corespotlightd "Error returned from daemon: Error Domain=com.apple.accounts Code=9"

fault 01:32:24.319925+1000 accountsd Unentitled access by client 'corespotlightd' (selector: accountsWithAccountType:handler:)


I suspect, but am not 100% convinced, that these are related, but I have been unsuccessful in googling for the above.


I am using the following accounts:

  • GMail personal
  • GMail Google Apps hosted
  • Self-hosted IMAP server (on a macOS server)
  • iCloud
  • Two cloud hosted IMAP servers
  • Local folders

I've tried disabling the GMail accounts but that didn't help, either. Entire mail store is around 600k messages, most of them on the GMail accounts.


Has anyone been able to resolve this issue? I've seen another thread that's had over 1700 people state ("I have this problem too") but no definitive solution. I first noticed this issue a few months ago, I think it may have been the result of a security update.


Any ideas on what I could try next that won't be destructive (i.e. without reinstalling, or removing the accounts which will permanently remove several settings related to the accounts)?


MacBook Pro

Posted on Oct 2, 2021 9:37 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 6, 2021 8:21 PM

Hi,


I may have solved the problem.


I had to disable indexing for all volumes, then remove the Spotlight database index files manually, then re-enable indexing which seems to have solved the issue. I resolved it as follows:


0. Ensured my Time Machine backups were up to date.

  1. Disable indexing:

sudo mdutil -a -i off /

2. Delete index files:

rm -rf ~username/Library/Metadata/CoreSpotlight (this was a 23GB directory)

rm -rf /System/Volumes/Data/.Spotlight-V100

3. Restarted/killed indexing services:

killall -KILL Spotlight spotlightd mds

4. Reboot system - I did a "sudo reboot" which may not be recommended.

5. Re-enabled indexing:

sudo mdutil -a -i on /

Waited a while.

6. Opened Mail. It didn't start working straight away, but became functional in around half an hour or so.


This may not keep working, and it's possible that there may be errors in the above.


When I conduct searches in Mail, I no longer see the Caught mach exception log messages in console and search is working as expected.

Similar questions

4 replies
Question marked as Top-ranking reply

Oct 6, 2021 8:21 PM in response to Old Toad

Hi,


I may have solved the problem.


I had to disable indexing for all volumes, then remove the Spotlight database index files manually, then re-enable indexing which seems to have solved the issue. I resolved it as follows:


0. Ensured my Time Machine backups were up to date.

  1. Disable indexing:

sudo mdutil -a -i off /

2. Delete index files:

rm -rf ~username/Library/Metadata/CoreSpotlight (this was a 23GB directory)

rm -rf /System/Volumes/Data/.Spotlight-V100

3. Restarted/killed indexing services:

killall -KILL Spotlight spotlightd mds

4. Reboot system - I did a "sudo reboot" which may not be recommended.

5. Re-enabled indexing:

sudo mdutil -a -i on /

Waited a while.

6. Opened Mail. It didn't start working straight away, but became functional in around half an hour or so.


This may not keep working, and it's possible that there may be errors in the above.


When I conduct searches in Mail, I no longer see the Caught mach exception log messages in console and search is working as expected.

Oct 2, 2021 10:06 AM in response to evilZardoz

Download and run Etrecheck. Etrecheck is a diagnostic tool that was developed by one of the most respected users here in the ASC and recommended by Apple Support  to provide a snapshot of the system and help identify the more obvious culprits that can adversely affect a Mac's performance.


IMPORTANT:

Before running Etrecheck assign Full Disk Access to Etrecheck in the Etrecheck's Privacy preference pane so that it can get additional information from the Console and log files for the report:


Also click and read the About info to further permit full disk access.



Copy the report



and use the Additional Text button to include the report in your reply.



Then we can examine the report and see if we can determine what might be causing the problem.


Oct 3, 2021 11:19 AM in response to evilZardoz

I don't see any of the usual suspects but do see a number of questionable items which may or may not affect the Mail search.


First, there is no reason to ever install or run any 3rd party "cleaning", "optimizing", "speed-up", anti-virus, VPN or security apps on your Mac.  This user tip describes what you need to know and do in order to protect your Mac: Effective defenses against malware and other threats - Apple Community.  


There are no known viruses, i.e. self propagating, for Macs.  There are, however, adware and malware which require the user to install although unwittingly most of the time thru sneaky links, etc.   


Anti Virus developers try to group all types as viruses into their ad campaigns of fear.  They do a poor job of the detecting and isolating the adware and malware.  Since there are no viruses these apps use up a lot of system resources searching for what is non-existent and adversely affect system and app performance.


There is one app, Malwarebytes, which was developed by a long time contributor to these forums and a highly respected member of the computer security community, that is desshoigned solely to seek out adware and known malware and remove it.  The free version is more than adequate for most users.  


Also, unless you're using a true VPN tunnel, such as between you and your employer's or bank's servers, they are useless from a privacy standpoint.  Read these two articles: Public VPN's are anything but private and Former Malware Distributor Kape Technologies Now Owns ExpressVPN, CyberGhost, Private Internet Access, Zenmate, and a Collection of VPN “Review” WebsitesThat being said one of the most respected contributors to these forums and a respected developer has said good things about NordVPN.  So it may be more secure than most of the other public VPNs.


Unless required by your employer, school or back I would uninstall any VPN software according to the developer's instructions.


Security Risk! - Adobe Flash Player installed!

You have Adobe Flash Player installed and it's a security risk. It was discontinued by Adobe at the first of this year. Uninstall.


Configuration Files:   /etc/hosts - Count: 3 - Corrupt!

The reports says that your Host file is corrupt/damaged. See if this user tip helps: Fixing a hacked /etc/hosts file - Apple Community


Since you've tried all of the possible fixes I'm aware of the next I would suggest is:


1 - make sure you have a current and full backup of your Data disc.

2 - boot into the Recovery volume (boot with the Command + R keys held down) and reinstall the system. It does not affect the user data.



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.

Mail search completely broken in Catalina - tried every trick on the Internet but to no avail

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