I've scoured the list of PRs and issues for glide, and spent many hours attempting to solve the problem on my own but with little success.
I am attempting to execute glide up in a repo that has dependencies in private repositories. After some time these warnings appear:
[INFO] --> Fetching git.private.com/privateUser/private1.git
[WARN] Unable to checkout git.private.com/privateUser/private1.git
[INFO] --> Fetching git.private.com/privateUser/private2.git
[WARN] Unable to checkout git.private.com/privateUser/private2.git
[WARN] Unable to set version on git.private.com/privateUser/private1.git to . Err: Unable to retrieve checked out version
[INFO] --> Fetching github.com/gorilla/context
[INFO] --> Fetching go.uber.org/atomic
The warnings would be fine except that at the end, glide crashes with this error:
[ERROR] Error scanning git.private.com/privateUser/private1.git: open /home/ubuntu/.glide/cache/src/https-git.private.com/privateUser/private1.git: no such file or directory
[ERROR] This error means the referenced package was not found.
[ERROR] Missing file or directory errors usually occur when multiple packages
[ERROR] share a common dependency and the first reference encountered by the scanner
[ERROR] sets the version to one that does not contain a subpackage needed required
[ERROR] by another package that uses the shared dependency. Try setting a
[ERROR] version in your glide.yaml that works for all packages that share this
[ERROR] dependency.
The versions are actually explicitly seen in the glide.lock file. I noticed that the prefix of the cached directory is https instead of ssh, even though in the glide.yaml and glide.lock file the dependencies are in ssh format:
- package: private.com/private1
repo: ssh://[email protected]/privateUser/private1.git
vcs: git
subpackages:
- subPrivate1
- package: private.com/private2
repo: ssh://[email protected]/privateUser/private2.git
vcs: git
I don't think it's an ssh keys issue because I was able to clone, checkout, fetch, and pull the private repos manually using the keys on the server. Other similar issues suggested messing with the .gitconfig, checking for ssh access, editing the yaml file settings, etc but none of those suggestions worked. I have also tried completely removing the yaml and lock files, using different versions of glide (including the latest version glide version 0.13.0-dev), clearing/deleting the .glide cache, and removing and cloning the repo but nothing worked.
For some reason glide uses https instead of ssh to fetch the dependencies because the glide cache saves in https directories instead of ssh directories. The keys are added to ssh-agent and everything so I'm not sure why the error is occurring.
Any help would be greatly appreciated, as this is incredibly baffling and frustrating. I can also post glide --debug output but it offers little over the information I already provided. Operating system information is posted below.
Distributor ID: Ubuntu
Description:Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
Linux build 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
I manually changed global git config to use the ssh version of the url instead of https with this command:
git config --global url."[email protected]:".insteadOf "https://git.private.com"
That fixed it for me, so I'm closing this issue.
Most helpful comment
I manually changed global git config to use the ssh version of the url instead of https with this command:
git config --global url."[email protected]:".insteadOf "https://git.private.com"That fixed it for me, so I'm closing this issue.