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

Created on 1 Jun 2017  ·  7Comments  ·  Source: golang/dep

A repro (on mac, go 1.8.3) using latest (1c168c0d47df7a150c71372b2125e8833f9e63c7) 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: https://github.com/kjk/siser/commit/593a1a6c12ef4c7c33581fbde55a0ce6b85e124d

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/[email protected]
(7) ✓ select github.com/pkg/[email protected] 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?

Most helpful comment

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

All 7 comments

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 😄

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

I met this issue in:

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

resolved after upgrade git to latest version

@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)

@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.

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeffwillette picture jeffwillette  ·  3Comments

tapir picture tapir  ·  3Comments

deejross picture deejross  ·  3Comments

jjyr picture jjyr  ·  3Comments

jiharal picture jiharal  ·  3Comments