Homebrew / brew

๐Ÿบ The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.53k stars 9.77k forks source link

/usr/local/Homebrew migration tracking issue #987

Closed MikeMcQuaid closed 8 years ago

MikeMcQuaid commented 8 years ago

If you were directed to report your errors here by brew update please post a comment if your error is different to a previously mentioned comment and otherwise "Subscribe" to this issue rather than posting ๐Ÿ‘ or "me too" etc.

Thanks and sorry for the inconvenience.

flokru commented 8 years ago

I am getting

$ brew update
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: Couldn't find remote ref refs/heads/master
Error: Fetching /usr/local/Library/Taps/flokru/homebrew-self failed!

Don't know if this is relevant for this issue. I was recently updating brew which went fine, afterwards I got the git error message above while running brew upgrade on packages. The latter failed as it told me the package was not properly linked (brew doctor noticed the same). After linking, the upgrade worked. Now brew update is stuck as noticed above.

zmwangx commented 8 years ago

@flokru It's not related because we haven't even started the migration (#963) yet.

Re linking problem:

$ brew unlink $(brew ls)
$ brew link $(brew ls)

As for the update problem, could you

$ brew untap flokru/self
$ brew tap flokru/self

and see if that helps?

flokru commented 8 years ago

Thanks, that helps. Actually my tap at https://github.com/flokru/homebrew-self is empty. I don't know when and why it got in there (nor what I was trying to accomplish while foolishly adding it in the past). Not tapping it after untapping helps. Sorry for the noise.

Cynlic commented 8 years ago

Edit: It's fixed with cd /usr/local; git fetch; git reset --hard origin/master set of commands, even though it didn't work the first time I tried it. Shrug

Hello, I'm not really a super literate brew user so I'm not sure how to address this but I think this is a similar error. It seems that brew link/brew unlink and brew doctor also produce the same error.

$ brew update 
Error: No such file or directory - (../../../Cellar/autoconf/2.69, /usr/local/var/homebrew/linked/autoconf)
MikeMcQuaid commented 8 years ago

@Cynlic Run brew update twice and that should fix it.

justinclift commented 8 years ago

Posting this (new) error message here, for general awareness:

$ brew install ansible
==> Auto-updated Homebrew!
Updated Homebrew from 5654100 to f4a8d28.
Updated 1 tap (homebrew/core).
==> Updated Formulae
ponyc

==> Migrating HOMEBREW_REPOSITORY (please wait)...
share/man/man1/brew-cask.1: needs merge
share/man/man1/brew-cask.1: needs merge
share/man/man1/brew-cask.1: unmerged (483feec5ebfefa746c6f36d40a69965c56807986)
share/man/man1/brew-cask.1: unmerged (dd2bc133c7dccf4a7a1e7fc9960c61e3c60ae570)
fatal: git-write-tree: error building trees
Cannot save the current index state
Error: Failure while executing: git -c user.email=brew-update@localhost -c user.name=brew\ update stash save --include-untracked
Failed to migrate HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Please comment with your (new) error in issue:
  https://github.com/Homebrew/brew/issues/987
/usr/local/Library/Homebrew/utils.rb:367:in `safe_system'
/usr/local/Library/Homebrew/cmd/update-report.rb:211:in `block in migrate_legacy_repository_if_necessary'
/usr/local/Library/Homebrew/extend/pathname.rb:328:in `block in cd'
/usr/local/Library/Homebrew/extend/pathname.rb:328:in `chdir'
/usr/local/Library/Homebrew/extend/pathname.rb:328:in `cd'
/usr/local/Library/Homebrew/cmd/update-report.rb:210:in `migrate_legacy_repository_if_necessary'
/usr/local/Library/Homebrew/cmd/update-report.rb:103:in `update_report'
/usr/local/Library/Homebrew/brew.rb:99:in `<main>'
==> Installing dependencies for ansible: libyaml
==> Installing ansible dependency: libyaml
==> Downloading https://homebrew.bintray.com/bottles/libyaml-0.1.6_1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libyaml-0.1.6_1.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/libyaml/0.1.6_1: 8 files, 312.9K
==> Installing ansible
==> Downloading https://homebrew.bintray.com/bottles/ansible-2.1.1.0.el_capitan.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring ansible-2.1.1.0.el_capitan.bottle.1.tar.gz
๐Ÿบ  /usr/local/Cellar/ansible/2.1.1.0: 9,928 files, 99.3M

The list of installed Homebrew packages at the time of the error isn't large:

$ brew list
ansible     cmake       libyaml     openssl     sqlcipher   xz

Things still seem to be working. eg brew list works, as did both brew remove and brew doctor (without warnings) afterwards.

The error message itself though is kind of concerning. :wink:

rodrigues commented 8 years ago

Getting this problem also on the build of PR https://github.com/Homebrew/homebrew-core/pull/4945, sierra passed, elcapitan and yosemite failed with same problem:

[el_capitan] $ /bin/sh -xe /var/folders/03/jqjv4qms2b18_hwt2dcgsghc0000gp/T/hudson8974165171645172947.sh
+ env
+ grep JENKINS
+ grep -iv cookie
JENKINS_HOME=/Users/brew/Jenkins
JENKINS_URL=https://bot.brew.sh/
+ GIT_WORK_TREE=/usr/local
+ GIT_DIR=/usr/local/.git
+ git reset --hard origin/master
HEAD is now at 59b7f16 Merge pull request #989 from MikeMcQuaid/rubocop-final
+ brew update
Updated Homebrew from 59b7f16 to e204679.
No changes to formulae.
==> Migrating HOMEBREW_REPOSITORY (please wait)...
Error: No such file or directory - (../Homebrew/bin/brew, /usr/local/bin/brew)
Failed to migrate HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Please comment with your (new) error in issue:
  https://github.com/Homebrew/brew/issues/987
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:349:in `symlink'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:349:in `block in ln_s'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1574:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:347:in `ln_s'
/usr/local/Library/Homebrew/cmd/update-report.rb:260:in `migrate_legacy_repository_if_necessary'
/usr/local/Library/Homebrew/cmd/update-report.rb:103:in `update_report'
/usr/local/Library/Homebrew/brew.rb:99:in `<main>'
Build step 'Execute shell' marked build as failure
Recording test results
ERROR: Step โ€˜Publish JUnit test result reportโ€™ failed: No test report files were found. Configuration error?
Archiving artifacts
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in  7 second
[WS-CLEANUP] Deleting project workspace...[WS-CLEANUP] done
Finished: FAILURE
MikeMcQuaid commented 8 years ago

@rodrigues You can ignore that, it's been addressed, thanks.

MikeMcQuaid commented 8 years ago

@justinclift You need to resolve the Git conflicts/merges in your repository.

justinclift commented 8 years ago

@MikeMcQuaid You mean nuke my local branches?

justinclift commented 8 years ago

@MikeMcQuaid I'm trying to figure out what the conflicts/merges are about.

It's still complaining with the same error message. Any idea how to figure out what the problems it's complaining about are?

MikeMcQuaid commented 8 years ago

@justinclift Actually, I may have a fix. Coming right up...

justinclift commented 8 years ago

Cool. :smile:

MikeMcQuaid commented 8 years ago

@justinclift Try to brew pull https://github.com/Homebrew/brew/pull/1020 and then brew update and it should sort you out. If not: post again in that PR, thanks!

justinclift commented 8 years ago

Thanks @MikeMcQuaid, that worked. :smile:

krsmes commented 8 years ago
==> Migrating HOMEBREW_REPOSITORY (please wait)...
Error: unknown file type: /usr/local/Caskroom/suspicious-package/latest/.fseventsd/00000000001a4b41
Failed to migrate HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Please comment with your new error in issue or +1 an existing error:
  https://github.com/Homebrew/brew/issues/987
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1375:in `copy'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:463:in `block in copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1485:in `call'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1485:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1488:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1488:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1488:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1488:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:460:in `copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:435:in `block in cp_r'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1558:in `block in fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1574:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1556:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:434:in `cp_r'
/usr/local/Library/Homebrew/cmd/update-report.rb:235:in `migrate_legacy_repository_if_necessary'
/usr/local/Library/Homebrew/cmd/update-report.rb:103:in `update_report'
/usr/local/Library/Homebrew/brew.rb:99:in `<main>'
viktorbenei commented 8 years ago
$ brew install awscli

==> Migrating HOMEBREW_REPOSITORY (please wait)...
==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
  sudo chown root:wheel /usr/local
/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory -- /usr/local/Library/Homebrew/brew.rb (LoadError)
MatzFan commented 8 years ago

I just got the following (error on last line) after being migrated while trying to upgrade a formula:

$ brew upgrade postgresql
==> Auto-updated Homebrew!
Updated Homebrew from 8e9a9b6 to 13f08a2.
Updated 3 taps (homebrew/core, homebrew/science, homebrew/versions).
==> Updated Formulae
git-town                        homebrew/versions/gcc6          languagetool                    mg3a                            pkg-config โœ”                    proof-general                 

==> Migrating HOMEBREW_REPOSITORY (please wait)...
==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
  sudo chown root:wheel /usr/local
/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory -- /usr/local/Library/Homebrew/brew.rb (LoadError)

Is this just because the formula upgrade is trying to find brew.rb in the old location this one time, or some other harmless reason? Same command works fine now. brew doctor is fine and git status inside /usr/local/Homebrew says:

On branch master
nothing to commit, working tree clean

Thanks

Edit: Same as @viktorbenei it seems.

zmwangx commented 8 years ago

Is this just because the formula upgrade is trying to find brew.rb in the old location this one time.

Probably, rough edge I guess.

Do you have any problem afterwards?

EDIT: I missed the "Same command works fine now." part, sorry.

viktorbenei commented 8 years ago

TL;DR; for my and @MatzFan 's issue: brew install X fails if install performs the update, but brew update && brew install X works, as there brew update handles the migration correctly, and then install can proceed

viktorbenei commented 8 years ago

This is mainly an issue in CI environment btw

zmwangx commented 8 years ago

I believe this is an issue of install/upgrade calling udpate first (without HOMEBREW_NO_AUTO_UPDATE, that is).

viktorbenei commented 8 years ago

correct @zmwangx

MatzFan commented 8 years ago

No issues @zmwangx . As per @viktorbenei's comment, seems any arg passed during brew install or brew upgrade is ignored if migration is triggered.

zmwangx commented 8 years ago

@MatzFan Yeah, just as you said it was trying to find brew.rb in the old location (brew install without HOMEBREW_NO_AUTO_UPDATE runs update logic first which is in brew's bash layer, it then relays to the ruby layer for install which fails to find the file). This should only happen once and you shouldn't need to worry about it. We'll probably come up with a solution or warning for future folks though, thanks for the report.

MikeMcQuaid commented 8 years ago

Working on a fix to the auto-update issue.

jjv commented 8 years ago

Ran out of disk space during migration. Now, everything seems to be ok but no way to be sure?! Are there some files left behind and forgotten? Is something not migrated correctly and failing later?

==> Migrating HOMEBREW_REPOSITORY (please wait)...
Error: No space left on device - write
Failed to migrate HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Please comment with your new error in issue or +1 an existing error:
https://github.com/Homebrew/brew/issues/987
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1382:in `copy_stream'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1382:in `block (2 levels) in copy_file'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1381:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1381:in `block in copy_file'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1380:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1380:in `copy_file'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1348:in `copy'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:463:in `block in copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1485:in `call'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1485:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1488:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `wrap_traverse'
[previous 3 lines repeated 5 times]
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:460:in `copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:435:in `block in cp_r'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1558:in `block in fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1574:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1556:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:434:in `cp_r'
/usr/local/Library/Homebrew/cmd/update-report.rb:235:in `migrate_legacy_repository_if_necessary'
/usr/local/Library/Homebrew/cmd/update-report.rb:103:in `update_report'
/usr/local/Library/Homebrew/brew.rb:99:in `<main>'
MikeMcQuaid commented 8 years ago

@jjv Have hopefully improved the messaging. Everything should be fine once you free up the disk-space and rerun brew update.

MikeMcQuaid commented 8 years ago

@krsmes I've improved the error message but you'll need to resolve that yourself by deleting the relevant files causing the issues. @viktorbenei @MatzFan your issues should be fixed by https://github.com/Homebrew/brew/pull/1026 (now merged)

viktorbenei commented 8 years ago

Awesome, thank you @MikeMcQuaid !

MikeMcQuaid commented 8 years ago

@viktorbenei My pleasure, sorry for the pain. Shout if that doesn't resolve things for you or if you spot other issues, thanks.

viktorbenei commented 8 years ago

Sure, I definitely will, thanks again @MikeMcQuaid :)

timsutton commented 8 years ago

The migration seemed to have worked OK for me, but I did get this error at the end (running Sierra GM):

==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
  sudo chown root:wheel /usr/local
/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory -- /usr/local/Library/Homebrew/brew.rb (LoadError)
MikeMcQuaid commented 8 years ago

@timsutton Should be fixed by https://github.com/Homebrew/brew/pull/1026. If you can still reproduce that now: let me know.

jjv commented 8 years ago

Previously failed/interrupted migration prevents new migration. brew doctor reports "Your system is ready to brew." but no /usr/local/Homebrew exists after re-running brew update.

==> Migrating HOMEBREW_REPOSITORY (please wait)...
Error: /usr/local/Homebrew already exists.
Please remove it manually or uninstall and reinstall Homebrew into a new
location as the migration cannot be done automatically.

โžœ  mv /usr/local/Homebrew /usr/local/Homebrew_tmp

โžœ  brew update                                                                                               
Already up-to-date.

โžœ  ls -la /usr/local/Homebrew                                                                              
ls: /usr/local/Homebrew: No such file or directory
viktorbenei commented 8 years ago

@MikeMcQuaid on MacOS systems where brew was not updated for a while the issue is still reproducable, a simple brew install awscli fails with:

+ brew install awscli
==> Auto-updated Homebrew!
Updated Homebrew from ddafaae to c45119d.
Updated 1 tap (homebrew/core).
==> New Formulae
mpage
==> Updated Formulae
aria2
autoconf-archive
cli53
convox
corectl
crystal-lang
digdag
emacs
erlang
fio
ford
git-flow-avh
git-town
haskell-stack
ios-deploy
languagetool
libstrophe
mg3a
ntl
pkg-config
ponyc
predictionio
prometheus
proof-general
sdcv
wxmac
x264
xorriso
yara
==> Deleted Formulae
pyqwt
rsense
sqsh
yap

==> Migrating HOMEBREW_REPOSITORY (please wait)...
==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
  sudo chown root:wheel /usr/local
/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory -- /usr/local/Library/Homebrew/brew.rb (LoadError)
MikeMcQuaid commented 8 years ago

@viktorbenei Can I see the brew config for one of those systems? Also, can you try and see why /usr/local/Library/Homebrew/brew.rb doesn't exist as it should?

MikeMcQuaid commented 8 years ago

@jjv brew update --force will force it to try again.

viktorbenei commented 8 years ago

@MikeMcQuaid here's the output of brew config:

+ brew config
HOMEBREW_VERSION: 0.9.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: ddafaaecfc08ac704eedbc19e669bc60b0a0a157
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 5c69a6da3d26392fba96485d0aed456debb2821b
Core tap last commit: 3 days ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: dual-core 64-bit nehalem
Homebrew Ruby: 2.0.0-p648
Clang: 7.3 build 703
Git: 2.8.2 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/local/bin/ruby => /usr/local/Cellar/ruby/2.2.4/bin/ruby
Java: 1.8.0_92
OS X: 10.11.6-x86_64
Xcode: 7.3.1
CLT: 7.3.1.0.1.1461711523
X11: 2.7.8 => /opt/X11

The strange thing is, brew config && brew install awscli also works, only brew install awscli does not O_O

MikeMcQuaid commented 8 years ago

@viktorbenei I think this is something specific to your environment because it doesn't seem to be widely reproducible? Any more information you have for me about these machines? Did you say it's CI?

viktorbenei commented 8 years ago

@MikeMcQuaid CI - https://www.bitrise.io/ - AFAIK the only thing what might be "strange" is that the Ruby version of these stacks (Xcode 7.3 and older) is 2.2.4, installed from a tap ( https://github.com/bitrise-io/homebrew-pinned ), because at the time when these stacks were created CocoaPods (0.39) did not work with the latest (2.3) Ruby version, which was available in Homebrew

realgeek commented 8 years ago

On brew update I get:

==> Migrating HOMEBREW_REPOSITORY (please wait)...
Error: unknown file type: /usr/local/Caskroom/keepassx/2.0-alpha6/KeePassX.app/Contents/Resources/keepassx/.svn
Failed to migrate HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Please comment with your new error in issue or +1 an existing error:
  https://github.com/Homebrew/brew/issues/987
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1369:in `copy'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:463:in `block in copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1479:in `call'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1479:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1482:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1482:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1482:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1482:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1482:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1482:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1482:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1481:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:460:in `copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:435:in `block in cp_r'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1552:in `block in fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1568:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1550:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:434:in `cp_r'
/usr/local/Library/Homebrew/cmd/update-report.rb:235:in `migrate_legacy_repository_if_necessary'
/usr/local/Library/Homebrew/cmd/update-report.rb:103:in `update_report'
/usr/local/Library/Homebrew/brew.rb:99:in `<main>'
MikeMcQuaid commented 8 years ago

@MikeMcQuaid CI - https://www.bitrise.io/ - AFAIK the only thing what might be "strange" is that the Ruby version of these stacks (Xcode 7.3 and older) is 2.2.4, installed from a tap ( https://github.com/bitrise-io/homebrew-pinned ), because at the time when these stacks were created CocoaPods (0.39) did not work with the latest (2.3) Ruby version, which was available in Homebrew

@realgeek You'll need to delete the relevant files and run brew update --force again.

ilovezfs commented 8 years ago

@realgeek what's the output of

ls -le /usr/local/Caskroom/keepassx/2.0-alpha6/KeePassX.app/Contents/Resources/keepassx/.svn
file /usr/local/Caskroom/keepassx/2.0-alpha6/KeePassX.app/Contents/Resources/keepassx/.svn
stat /usr/local/Caskroom/keepassx/2.0-alpha6/KeePassX.app/Contents/Resources/keepassx/.svn
mdutil -t /usr/local/Caskroom/keepassx/2.0-alpha6/KeePassX.app/Contents/Resources/keepassx/.svn
mdls /usr/local/Caskroom/keepassx/2.0-alpha6/KeePassX.app/Contents/Resources/keepassx/.svn
xattr -l /usr/local/Caskroom/keepassx/2.0-alpha6/KeePassX.app/Contents/Resources/keepassx/.svn
realgeek commented 8 years ago

@MikeMcQuaid @ilovezfs I'm not sure why, but some of the files and dirs of the KeepassX app were owned by root and some dirs did not have execute bits set. I suspect the app did something to its own installation after running (it was originally allowed to control the computer via Sysprefs/Security/Accessibility).

Once I chown'd, chmod'd that tree and also made /usr/local owned by me, I tried brew update --force but it complained about Homebrew already existing. I temporarily moved that dir out of the way, retried, and the migration was successful. Thanks for your help.

Also of note: One of my symlinks wasn't updated. brew doctor said that the /usr/local/bin/soffice link was broken. I manually pointed it to /usr/local/Homebrew/Caskroom/libreoffice/5.2.1/soffice.wrapper.sh.

juanfcocontreras commented 8 years ago

@MikeMcQuaid, same problem as @viktorbenei here:

==> Migrating HOMEBREW_REPOSITORY (please wait)...
==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
  sudo chown root:wheel /usr/local
/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory -- /usr/local/Library/Homebrew/brew.rb (LoadError)

brew.rb is in /usr/local/Homebrew/Library/Homebrew, not in /usr/local/Library/Homebrew

brew config output:

HOMEBREW_VERSION: 0.9.9
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 3ffb9a2f7cda6652f75cb0c59c6d079ab1039e94
Last commit: 86 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 5ae1f185d9f24d5cc82f9524df7288297a3a0c74
Core tap last commit: 56 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.8.4 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /Users/user/anaconda/bin/python => /Users/user/anaconda/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_102
macOS: 10.11.6-x86_64
Xcode: 8.0
CLT: 7.3.1.0.1.1461711523
X11: 2.7.9 => /opt/X11
MikeMcQuaid commented 8 years ago

Also of note: One of my symlinks wasn't updated. brew doctor said that the /usr/local/bin/soffice link was broken. I manually pointed it to /usr/local/Homebrew/Caskroom/libreoffice/5.2.1/soffice.wrapper.sh.

Should be fixed (or broken again ๐Ÿ˜ญ) by https://github.com/Homebrew/brew/pull/1025.

MikeMcQuaid commented 8 years ago

@juanfcocontreras @viktorbenei as a temporary workaround always run brew update first. Can you send me the output of whatever command you use but with --debug --verbose appended? Thanks!

juanfcocontreras commented 8 years ago

Sure. I forgot to mention that while I got the same error as @viktorbenei (/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory -- /usr/local/Library/Homebrew/brew.rb (LoadError)) I can install packages without issues or needing to run brew update first.

I attach brew install awscli --debug --verbose output.

output.txt

MikeMcQuaid commented 8 years ago

@juanfcocontreras Are you using a CI provider or any other way to repeatedly reproduce this? Thanks!