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

brew doctor error message: Error: pathname contains \0: #20712

Closed
nachbar opened this issue Jun 23, 2013 · 8 comments
Closed

brew doctor error message: Error: pathname contains \0: #20712

nachbar opened this issue Jun 23, 2013 · 8 comments

Comments

@nachbar
Copy link

nachbar commented Jun 23, 2013

I got the following error from brew doctor -- no change after brew update. I use rbenv to control my ruby version, and installed rbenv after installing homebrew (I used homebrew to install rbenv). Note that the trace includes the system ruby 1.9 I initially got the message when ruby 2 was my global version, but I get the same error if 1.9 or system are the global versions, and even if I reset my path to the default path, which results in using ruby version ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

Interestingly, brew install (as in brew install mongodb) works correctly and without complaint.

Warbler:~ nachbar$ echo $PATH
/usr/local/var/rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Output from brew doctor:
Warbler:~ nachbar$ brew doctor
Error: pathname contains \0: "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
Please report this bug:
https://github.com/mxcl/homebrew/wiki/troubleshooting
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:215:in initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:823:innew'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:823:in readlink' /usr/local/Library/Homebrew/extend/pathname.rb:254:inresolved_path_exists?'
/usr/local/Library/Homebrew/cmd/doctor.rb:191:in check_for_broken_symlinks' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:1024:infind'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/find.rb:39:in find' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/find.rb:38:incatch'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/find.rb:38:in find' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:1024:infind'
/usr/local/Library/Homebrew/cmd/doctor.rb:190:in check_for_broken_symlinks' /usr/local/Library/Homebrew/cmd/doctor.rb:189:ineach'
/usr/local/Library/Homebrew/cmd/doctor.rb:189:in check_for_broken_symlinks' /usr/local/Library/Homebrew/cmd/doctor.rb:1094:insend'
/usr/local/Library/Homebrew/cmd/doctor.rb:1094:in doctor' /usr/local/Library/Homebrew/cmd/doctor.rb:1093:ineach'
/usr/local/Library/Homebrew/cmd/doctor.rb:1093:in doctor' /usr/local/Library/brew.rb:95:insend'
/usr/local/Library/brew.rb:95

Warbler:~ nachbar$ brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: bb84a5a
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 24-core 64-bit arrandale
OS X: 10.8.4-x86_64
Xcode: 4.6.3
CLT: 4.6.0.0.1.1365549073
LLVM-GCC: build 2336
Clang: 4.2 build 425
X11: N/A
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/local/var/rbenv/shims/ruby

Warbler:~ nachbar$ rbenv versions
system
1.9.3-p327

  • 2.0.0-p195 (set by /usr/local/var/rbenv/version)
    jruby-1.7.4
    Warbler:~ nachbar$

Same result with ruby 1.9:

Warbler:~ nachbar$ rbenv global 1.9.3-p327
Warbler:~ nachbar$ brew doctor
Error: pathname contains \0: "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
Please report this bug:
https://github.com/mxcl/homebrew/wiki/troubleshooting
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:215:in initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:823:innew'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:823:in readlink' /usr/local/Library/Homebrew/extend/pathname.rb:254:inresolved_path_exists?'
/usr/local/Library/Homebrew/cmd/doctor.rb:191:in check_for_broken_symlinks' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:1024:infind'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/find.rb:39:in find' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/find.rb:38:incatch'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/find.rb:38:in find' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:1024:infind'
/usr/local/Library/Homebrew/cmd/doctor.rb:190:in check_for_broken_symlinks' /usr/local/Library/Homebrew/cmd/doctor.rb:189:ineach'
/usr/local/Library/Homebrew/cmd/doctor.rb:189:in check_for_broken_symlinks' /usr/local/Library/Homebrew/cmd/doctor.rb:1094:insend'
/usr/local/Library/Homebrew/cmd/doctor.rb:1094:in doctor' /usr/local/Library/Homebrew/cmd/doctor.rb:1093:ineach'
/usr/local/Library/Homebrew/cmd/doctor.rb:1093:in doctor' /usr/local/Library/brew.rb:95:insend'
/usr/local/Library/brew.rb:95
Warbler:~ nachbar$ rbenv versions
system

  • 1.9.3-p327 (set by /usr/local/var/rbenv/version)
    2.0.0-p195
    jruby-1.7.4
    Warbler:~ nachbar$
@adamv
Copy link
Contributor

adamv commented Jun 23, 2013

Note that changing your rbenv ruby doesn't have any affect on Homebrew, Homebrew always runs agains the system-provided Ruby 1.8.x.

@adamv
Copy link
Contributor

adamv commented Jun 23, 2013

It looks like there is a symlink somewhere in the prefix with a bogus name.

@adamv
Copy link
Contributor

adamv commented Jun 23, 2013

What the code is doing here is walking through Homebrew's cellar looking for dangling symlinks. In trying to resolve a symlink, a file has a bad name. This isn't related to your $PATH.

@mistydemeo
Copy link
Member

Looks like the same problem as #18257; what's your hard drive configuration?

@nachbar
Copy link
Author

nachbar commented Jun 23, 2013

Thanks for the info.

I listed the path (the output of echo $PATH) on about the tenth line above.

Hard drive config: I recently added a 4 TB hard drive, used SuperDuper to copy the contents of the pre-existing 1 TB boot drive to, and then made the new 4 TB hard drive the boot disk. I did not physically remove the 1 TB drive, and it is still mounted on a subdirectory of /Volumes. I added the 4 TB disk on June 15, and did not install homebrew until June 18, so homebrew only exists on the 4 TB disk.

If the problem is a bad symlink, how would I go about finding/fixing it?

@adamv
Copy link
Contributor

adamv commented Jun 26, 2013

If the filenames are very out of whack they might show up weird on the command line with ls, so walking through /usr/local looking for them might be an option.

@adamv
Copy link
Contributor

adamv commented Jun 26, 2013

See for instance #12906.

@bunnymatic
Copy link

I ran into this recently too. Somehow my freetype and libpng libraries were all messed up in the brew directories. For example, under /usr/local i found this

ll opt/freetype
lrwxr-xr-x  1 jon  admin  26 Aug 10 09:36 opt/freetype -> 9=17=?977==EAF=9;?9779799;

I'm not sure what screwed up my filesystem but i was able to use this little script to quickly identify things that needed help. If you uncomment the unlink line, do it with care.

#!/usr/bin/env ruby
require 'fileutils'
Dir.glob('./**/*').each do |f|
  if File.symlink?(f)
    `[ -L #{f} ] && [ -r #{f} ]`
    begin 
      #File.unlink(f) if $? != 0 
      puts f if $? != 0 
    rescue 
    end
  end
end

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants