Dep: panic running dep ensure

Created on 11 May 2018  Â·  7Comments  Â·  Source: golang/dep

What version of dep are you using (dep version)?

-> % dep version
dep:
 version     : v0.4.1
 build date  : 2018-01-27
 git hash    : 37d9ea0
 go version  : go1.9.3
 go compiler : gc
 platform    : darwin/amd64

What dep command did you run?

dep ensure

-> % dep ensure
panic: version queue is empty, should not happen

goroutine 1 [running]:
github.com/golang/dep/gps.(*solver).findValidVersion(0xc4201f0240, 0xc4202eb9a0, 0xc42043b9b0, 0x1, 0x1, 0x0, 0xc42043b9b0)
    /private/tmp/dep-20180127-38430-r7nlwc/src/github.com/golang/dep/gps/solver.go:927 +0x53f
github.com/golang/dep/gps.(*solver).createVersionQueue(0xc4201f0240, 0xc420166f60, 0x14, 0x0, 0x0, 0xc42043b9b0, 0x1, 0x1, 0x0, 0x0, ...)
    /private/tmp/dep-20180127-38430-r7nlwc/src/github.com/golang/dep/gps/solver.go:914 +0x955
github.com/golang/dep/gps.(*solver).solve(0xc4201f0240, 0x17e7e40, 0xc4200160d0, 0x0, 0xc420268de0, 0xc420268e40)
    /private/tmp/dep-20180127-38430-r7nlwc/src/github.com/golang/dep/gps/solver.go:517 +0x5b0
github.com/golang/dep/gps.(*solver).Solve(0xc4201f0240, 0x17e7e40, 0xc4200160d0, 0x1843a90, 0xc420010054, 0x20, 0xc4203cccf0)
    /private/tmp/dep-20180127-38430-r7nlwc/src/github.com/golang/dep/gps/solver.go:457 +0xe4
main.(*ensureCommand).runDefault(0xc420157f46, 0xc42005d080, 0xc42000a0a0, 0x0, 0x0, 0xc42005d0e0, 0x17eb320, 0xc42005d440, 0xc420010044, 0x30, ...)
    /private/tmp/dep-20180127-38430-r7nlwc/src/github.com/golang/dep/cmd/dep/ensure.go:302 +0x168
main.(*ensureCommand).Run(0xc420157f46, 0xc42005d080, 0xc42000a0a0, 0x0, 0x0, 0x0, 0x0)
    /private/tmp/dep-20180127-38430-r7nlwc/src/github.com/golang/dep/cmd/dep/ensure.go:220 +0x8f4
main.(*Config).Run(0xc42005cf60, 0xc42005cf60)
    /private/tmp/dep-20180127-38430-r7nlwc/src/github.com/golang/dep/cmd/dep/main.go:210 +0x11cb
main.main()
    /private/tmp/dep-20180127-38430-r7nlwc/src/github.com/golang/dep/cmd/dep/main.go:52 +0x1fc

What did you expect to see?

Dep updates the lock file

What did you see instead?

Panic with no action to take. It would be convenient if the import causing the issue was included in the message. I've commented out all of the Gopkg.toml imports and it is still throwing these panics.

[prune]
  go-tests = true
  unused-packages = true
  non-go = true

  [[prune.project]]
    name = "github.com/wellington/go-libsass"
    non-go = false
    unused-packages = false #libsass-build must exist but can not be imported directly

Here's the gopkg.toml with all constraints commented out.

Most helpful comment

Appears, there is no clever resolution happening. We just need to implement the user resolution

gopkg.in/pkg.v3      → github.com/go-pkg/pkg (branch/tag v3, v3.N, or v3.N.M)
gopkg.in/user/pkg.v3 → github.com/user/pkg   (branch/tag v3, v3.N, or v3.N.M)

All 7 comments

It seems something has broken with resolvinggopkg.in/fsnotify/fsnotify.v1. Here's what it looks like in dep sources

[~/pkg/dep/sources/https---gopkg.in-fsnotify.v1] [master]
-> % git remote show origin
* remote origin
  Fetch URL: [email protected]:go-fsnotify/fsnotify
  Push  URL: [email protected]:go-fsnotify/fsnotify

Here's go get

-> % go get -u -v go get gopkg.in/fsnotify/fsnotify.v1
package get: unrecognized import path "get" (import path does not begin with hostname)
Fetching https://gopkg.in/fsnotify/fsnotify.v1?go-get=1
Parsing meta tags from https://gopkg.in/fsnotify/fsnotify.v1?go-get=1 (status code 200)
get "gopkg.in/fsnotify/fsnotify.v1": found meta tag get.metaImport{Prefix:"gopkg.in/fsnotify/fsnotify.v1", VCS:"git", RepoRoot:"https://gopkg.in/fsnotify/fsnotify.v1"} at https://gopkg.in/fsnotify/fsnotify.v1?go-get=1
gopkg.in/fsnotify/fsnotify.v1 (download)
-> % cd ~/src/gopkg.in/fsnotify/fsnotify.v1
drew@dumass [21:44:01] [~/src/gopkg.in/fsnotify/fsnotify.v1] [master]
-> % git remote show origin
* remote origin
  Fetch URL: https://gopkg.in/fsnotify/fsnotify.v1
  Push  URL: https://gopkg.in/fsnotify/fsnotify.v1

```

At some point, fsnotify moved from github.com/go-fsnotify/fsnotify to github.com/fsnotify/fsnotify. Not sure why dep is still seeing the old location. Wiping the cache or manually fixing up the repo in dep/sources doens't resolve the issue.

I was able to workaround the issue by checking out the correct repo as a separate remote and checking out the requested commit.

-> % git remote add correct [email protected]:fsnotify/fsnotify.git
-> % git fetch correct
-> % git checkout v1.4.7

Hey @drewwells, sorry you're running into issues. fsnotify is a corner case. Most gopkg.in packages redirect to github.com/go-<pkg>/<pkg>. fsnotify is an exception (see go-fsnotify/fsnotify#1 for details). Check out gopkginDeducer.deduceSource() for our hardcoding.

I'm not sure how to fix it 😞. Are you interested in submitting a PR for this? go get knows how to handle it, so that may be a good place to look.

Otherwise, I recommending submitting a PR to the dependency that's using the old package identifier (gopkg.in/fsnotify/fsnotify.v1) and refactoring it to use github.com/fsnotify/fsnotify.

Appears, there is no clever resolution happening. We just need to implement the user resolution

gopkg.in/pkg.v3      → github.com/go-pkg/pkg (branch/tag v3, v3.N, or v3.N.M)
gopkg.in/user/pkg.v3 → github.com/user/pkg   (branch/tag v3, v3.N, or v3.N.M)

So how to fix it? Override it in Gopkg.toml ?

Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mastoj picture mastoj  Â·  29Comments

sdboyer picture sdboyer  Â·  36Comments

sdboyer picture sdboyer  Â·  31Comments

godcong picture godcong  Â·  27Comments

sdboyer picture sdboyer  Â·  46Comments