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

Dep ensure not installing the dependencies in Gopkg.toml #1378

Closed
darkpssngr opened this issue Nov 15, 2017 · 10 comments
Closed

Dep ensure not installing the dependencies in Gopkg.toml #1378

darkpssngr opened this issue Nov 15, 2017 · 10 comments

Comments

@darkpssngr
Copy link

darkpssngr commented Nov 15, 2017

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

$ dep version                                                                                                                                                  
dep:
 version     : devel
 build date  :
 git hash    :
 go version  : go1.9.1
 go compiler : gc
 platform    : darwin/amd64`

What dep command did you run?

dep ensure

$dep ensure -add github.com/braintree/manners                                                                                                                  
Fetching sources...

"github.com/braintree/manners" is not imported by your project, and has been temporarily added to Gopkg.lock and vendor/.
If you run "dep ensure" again before actually importing it, it will disappear from Gopkg.lock and vendor/.

$ dep ensure                                                                                                                                                    

$ dep status                                                                                                                                                    
PROJECT                              CONSTRAINT  VERSION        REVISION  LATEST   PKGS USED
github.com/braintree/manners         ^0.4.0      0.4.0          0b5e6b2   0b5e6b2  1
github.com/cihub/seelog              ~2.6.0      v2.6           d2c6e5a   d2c6e5a  1
github.com/dgrijalva/jwt-go          ~3.1.0      v3.1.0         dbeaa93   dbeaa93  1
github.com/fsnotify/fsnotify         *           v1.4.2         629574c   629574c  1
github.com/go-redis/redis            ~6.7.3      v6.7.3         d0f8697   d0f8697  6
github.com/gocql/gocql               *                          33a5f3c            4
github.com/golang/protobuf           *           branch master  1e59b77   1e59b77  1
github.com/golang/snappy             *           branch master  553a641   553a641  1
github.com/hailocab/go-hostpool      *           branch master  e80d13c   e80d13c  1
github.com/hashicorp/golang-lru      *                          0a025b7            2
github.com/hashicorp/hcl             *           branch master  23c074d   23c074d  9
github.com/julienschmidt/httprouter  ~1.1.0      v1.1           8c199fb   8c199fb  1
github.com/magiconair/properties     *           v1.7.3         be5ece7   be5ece7  1
github.com/mitchellh/mapstructure    *           branch master  06020f8   06020f8  1
github.com/orcaman/concurrent-map    *                          d4c23bd            1
github.com/pelletier/go-toml         *           v1.0.1         16398ba   16398ba  1
github.com/spf13/afero               *           v1.0.0         8d919cb   8d919cb  2
github.com/spf13/cast                *           v1.1.0         acbeb36   acbeb36  1
github.com/spf13/jwalterweatherman   *           branch master  12bd96e   12bd96e  1
github.com/spf13/pflag               *           v1.0.0         e57e3ee   e57e3ee  1
github.com/spf13/viper               *           v1.0.0         25b30aa   25b30aa  1
github.com/urfave/negroni            ^0.3.0      v0.3.0         5dbbc83   5dbbc83  1
github.com/vmihailenco/msgpack       ~3.2.0      v3.2.0         df5e5d2   df5e5d2  2
golang.org/x/net                     *           branch master  a337091   a337091  1
golang.org/x/sys                     *           branch master  bf42f18   bf42f18  1
golang.org/x/text                    *           branch master  88f656f   88f656f  6
google.golang.org/appengine          *           v1.0.0         150dc57   150dc57  9
gopkg.in/inf.v0                      *           v0.9.0         3887ee9   3887ee9  1
gopkg.in/yaml.v2                     *           branch v2      eb3733d   eb3733d  1

I did a dep ensure -add without actually importing the package in my code. It threw a warning saying the package would be removed if I did a dep ensure without importing the package.

I imported the package in my code and ran dep ensure again.
dep status says it has the package installed. But the package is missing in the vendor directory.

@sdboyer
Copy link
Member

sdboyer commented Nov 16, 2017

hi, welcome! sorry you ran into this.

this is a bit odd. could you provide the output of dep hash-inputs?

@darkpssngr
Copy link
Author

dep hash-inputs                                                                                                                                               ruby-2.2.0@helpkit
-CONSTRAINTS-
github.com/braintree/manners
svc-^0.4.0
github.com/cihub/seelog
svc-~2.6.0
github.com/dgrijalva/jwt-go
svc-~3.1.0
github.com/go-redis/redis
svc-~6.7.3
github.com/gocql/gocql
r-33a5f3c1bcc2c421b3221c5858312afb141bf605
github.com/hashicorp/golang-lru
r-0a025b7e63adc15a622f29b0b2c4c3848243bbf6
github.com/julienschmidt/httprouter
svc-~1.1.0
github.com/orcaman/concurrent-map
r-d4c23bd0e01134806215ffe65ba3fd22ec6721f7
github.com/urfave/negroni
svc-^0.3.0
github.com/vmihailenco/msgpack
svc-~3.2.0
-IMPORTS/REQS-
github.com/braintree/manners
github.com/cihub/seelog
github.com/dgrijalva/jwt-go
github.com/go-redis/redis
github.com/gocql/gocql
github.com/hashicorp/golang-lru
github.com/julienschmidt/httprouter
github.com/orcaman/concurrent-map
github.com/spf13/viper
github.com/urfave/negroni
github.com/vmihailenco/msgpack
-IGNORES-
-OVERRIDES-
-ANALYZER-
dep
1

@darkpssngr
Copy link
Author

Its weird. I see the package now after running dep hash-inputs.
Not sure what happened.

@sdboyer
Copy link
Member

sdboyer commented Nov 16, 2017

hmm, dep hash-inputs is a read-only operation, so that shouldn't have changed anything.

are you able to reproduce the original problem from scratch?

@darkpssngr
Copy link
Author

No. I'm unable to reproduce it now. Will close this for now.

Thanks

@vaibhav-sinha
Copy link

I am facing the same issue.

$ dep version
dep:
 version     : devel
 build date  : 
 git hash    : 
 go version  : go1.9.1
 go compiler : gc
 platform    : darwin/amd64

In Homebrew the version of dep is 0.3.2

$ dep status
PROJECT                           CONSTRAINT     VERSION        REVISION  LATEST   PKGS USED
github.com/gorilla/websocket      ^1.2.0         v1.2.0         ea4d1f6   ea4d1f6  1  
github.com/streadway/amqp         branch master  branch master  ff791c2   ff791c2  1  
gopkg.in/natefinch/lumberjack.v2  ^2.1.0         v2.1           a96e638   a96e638  1  

$ dep hash-inputs
-CONSTRAINTS-
github.com/gorilla/websocket
svc-^1.2.0
github.com/streadway/amqp
b-master
gopkg.in/natefinch/lumberjack.v2
svc-^2.1.0
-IMPORTS/REQS-
github.com/gorilla/websocket
github.com/streadway/amqp
gopkg.in/natefinch/lumberjack.v2
-IGNORES-
-OVERRIDES-
-ANALYZER-
dep
1

$ dep ensure

The package github.com/streadway/amqp is not being fetched in the vendor directory.

@vaibhav-sinha
Copy link

So I start to see the package too after few minutes. Maybe the package is just taking time to get downloaded? Does ensure not wait until the download is over?

@sdboyer
Copy link
Member

sdboyer commented Nov 30, 2017

@vaibhav-sinha dep is pretty powerful, but it's not magical enough to do things when the process isn't running 😄

if you still have the terminal history, that'd help to figure out how you ran into this. the only known hole through which this should be able to occur is if you manually delete something out of your vendor directory - dep sometimes won't repopulate it if Gopkg.lock is already in sync, unless you run dep ensure -vendor-only.

we've chosen to leave that hole in place temporarily while we work on #121, because the alternative would entail absolutely always unconditionally repopulating vendor completely on every dep ensure run.

@beeekind
Copy link

beeekind commented May 9, 2018

I ran into a similar issue and found that deleting my vendor directory and running 'dep ensure' retrieved the missing package. Unfortunately I don't have steps to reproduce. I've run into the issue before and will be more diligent recording the steps next time.

Otherwise solid tool, very grateful to the devs/maintainers!

@halakaraki
Copy link

I faced the same issue. Deleting the vendor directory and then running dep ensure worked but I'm not sure what caused it.

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

No branches or pull requests

5 participants