Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

dep init solve error #473

Closed
elvizlai opened this issue Apr 28, 2017 · 5 comments
Closed

dep init solve error #473

elvizlai opened this issue Apr 28, 2017 · 5 comments

Comments

@elvizlai
Copy link

solve error: No versions of golang.org/x/crypto met constraints:
master: Unable to update checked out version: error: Your local changes to the following files would be overwritten by checkout:
ssh/agent/example_test.go
Please commit your changes or stash them before you switch branches.
Aborting

No versions of golang.org/x/crypto met constraints:
master: Unable to update checked out version: error: Your local changes to the following files would be overwritten by checkout:
ssh/agent/example_test.go
Please commit your changes or stash them before you switch branches.
Aborting

@sdboyer
Copy link
Member

sdboyer commented Apr 28, 2017

Hmm...there's no normal scenario in which the tool would modify a file in the cache, which is where this error almost certainly is coming from. Three questions:

  • Did you ctrl-C an earlier dep run? If so, git could have terminated in an inconsistent disk state. If that's the case, then this is another instance of the same underlying issue as in solve error: Unable to retrieve local repo information #469.
  • Did you manually change anything under the $GOPATH/pkg/dep/sources/ dir?
  • Failing the others, what are your gitconfig values for core.safecrlf, core.autocrlf, core.eol? And what OS are you on?

I know it's not a good solution, but rm -rf $GOPATH/pkg/dep/sources/ should resolve the immediate problem.

@elvizlai
Copy link
Author

elvizlai commented Apr 29, 2017

The previous dep works fine(April 9). I updated dep and it told me missing Gopkg.toml and need dep init it.

  1. It's a huge project and works for a long time. I'm sure I may use ctrl-C sometimes.
  2. I never manually change anything under the $GOPATH/pkg/dep/sources/ dir definitely.
  3. I'm using Mac OSX 10.12.4 and here is git config -l result
credential.helper=osxkeychain
user.name=elvizlai
user.email=hidden for secret
core.excludesfile=/Users/sdrzlyz/.gitignore_global
difftool.sourcetree.cmd=opendiff "$LOCAL" "$REMOTE"
difftool.sourcetree.path=
mergetool.sourcetree.cmd=/Applications/SourceTree.app/Contents/Resources/opendiff-w.sh "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"
mergetool.sourcetree.trustexitcode=true

no such file or directory: /Users/sdrzlyz/.godeps/pkg/dep/sources/

Anything more detail need I provide to solve this problem?

@sdboyer
Copy link
Member

sdboyer commented Apr 29, 2017

I'm sure I may use ctrl-C sometimes.

They key here is whether you interrupted since updating to the latest dep. We changed the way signals are handled recently, and it's created these situations where git can terminate too quickly, possibly creating an inconsistent disk state (like what you've been seeing) on subsequent runs.

no such file or directory: /Users/sdrzlyz/.godeps/pkg/dep/sources/

That's when attempting the rm -rf, right? That shouldn't be possible - if dep has worked with even a single dependency, that directory should exist and be non-empty. Your GOPATH is /Users/sdrzlyz/.godeps? Or do you perhaps have multiple elements in your GOPATH?

@elvizlai
Copy link
Author

elvizlai commented Apr 29, 2017

@sdboyer Yes, I have multi GOPATH. I found those file in my project dir.
I delete pkg/dep/sources/ dir and now dep init works.

@sdboyer
Copy link
Member

sdboyer commented Apr 29, 2017

OK, glad you got it fixed. It sounds like this is a symptom of a problem for which we already have a ticket, so closing this one out.

@sdboyer sdboyer closed this as completed Apr 29, 2017
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

2 participants