Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

brew doctor hangs at mdfind #16964

Closed
deepfriedmind opened this issue Jan 9, 2013 · 11 comments
Closed

brew doctor hangs at mdfind #16964

deepfriedmind opened this issue Jan 9, 2013 · 11 comments

Comments

@deepfriedmind
Copy link

Running homebrew 0.9.3 on Mountain Lion. I have Xcode 4.5.2 and the latest command line tools installed. Everything homebrew-related seems to be running fine, except brew doctor which hangs indefinitely with the Terminal window showing "mdfind" in the title bar.

@jacknagel
Copy link
Contributor

Can you narrow it down to which check is hanging? You can list them all with --list-checks and run them individually with brew doctor check_...

It's probably one that deals with Xcode or XQuartz.

@deepfriedmind
Copy link
Author

Thanks for your reply. I started running the checks manually and it failed on check_for_latest_xquartz. I downloaded and installed XQuartz 2.7.4 then rebooted, but it still fails.

@jacknagel
Copy link
Contributor

Does it hang in brew irb as well?

$ brew irb
==> Interactive Homebrew Shell
Example commands available with: brew irb --help
[1] 1.8.7 brew(main)> MacOS.app_with_bundle_id(MacOS::XQuartz::FORGE_BUNDLE_ID)
=> #<Pathname:/Applications/Utilities/XQuartz.app>

How about if you just run

$ /usr/bin/mdfind "kMDItemCFBundleIdentifier == 'org.macosforge.xquartz.X11'"

from the command line?

@deepfriedmind
Copy link
Author

I can run brew irb fine but I'm not sure what I'm supposed to do there.

If I run

/usr/bin/mdfind "kMDItemCFBundleIdentifier == 'org.macosforge.xquartz.X11'"

it shows /Applications/Utilities/XQuartz.app then hangs.

@deepfriedmind
Copy link
Author

I've tried the rest of the checks now and it also hangs on check_for_linked_keg_only_brews

Then I get this on check_user_path_2:

Warning: Homebrew's bin was not found in your path.
Consider amending your PATH variable so it contains:
/usr/local/bin

(check_user_path_1 and check_user_path_3 are fine)

@jacknagel
Copy link
Contributor

check_for_linked_keg_only_brews might not be hanging, it just takes a really long time.

As far as mdfind hanging, well, I don't really know what to suggest; it shouldn't do that.

Any output prefixed with "Warning" is standard doctor output, and usually you should do what it suggests.

@deepfriedmind
Copy link
Author

Ok, I'll let check_for_linked_keg_only_brews run for a while and see if it finishes.

I'm not really sure what "path_2" is.

My path looks like this:
export PATH="/usr/local/share/npm/bin:/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
is there something wrong with it?

@jacknagel
Copy link
Contributor

Oh, ignore it; check_user_path_2/3 depend on check_user_path_1 having been run first, but that doesn't happen when running the checks individually. In the context of a full brew doctor it won't warn.

@deepfriedmind
Copy link
Author

Here's a progress update.

 ~: brew update
Updated Homebrew from 1d8f01d8 to 0801a86b.
==> Updated Formulae
gdal        leiningen   metasploit  python      rbenv-bundler   ruby-build  scm-manager subversion  z
gource      libnet      mongodb     rbenv       rbenv-gemset    sbt     sqlite      youtube-dl
 ~: brew doctor
Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link f` will cause other formulae to detect them during the
`./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:

    sqlite
 ~: brew unlink sqlite
Unlinking /usr/local/Cellar/sqlite/3.7.15... 9 links removed
 ~: brew doctor
Your system is raring to brew.

Working fine now.

@PacoH
Copy link

PacoH commented Feb 10, 2014

This is by far the most useful thread on this very frustrating topic. I tried everything above and found that brew doctor hung on:

check_for_autoconf (kill mdfind 2x)
check_for_latest_xquartz (kill mdfind 2x)
check_for_linked_keg_only_brews (kill mdfind 4x)
check_for_osx_gcc_installer (kill mdfind 2x)
check_for_stray_developer_directory (kill mdfind 2x)
check_missing_deps (kill mdfind 2x)
check_standard_compilers (kill mdfind 1x)

Note that killing mdfind multiple times at least allows brew doctor to continue but that is not a solution.

When brew doctor finally completed, I noticed one warning:

check_user_path_2
Warning: Homebrew's bin was not found in your PATH.
Consider setting the PATH for example like so
    echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile

This added export PATH=/usr/local/bin:$PATH to ~/.bash_profile.
This was also at the beginning of ~/.bash_profile and twice at the end so I deleted all but the last statement. Opening a new terminal window, now /usr/local/bin is at the beginning of my path instead of in the middle.

Now brew doctor runs without hanging!

@ZevEisenberg
Copy link

I am seeing a similar mdfind hang when running brew upgrade $(brew outdated).

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants