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

dep init fails, cause unknown, entire state rolls back so cannot adjust anything #158

Closed
kardianos opened this issue Jan 25, 2017 · 3 comments
Labels

Comments

@kardianos
Copy link

I removed the existing vendor directory.

Running dep init on a project fails with the following:

std out

ouchie, solve error: No versions of github.com/pkg/errors met constraints:
	master: Unable to update checked out version: fatal: reference is not a tree: 8ec4b99f5bad732ffaa7dbce5bae53cd2b770301

	v0.8.0: Could not introduce github.com/pkg/errors@v0.8.0, as it is not allowed by constraint master from project (internal repo).
	v0.8.0: Could not introduce github.com/pkg/errors@v0.8.0, as it is not allowed by constraint master from project (internal repo).
	v0.7.1: Could not introduce github.com/pkg/errors@v0.7.1, as it is not allowed by constraint master from project (internal repo).
	v0.7.1: Could not introduce github.com/pkg/errors@v0.7.1, as it is not allowed by constraint master from project (internal repo).
	v0.7.0: Could not introduce github.com/pkg/errors@v0.7.0, as it is not allowed by constraint master from project (internal repo).
	v0.7.0: Could not introduce github.com/pkg/errors@v0.7.0, as it is not allowed by constraint master from project (internal repo).
	v0.6.0: Could not introduce github.com/pkg/errors@v0.6.0, as it is not allowed by constraint master from project (internal repo).
	v0.6.0: Could not introduce github.com/pkg/errors@v0.6.0, as it is not allowed by constraint master from project (internal repo).
	v0.5.1: Could not introduce github.com/pkg/errors@v0.5.1, as it is not allowed by constraint master from project (internal repo).
	v0.5.1: Could not introduce github.com/pkg/errors@v0.5.1, as it is not allowed by constraint master from project (internal repo).
	v0.5.0: Could not introduce github.com/pkg/errors@v0.5.0, as it is not allowed by constraint master from project (internal repo).
	v0.5.0: Could not introduce github.com/pkg/errors@v0.5.0, as it is not allowed by constraint master from project (internal repo).
	v0.4.0: Could not introduce github.com/pkg/errors@v0.4.0, as it is not allowed by constraint master from project (internal repo).
	v0.4.0: Could not introduce github.com/pkg/errors@v0.4.0, as it is not allowed by constraint master from project (internal repo).
	v0.3.0: Could not introduce github.com/pkg/errors@v0.3.0, as it is not allowed by constraint master from project (internal repo).
	v0.3.0: Could not introduce github.com/pkg/errors@v0.3.0, as it is not allowed by constraint master from project (internal repo).
	v0.2.0: Could not introduce github.com/pkg/errors@v0.2.0, as it is not allowed by constraint master from project (internal repo).
	v0.2.0: Could not introduce github.com/pkg/errors@v0.2.0, as it is not allowed by constraint master from project (internal repo).
	v0.1.0: Could not introduce github.com/pkg/errors@v0.1.0, as it is not allowed by constraint master from project (internal repo).
	v0.1.0: Could not introduce github.com/pkg/errors@v0.1.0, as it is not allowed by constraint master from project (internal repo).
	master: Could not introduce github.com/pkg/errors@master, as it is not allowed by constraint master from project (internal repo).

std err

