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

dep ensure: ensure Solve(): No versions of github.com/kjk/siser met constraints #699

Closed
kjk opened this issue Jun 1, 2017 · 7 comments · Fixed by #696
Closed

dep ensure: ensure Solve(): No versions of github.com/kjk/siser met constraints #699

kjk opened this issue Jun 1, 2017 · 7 comments · Fixed by #696

Comments

@kjk
Copy link

kjk commented Jun 1, 2017

A repro (on mac, go 1.8.3) using latest (1c168c0) version of dep:

git checkout https://github.com/kjk/web-blog.git
dep ensure

I get an error:

ensure Solve(): No versions of github.com/kjk/siser met constraints:
	master: Unable to update checked out version: fatal: reference is not a tree: 593a1a6c12ef4c7c33581fbde55a0ce6b85e124d

Notice that this revision exists: kjk/siser@593a1a6

It fails on other packages as well:

ensure Solve(): No versions of golang.org/x/crypto met constraints:
	master: Unable to update checked out version: fatal: reference is not a tree: 080743b21912ae11ad9222778a048b795a5aae00

but most frequently github.com/kjk/siser

Dependency file was created with dep ensure -u on a different machine (but also mac).

From a bit of googling it seems this is what git returns, but I don't know what command exactly.

Running verbose:

$ dep ensure -v
Root project is "github.com/kjk/blog"
 1 transitively valid internal packages
 13 external packages imported from 13 projects
(0)   ✓ select (root)
(1)	? attempt github.com/SparkPost/gosparkpost with 1 pkgs; at least 1 versions to try
(1)	    try github.com/SparkPost/gosparkpost@master
(1)	✓ select github.com/SparkPost/gosparkpost@master w/2 pkgs
(2)	? attempt github.com/dustin/go-humanize with 1 pkgs; at least 1 versions to try
(2)	    try github.com/dustin/go-humanize@master
(2)	✓ select github.com/dustin/go-humanize@master w/1 pkgs
(3)	? attempt github.com/kjk/dailyrotate with 1 pkgs; at least 1 versions to try
(3)	    try github.com/kjk/dailyrotate@master
(3)	✓ select github.com/kjk/dailyrotate@master w/1 pkgs
(4)	? attempt github.com/go-fsnotify/fsnotify with 1 pkgs; at least 1 versions to try
(4)	    try github.com/go-fsnotify/fsnotify@master
(4)	✓ select github.com/go-fsnotify/fsnotify@master w/1 pkgs
(5)	? attempt github.com/kr/fs with 1 pkgs; at least 1 versions to try
(5)	    try github.com/kr/fs@master
(5)	✓ select github.com/kr/fs@master w/1 pkgs
(6)	? attempt github.com/microcosm-cc/bluemonday with 1 pkgs; at least 1 versions to try
(6)	    try github.com/microcosm-cc/bluemonday@master
(6)	✓ select github.com/microcosm-cc/bluemonday@master w/1 pkgs
(7)	? attempt github.com/pkg/errors with 1 pkgs; at least 1 versions to try
(7)	    try github.com/pkg/errors@v0.8.0
(7)	✓ select github.com/pkg/errors@v0.8.0 w/1 pkgs
(8)	? attempt github.com/kjk/siser with 1 pkgs; at least 1 versions to try
(8)	    try github.com/kjk/siser@master
(8)	✗   Unable to update checked out version: fatal: reference is not a tree: 593a1a6c12ef4c7c33581fbde55a0ce6b85e124d
(8)	    try github.com/kjk/siser@master
(8)	✗   Unable to update checked out version: fatal: reference is not a tree: 593a1a6c12ef4c7c33581fbde55a0ce6b85e124d
(8)	  ← no more versions of github.com/kjk/siser to try; begin backtrack
(7)	← backtrack: no more versions of github.com/pkg/errors to try
(6)	← backtrack: no more versions of github.com/microcosm-cc/bluemonday to try
(5)	← backtrack: no more versions of github.com/kr/fs to try
(4)	← backtrack: no more versions of github.com/go-fsnotify/fsnotify to try
(3)	← backtrack: no more versions of github.com/kjk/dailyrotate to try
(2)	← backtrack: no more versions of github.com/dustin/go-humanize to try
(1)	← backtrack: no more versions of github.com/SparkPost/gosparkpost to try
  ✗ solving failed

Solver wall times by segment:
     b-source-exists: 1.786681846s
         b-list-pkgs: 973.319787ms
              b-gmal: 937.044693ms
  b-deduce-proj-root:  231.61719ms
         select-atom:    540.846µs
             satisfy:    531.758µs
            new-atom:    481.376µs
         select-root:    323.196µs
            unselect:    309.772µs
           backtrack:      26.02µs
     b-list-versions:     11.989µs
               other:     10.288µs

  TOTAL: 3.930898761s

ensure Solve(): No versions of github.com/kjk/siser met constraints:
	master: Unable to update checked out version: fatal: reference is not a tree: 593a1a6c12ef4c7c33581fbde55a0ce6b85e124d

	master: Unable to update checked out version: fatal: reference is not a tree: 593a1a6c12ef4c7c33581fbde55a0ce6b85e124d

An aside: it would be good to have "even more verbose" cmd-line arg that prints external commands that dep executes.

Also, can it be flakiness on the github side?

@sdboyer
Copy link
Member

sdboyer commented Jun 1, 2017

Thanks for the detailed issue! This is the same stale cache issue as #639 rearing its head again. #696 fixes it - I'll probably merge tomorrow morning.

An aside: it would be good to have "even more verbose" cmd-line arg that prints external commands that dep executes.

This has come up as a request a couple times, but it's hard to do. For one, command output wouldn't necessarily be well-ordered with respect to the trace output you see above, as we may end up pre-caching a bunch of this stuff. Two is caching itself - we actually want to avoid running these commands as much as possible, so in our ideal world, very little output would be generated. Third is more of an architectural choice, but the system that actually does the VCS work is pretty well sealed-up in a way that it can't directly log.

It's possible we could include more things as warnings, a la #534. Or maybe we "log" internally and store up all the messages, then make them available after solving is done. But interleaving more output with the trace output above would be pretty harmful to coherency of the trace output.

Fortunately, this case has a solution at hand 😄

@kjk
Copy link
Author

kjk commented Jun 1, 2017

Thanks, deleting $GOPATH/pkg/dep/sources fixed the issue.

@localvar
Copy link

I met this issue in:

dep v0.3.0
git v1.8.3
CentOS v7.2

resolved after upgrade git to latest version

@sdboyer
Copy link
Member

sdboyer commented Aug 11, 2017

@localvar hi! could you post a new, full issue describing what you encountered? even if you saw the same error message, the underlying logic that gave rise to this issue are now different, and require a different analysis. (especially because it's not evident to me how updating git would change this)

@localvar
Copy link

@sdboyer , I cannot reproduce it now, but this did happen on two of my servers, I will log detailed information if I meet it again.

@E4ck
Copy link

E4ck commented Jun 28, 2018

deleting $GOPATH/pkg/dep/sources,but still did not solve the problem

@yogesh-desai
Copy link

I also faced the same issue after updating golang to version 1.11

dep:
 version     : v0.5.0
 build date  : 2018-07-26
 git hash    : 224a564
 go version  : go1.10.3
 go compiler : gc
 platform    : darwin/amd64
 features    : ImportDuringSolve=false

Deleting $GOPATH/pkg/dep/sources solved my issue.

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

Successfully merging a pull request may close this issue.

5 participants