dep ensure hangs when ssh key has passphrase

Created on 1 Mar 2018  路  9Comments  路  Source: golang/dep

Looks like if there is a github private repo where you fetch the dependency from and your account has an authorised ssh key (which has a passphrase).
When performing a deb ensure was expecting it to prompt for my password however this wasn't the case, instead it would just hang.

Versions:
dep version being used is v0.4.1 installed via brew
Using go version: 1.9.4

ensure

Most helpful comment

I found a solution:

  1. first, change the url from https to ssh:

git config --global url."[email protected]:".insteadOf "https://github.com/"

  1. second, config ssh-agent
eval ssh-agent -s
ssh-add <path-to-privKey>

hope helpful!

All 9 comments

Probably not the best solution but you can try it =)

$ git config --global url."[email protected]:".insteadOf "https://github.com/"
$ dep ensure

Facing similar issues .. could a user be alerted by dep in such case? please ? I assume it is a very common use case where people have passphrase on their keys ?

I have this issue as well when running init, even with -gopath: dep init -gopath -v --skip-tools

Edit:

Since this in my case was a monorepo, the fix was to:

  • Remove the passprhase like @raviparekh suggested
  • Fix Gopkg.toml manually and ignore the repo
  • Run dep ensure to update the .lock file
  • Add the passphrase to the keyfile again

interestingly this issue surfaced on my centos7 dev box....after trying everything, I tried it on a clean ubuntu dev box and it worked there with the same ssh keys...no idea why.

I'm having this same error on Ubuntu 16.04, with golang 1.10.1, and dep 1.10.1.

same problem here

Same here..

$ git config --global url."[email protected]:".insteadOf "https://gitlab.company.com/"
$ dep ensure -add gitlab.company.com/{group}/module # occur error
$ dep ensure -add gitlab.company.com/{group}/module.git # fetch success

I use gitlab.

${PROJECT_PATH}/vendor/gitlab.company.com/group/go-fastping.git 

How to remove git extension?

I found a solution:

  1. first, change the url from https to ssh:

git config --global url."[email protected]:".insteadOf "https://github.com/"

  1. second, config ssh-agent
eval ssh-agent -s
ssh-add <path-to-privKey>

hope helpful!

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