Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Failed to import" error #917

Closed
shammellee opened this issue Aug 14, 2013 · 13 comments
Closed

"Failed to import" error #917

shammellee opened this issue Aug 14, 2013 · 13 comments

Comments

@shammellee
Copy link

$ brew doctor

Error: Failed to import: acorn
No available formula for acorn
Error: Failed to import: adapter
...
...
...
Error: Failed to import: zepheer
No available formula for zepheer
Error: Failed to import: zotero
No available formula for zotero
Your system is ready to brew.
@vitorgalvao
Copy link
Member

Have you tried the “magic one-liner”?

That error should not be appearing anymore, are you using the latest version of homebrew-cask (brew update && brew upgrade brew-cask)?

@shammellee
Copy link
Author

$ brew doctor
Your system is ready to brew.

Looks like the one-liner fixed it. Thanks!

@kevinSuttle
Copy link

Still didn't fix it for me. Neither did this one:
ls -l /usr/local/Library/Formula | grep phinze-cask | awk '{print $9}' | for evil_symlink in $(cat -); do rm -v /usr/local/Library/Formula/$evil_symlink; done

It's worth noting that every time I run my update, I have to make a merge commit for some reason.
https://github.com/kevinSuttle/dotfiles/blob/master/zsh/aliases.zsh#L21 (just updated with magic one-liner)

$  gcc -v
Configured with: --prefix=/Applications/Xcode5-DP5.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.1.72) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix
$  brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: bf3dea328e00bdfa98725d212dfe8baedae7f78a
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit arrandale
OS X: 10.8.4-x86_64
Xcode: 5.0 => /Applications/Xcode5-DP5.app/Contents/Developer
CLT: 1.0.0.9000000000.1.1249367152
GCC-4.2: build 5666
LLVM-GCC: build 2336
Clang: 5.0 build 500
X11: N/A
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /Users/kevinsuttle/.rbenv/shims/ruby
$ brew --env
HOMEBREW_CC: clang
MAKEFLAGS: -j4
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.8
ACLOCAL_PATH: /usr/local/share/aclocal
OBJC: cc
PATH: /usr/local/Library/ENV/4.3:/usr/bin:/bin:/usr/sbin:/sbin

@passcod
Copy link
Contributor

passcod commented Aug 16, 2013

every time I run my update, I have to make a merge commit for some reason.

That means one of your repos cannot be fast-forwarded, this would be either Homebrew or the Cask tap (or another tap). To fix it, you have to first identify which repo it is, then check you are on the right branch, then fetch the upstream master branch into a new-master one, switch to it, delete your local master, and rename new-master to master. Or something else equivalent, there's several ways to skin an octocat.

@kevinSuttle
Copy link

So do you think that has to do with why I'm getting this same repeated error?

@kevinSuttle
Copy link

Also, I think the issue is that the usr/local/Library/Taps/phinze-cask/Casks and the usr/local/Library/Formula folders have a lot of overlap, with many being @ symlinks in the Casks dir.

$ ls -l /usr/local/Library/Formula | grep phinze-cask | awk '{print $9}' | for evil_symlink in $(cat -); do rm -v /usr/local/Library/Formula/$evil_symlink; done
rm: /usr/local/Library/Formula/RELEASING.md@: No such file or directory
rm: /usr/local/Library/Formula/adapter.rb@: No such file or directory
... (lots more)
rm: /usr/local/Library/Formula/zotero.rb@: No such file or directory

I dunno.

@kevinSuttle
Copy link

I'll admit that this is all a bit out of my range. Does this look out of sorts?

screen shot 2013-08-16 at 10 41 48 pm

@nanoxd
Copy link
Contributor

nanoxd commented Aug 17, 2013

Have you tried running git status on each of those folders?

@kevinSuttle
Copy link

I had run it on the top 2, but I just dug a little deeper.
I did see this, which must be the culprit.

$  cd usr/local/Library/Taps/homebrew-versions/
$  git status
# On branch master
# Your branch is ahead of 'origin/master' by 21 commits.
#   (use "git push" to publish your local commits)
#
nothing to commit, working directory clean

Aha.

$  git log --decorate --oneline --graph
*   430c4ba (HEAD, master) Merge branch 'master' of https://github.com/Homebrew/homebrew-versions
|\
| * e540f87 (origin/master, origin/HEAD) gcc49: update to snapshot 20130811.
| * 1fe25f5 Disable speed optimization for ppl formulae.
* |   f4b7de4 Merge branch 'master' of https://github.com/Homebrew/homebrew-versions
|\ \
| |/
| * 6b97c3f play 1.2.6
| * 49ac43d GCC build depends self-hosting.

etc.

@kevinSuttle
Copy link

Well, homebrew-versions isn't it.

$  rm -rf homebrew-versions
$  git clone https://github.com/Homebrew/homebrew-versions.git
Cloning into 'homebrew-versions'...
remote: Counting objects: 1089, done.
remote: Compressing objects: 100% (647/647), done.
remote: Total 1089 (delta 591), reused 907 (delta 442)
Receiving objects: 100% (1089/1089), 285.31 KiB | 282.00 KiB/s, done.
Resolving deltas: 100% (591/591), done.
Checking connectivity... done
$  brew update && brew cleanup && brew prune && brew tap --repair && brew doctor
Already up-to-date.
Pruned 0 dead formula
Tapped 144 formula
Pruned 0 dead formula
Tapped 144 formula
Error: Failed to import: adapter
No available formula for adapter
...
No available formula for zotero
Your system is ready to brew.

Back to the drawing board.

@kevinSuttle
Copy link

I only found one other repo that wasn't in sync, but still the error persists.

$  git remote -v
origin   https://github.com/mxcl/homebrew (fetch)
origin   https://github.com/mxcl/homebrew (push)
$  git pull --rebase
From https://github.com/phinze/homebrew-cask
 + 3cf0429...171456d install-uninstall -> origin/install-uninstall  (forced update)
 * [new branch]      logitech-unifying -> origin/logitech-unifying
 * [new branch]      maratis    -> origin/maratis
 * [new branch]      xtra-finder -> origin/xtra-finder
Current branch master is up to date.

Then I tried the following script #816 (comment), which finally fixed it (cross-referenced from homebrew-cask).

@chrismcnally
Copy link

I fixed this for myself, but I don't know what I did to get into this state. Here is what I did and I hope this will help you and others.

I went to /usr/local/Library/phinze-cask

 cd /usr/local/Library/phinze-cask

I did git status

 git status

and it showed a modified file, brew-cask.rb

I stashed it (to reset to head) with

 git stash save changed-phineze-cask-file

then I did

 cd 

and

 brew update

No more errors, everything was updated.

@s10wen
Copy link

s10wen commented Feb 8, 2014

Not sure if this is related, but I just got:

$ brew doctor
Error: Failed to import: cask
No available formula for cask
Your system is ready to brew.

Tried 'the magic one-liner':
brew update && brew upgrade brew-cask

That did:

$ brew update && brew upgrade brew-cask
Already up-to-date.
==> Upgrading 1 outdated package, with result:
brew-cask 0.28.0
==> Upgrading brew-cask
==> Cloning https://github.com/phinze/homebrew-cask.git
Updating /Library/Caches/Homebrew/brew-cask--git
==> Checking out tag v0.28.0
  /usr/local/Cellar/brew-cask/0.28.0: 1159 files, 4.6M, built in 6 seconds

But doing brew doctor again I still get:

$ brew doctor
Error: Failed to import: cask
No available formula for cask
Your system is ready to brew.

Any ideas what's going on here please?

@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
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

7 participants