No versions of github.com/pkg/errors met constraints:
	master: Unable to update checked out version: fatal: reference is not a tree: 8ec4b99f5bad732ffaa7dbce5bae53cd2b770301

	v0.8.0: Could not introduce github.com/pkg/errors@v0.8.0, as it is not allowed by constraint master from project (internal repo).
	v0.8.0: Could not introduce github.com/pkg/errors@v0.8.0, as it is not allowed by constraint master from project (internal repo).
	v0.7.1: Could not introduce github.com/pkg/errors@v0.7.1, as it is not allowed by constraint master from project (internal repo).
	v0.7.1: Could not introduce github.com/pkg/errors@v0.7.1, as it is not allowed by constraint master from project (internal repo).
	v0.7.0: Could not introduce github.com/pkg/errors@v0.7.0, as it is not allowed by constraint master from project (internal repo).
	v0.7.0: Could not introduce github.com/pkg/errors@v0.7.0, as it is not allowed by constraint master from project (internal repo).
	v0.6.0: Could not introduce github.com/pkg/errors@v0.6.0, as it is not allowed by constraint master from project (internal repo).
	v0.6.0: Could not introduce github.com/pkg/errors@v0.6.0, as it is not allowed by constraint master from project (internal repo).
	v0.5.1: Could not introduce github.com/pkg/errors@v0.5.1, as it is not allowed by constraint master from project (internal repo).
	v0.5.1: Could not introduce github.com/pkg/errors@v0.5.1, as it is not allowed by constraint master from project (internal repo).
	v0.5.0: Could not introduce github.com/pkg/errors@v0.5.0, as it is not allowed by constraint master from project (internal repo).
	v0.5.0: Could not introduce github.com/pkg/errors@v0.5.0, as it is not allowed by constraint master from project (internal repo).
	v0.4.0: Could not introduce github.com/pkg/errors@v0.4.0, as it is not allowed by constraint master from project (internal repo).
	v0.4.0: Could not introduce github.com/pkg/errors@v0.4.0, as it is not allowed by constraint master from project (internal repo).
	v0.3.0: Could not introduce github.com/pkg/errors@v0.3.0, as it is not allowed by constraint master from project (internal repo).
	v0.3.0: Could not introduce github.com/pkg/errors@v0.3.0, as it is not allowed by constraint master from project (internal repo).
	v0.2.0: Could not introduce github.com/pkg/errors@v0.2.0, as it is not allowed by constraint master from project (internal repo).
	v0.2.0: Could not introduce github.com/pkg/errors@v0.2.0, as it is not allowed by constraint master from project (internal repo).
	v0.1.0: Could not introduce github.com/pkg/errors@v0.1.0, as it is not allowed by constraint master from project (internal repo).
	v0.1.0: Could not introduce github.com/pkg/errors@v0.1.0, as it is not allowed by constraint master from project (internal repo).
	master: Could not introduce github.com/pkg/errors@master, as it is not allowed by constraint master from project (internal repo).

Problem 1: I don't know what the underlying problem is.
Problem 2: I don't know how to fix it if the entire state is rolled back on init error.
Problem 3: The error is repeated on both std out and std err.
Problem 4: The length of errors will be proportional to the number of tagged releases.
Problem 5: The referenced revision does exist in github.com/pkg/errors. If it is seeking that revision, why can it use it?

@sdboyer
Copy link
Member

sdboyer commented Jan 26, 2017

In reverse order!

Problem 5: The referenced revision does exist in github.com/pkg/errors. If it is seeking that revision, why can it use it?

This is a fine, fine question, and I don't have an immediate answer. Ordinarily, I'd guess that it's a problem with gps incorrectly failing to update the repo in the cache - e.g., #97 (comment) . But, a) I fixed the bug that caused that for Jessie, and b) The commit it claims is missing there is really old, like six months old, so I can't imagine how that would be the problem here.

Problem 4: The length of errors will be proportional to the number of tagged releases.

Yes, this is just the tip of the iceberg when it comes to the things we need to do to improve errors. Right now we're just dumping the info that comes straight back from gps. I've got an issue I'm working on writing up about that whole problem area.

Problem 3: The error is repeated on both std out and std err.

This is a dumb thing that we did all over the place, and could and should be fixed now :)

Problem 2: I don't know how to fix it if the entire state is rolled back on init error.

These are all-or-nothing operations, which is a design goal - we never want to leave disk in any undefined, half-finished state if we can at all avoid it. The route to debugging here is through improved errors.

Problem 1: I don't know what the underlying problem is.

You and me both! I'm trying to think about what even could cause this. The only thing I can think of right now...is that commit dangling/unreachable?

I'll keep percolating on it. In the meantime, more contextual info about the state of your GOPATH when you ran that would be 👍

@sdboyer
Copy link
Member

sdboyer commented Apr 28, 2017

Doing a bit of queue cleanup, and gonna close this one - of the problems listed:

  1. the best explanation here is that that commit is unreachable from all current refs (e.g. if it was squash-merged), but still present in the github repo because of - guessing - how github's clustered git object storage works within fork families. A fresh clone does not contain the commit. This is equivalent to the "unpushed commit" situation (and that's literally why it happened - dep init fails if GOPATH has a checked out branch not present in remote #216); and Dep ensure silently updating lock file when encountering an orphaned commit  #405 demonstrates how this gets addressed now. Probably not ideal still, but less full of weird errors.
  2. by design, as described above
  3. fixed now
  4. larger problem of error handling, which has its whole own vertical in the roadmap Error and failure reporting #288
  5. (see above re: orphan commit)

@sdboyer sdboyer closed this as completed Apr 28, 2017
@omeid
Copy link

omeid commented Jul 3, 2017

tl;dr fix: You probably have local commits that aren't pushed upstream.

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

No branches or pull requests

4 participants