1

Trying to set up the go project using Glide. I have been finding the error Cannot detect VCS when I ran the command glide up -v.

Errors:

[ERROR] Error looking for project/base: Cannot detect VCS
[INFO]  --> Fetching project/form
[WARN]  Unable to checkout project/form
[ERROR] Error looking for project/form: Cannot detect VCS
[INFO]  --> Fetching project/api
[WARN]  Unable to checkout project/api
[ERROR] Error looking for project/api/request: Cannot detect VCS
[INFO]  --> Fetching updates for github.com/go-openapi/analysis
Community
  • 1
  • 1
Seenu S
  • 3,381
  • 6
  • 30
  • 45

3 Answers3

2

I saw something similar using glide update using Glide 0.13.2, and Go versions 1.10.6 and 1.11.5.

Using the more detailed glide --debug update, I found a wee bit more detail: -

[DEBUG] ImportDir error on /Users/hayd/.glide/cache/src/https-crypto-tls: cannot find package "." in:
    /Users/hayd/.glide/cache/src/https-crypto-tls

BUT this did lead me to look at my Git source folder - $GOPATH/src - which, amongst other things had this: -

drwxr-xr-x   3 hayd  staff   96 29 Mar 19:31 crypto

which was a directory containing a sinmgle empty subdirectory: -

drwxr-xr-x  2 hayd  staff   64 29 Mar 19:33 tls

So this kinda tied up with the symptom shown up in the --debug trace i.e. cannot find package "." even though it was in a completely different place.

Once I did rm -Rf $GOPATH/src/crypto, the glide update worked a treat.

I'd previously gone down a rabbit hole with glide clear-cache and glide mirror, both of which were poisson rouge.

Hope this helps others in the same situation :-)

Dave Hay
  • 31
  • 3
0

I experienced this issue when I had a dependency with the https:// at the start. I simply removed that so it looked like github.com/dependency and it resolved the issue.

M3nd3z
  • 316
  • 2
  • 12
0

I myself experienced this issue and would like to add that here for reference.

Go Version : go version go1.13.4 darwin/amd64

[DEBUG] Trying to open github.com/BurntSushi/toml (/Users/folder/.glide/cache/src/https-github.com-BurntSushi-toml)
[DEBUG] Package github.com/BurntSushi/toml imports io/fs
[DEBUG] Missing io/fs. Trying to resolve.
[INFO]  --> Fetching io/fs
[WARN]  Unable to checkout io/fs
[ERROR] Error looking for io/fs: Cannot detect VCS

I was facing the error shown above while running glide --debug up command. Realising that the issue lies with toml dependency I manually deleted the folder https-github.com-BurntSushi-toml from .cache folder.

Then again I ran the command glide --debug up. Again I was faced with the same error. It took me a while to realise that io/fs was a new addition in go 1.16 version.

The issue in this case was due to update of the package to the latest version. The latest version of the toml package needed a go version 1.16 while I was on version 1.13. So then I needed to revert to the older version of toml which I was using earlier in glide.lock(I had added some dependencies and wanted to run update on them , older version of toml package was good enough for me).

The error Cannot detect VCS is very general error and you might need to look at the error to understand what is going on and fix accordingly.

Sourav Prem
  • 1,063
  • 13
  • 26