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

panic: canary - *should* be impossible to have a pkg-only selection here #408

Closed
jmank88 opened this issue Apr 21, 2017 · 10 comments
Closed
Labels

Comments

@jmank88
Copy link
Collaborator

jmank88 commented Apr 21, 2017

With latest dep (536f25f), running dep init on the latest github.com/iron-io/functions (32278fe2e02e38737fe87be32975255b81712f17) produces a panic that I don't see an open issue for.

Full Log
Relevant error:

panic: canary - *should* be impossible to have a pkg-only selection here

goroutine 1 [running]:
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*solver).backtrack(0xc420886a20, 0xc420acf500)
	/home/jordan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/solver.go:953 +0xb34
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*solver).solve(0xc420886a20, 0x0, 0x0, 0x1c)
	/home/jordan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/solver.go:409 +0x787
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*solver).Solve(0xc420886a20, 0x30, 0xa63080, 0xab1138, 0xc420014098)
	/home/jordan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/solver.go:355 +0xab
main.(*initCommand).Run(0xab1138, 0xc420126d50, 0xc42000c460, 0x0, 0x0, 0x0, 0x0)
	/home/jordan/go/src/github.com/golang/dep/cmd/dep/init.go:156 +0xfbb
main.main()
	/home/jordan/go/src/github.com/golang/dep/cmd/dep/main.go:125 +0x6df
@jmank88
Copy link
Collaborator Author

jmank88 commented Apr 21, 2017

It is reproducible, but it is not related to the preceeding Cached ... line (maybe that is obvious to someone looking at the code side)

@sdboyer
Copy link
Member

sdboyer commented Apr 21, 2017

@jmank88 canaries are working, this is probably a bug! 😄 thanks for the issue report.

Could you re-run with dep init -v? That'll give the solve trace output, which is essential for determining where things went wrong in the solving algorithm. Thanks!

@jmank88
Copy link
Collaborator Author

jmank88 commented Apr 21, 2017

@sdboyer
Copy link
Member

sdboyer commented Apr 27, 2017

Well, it's very odd that you'd end up on that panic (and that still indicates a bug). But it seems like you shouldn't have gotten here at all; it appears that there's another bug where it's not picking up the full version list for github.com/docker/distribution: https://gist.github.com/jmank88/1d1cb545f774ff3d34afb9bd15670200#file-dep_init_-v-txt-L490

That line is super wrong - there should be at least 40 or so more versions available to try.

@sdboyer sdboyer added the bug label Apr 27, 2017
@timoreimann
Copy link

Running the current latest version of dep (commit d010781), I am experiencing similar problems running dep init on containous/traefik, specifically commit a0d6594.

The verbose log output can be found here. FWIW, traefik also uses github.com/docker/distribution.

Let me know if I can do anything to help analyze the problem.

@jmank88
Copy link
Collaborator Author

jmank88 commented May 2, 2017

I wonder if this could be related to the docker->moby name change.

@sdboyer
Copy link
Member

sdboyer commented May 3, 2017

While the docker->moby name change is...well, super fun, it's unlikely to be causing the problem. GitHub redirects requests to the old name. And we can see docker/docker showing up just fine in @timoreimann's log output.

To be clear, the problem here is, unequivocally, a solver bookkeeping problem. The canary panics in the solver (there are currently seven) are in place to identify situations where the solver's internal state invariants have been invalidated. This particular one could easily just be wrong, though - and the more I stare at it, the more I think it is.

@sdboyer
Copy link
Member

sdboyer commented May 3, 2017

Yes, looking at it more, that panic just shouldn't be there, as it's a perfectly valid case. Will get this fixed promptly after #453 😄

@sdboyer sdboyer closed this as completed in 6810902 May 3, 2017
@sdboyer
Copy link
Member

sdboyer commented May 3, 2017

OK, this issue should be gone - it got through a dep init -v for containous/traefik correctly (nicely exposing some of the bookkeeping errors in our trace output - wow do those package selection counts get ridiculous!). I didn't try iron-io/functions, but it should be fine.

Man, does it feel good to be able to just fix something directly 😄

@timoreimann
Copy link

timoreimann commented May 4, 2017

holy moly, that's what I call a quick fix (and I don't mean the bad kind)! 🚀

Thanks @sdboyer! 👏

ibrasho pushed a commit to ibrasho-forks/dep that referenced this issue May 10, 2017
There had been a canary panic in this case, but that was just incorrect.
It's perfectly legitimate for a project marked for retrying to have
induced some pkg-only selections.

Fixes golang#408.
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

3 participants