Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

GUI versions of command line utilities failing

A while back mail searches only showed some of the expected results, then soon after most failed and canned searches failed. I found several suggestions on the web and followed them, namely:


  • rebooting (obviously!)
  • various incantations of mdutil to disable and enable indexing
  • removing the envelope* files in the MailData directory
  • System Preferences / Spotlight: removing and putting back Mail & Messages
  • rebooting in safe mode
  • rebooting in recovery mode and re-installing the OS


In each case mail searches failed. After re-installing the OS (10.13.6), a new problem started: the system fails to shut down or restart when invoked from the main apple menu.


I am now at a point where

  • mdfind works fine, searching for filenames and in messages
  • spotlight fails
  • “mdfind -interpret” (which is supposed to be the same as spotlight) works
  • Finder search fails to find files
  • Finder’s “Recents” isn’t being updated and has a list of files from 2020
  • from the Apple menu both “Restart” and “Shutdown” cause programs to exit, the screen to go grey with the mouse cursor positioned at the top left position; mouse movements work, key cause p beep sounds (and the system stays up)
  • in that situation I can ssh in from another local machine and “sudo halt” works fine
  • instead of trying to shutdown from the apple menu, from Terminal a “sudo halt” works fine


So it seems that basic command line programs mdutil, shutdown, halt work fine; but gui interfaces on them (Finder, Mail, Apple-Menu) fail.


Strange, eh? Any ideas?

iMac 27″, macOS 10.13

Posted on Jan 7, 2023 1:48 PM

Reply

Similar questions

12 replies

Jan 7, 2023 4:23 PM in response to Richard Sharman

Great...


See if you have unknown Profiles.

To remove a configuration profile in macOS:

  1. From the Apple menu, select System Preferences....
  2. From the View menu in System Preferences, select Profiles.Note:
  3. Profiles won't be visible until you have at least one profile installed.
  4. Select the profile you want to remove, and then press the - (minus) button. Click Remove to remove the profile.


I don't see hw this could bethe oroblembut it neds to go...


Delete this file & restart...

~/Library/LaunchAgents/homebrew.mxcl.mysql.plist


~ tilde indicates your home folder

Apple hid the Users' Library folders...


Method 1:

1 From the Finder, select the Go menu at top of the screen, and choose Go to Folder.

2 In the window that opens, enter ~/Library, and click Go.


Get rid of Flash Player while your at it

Jan 7, 2023 4:27 PM in response to Richard Sharman

If still not working...


Safe Boot, (holding Shift key down at startup), does the problem occur in Safe Mode? Could take 10 minutes.


Safe mode attempts to repair Disks & clears lots of caches & loads safe Drivers, & prevents loading of 3rd party extensions, so if Safe Mode works try again in regular boot.


Manually Rebuilding Spotlight via Terminal

If the aforementioned Spotlight control panel approach doesn’t spur a reindexation of the drive, you may need to initiate it manually through the command line. Open Terminal and use the following command string to do so:


sudo mdutil -E /

This basically asks for temporary super user status, which is why Terminal may ask you for your password (it may not if you’ve used a sudo command recently or are already logged in as a super user or root. The command asks the unix tool mdutil to reindex the spotlight database for everything on the computer, including external drives, mounted disk images, etc. To re-index only for a specific drive, use the /Volumes path. For example, for an external drive named “MiniMe,” the command would look like this:


sudo mdutil -i on /


Rebuilding a drive index can take a long time, so be prepared to wait whether you do it through the System Preference panel or the command line.


If still need be…


Open Terminal and run each of these one at a time


/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user


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


killall Dock


sudo mdutil -E /


sudo mdutil -i on /


Rebuilding a drive index can take a long time, so be prepared to wait whether you do it through the System Preference panel or the command line.

Jan 7, 2023 2:37 PM in response to Richard Sharman

Yeah, strange.


We need to see what all is running, a report from this will not display any personal info...


EtreCheck is a FREE simple little diagnostic tool to display the important details of your system configuration and allow you to copy that information to the Clipboard. It is meant to be used with Apple Support Communities to help people help you with your Mac. It will not display any personal info.

https://www.etrecheck.com/


Pastebin is a good place to paste the whole report if you capture the URL while there…

https://pastebin.com/


Workable but harder for me to work with...the Note tool on the bottom of this editor's toolbar, as shown in the image, to copy and paste the output from EtreCheck. In a Reply before you click post, look for this to add longer texts...

Jan 7, 2023 5:01 PM in response to BDAqua

I had one profile, a mail setup; I deleted it and that mail account has gone. I think I can re-create it manually.

I delete the mysql.plist file and removed Flash Player.

Rebooted [with ssh sudo reboot to make it work]. No obvious difference.

I tried another gui Reboot -- same as before. This time, when ssh'ing in before issuing the sudo reboot I did a ps auxww to see what was running. Output saved in https://pastebin.com/tek2YqvR in case it helps. I see that mysqld is running even though that mysql.plist file was removed.

Jan 7, 2023 6:19 PM in response to Richard Sharman

Mail searches are starting to work now... and Finder's "Recents" are being updated.

So presumably it was one of those 2 commands involving Frameworks ?

Can you explain what they did please?


(I will try rebooting later, but won't interrupt the index re-building now.)


Thank you so much, I spent a lot of time trying different things to no avail!


GUI versions of command line utilities failing

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