Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

vscode-go failing to update go tools #2897

Closed
alfmos opened this issue Nov 11, 2019 · 20 comments
Closed

vscode-go failing to update go tools #2897

alfmos opened this issue Nov 11, 2019 · 20 comments

Comments

@alfmos
Copy link

alfmos commented Nov 11, 2019

What version of Go, VS Code & VS Code Go extension are you using?

go version go1.13.4 windows/amd64

  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    1.40.0
    86405ea23e3937316009fc27c9361deee66ffbf5
    x64
  • Check your installed extensions to get the version of the VS Code Go extension
    Name: Go
    ID: ms-vscode.go
    Description: Rich Go language support for Visual Studio Code
    Version: 0.11.9
    Editore: Microsoft
    itemName=ms-vscode.Go
  • Run go env GOOS GOARCH to get the operating system and processor arhcitecture details
    windows
    amd64

Share the Go related settings you have added/edited

"go.delveConfig": {
    "dlvLoadConfig": {
      "followPointers": true,
      "maxVariableRecurse": 1,
      "maxStringLen": 4000,
      "maxArrayValues": 4000,
      "maxStructFields": -1
    },
    "apiVersion": 2,
    "showGlobalVariables": true
  },

  "workbench.editor.enablePreview": false,
  "go.gopath": "d:\\go\\",
  "go.vetOnSave": "workspace",
  "go.formatTool": "goimports",
  "explorer.confirmDragAndDrop": false,
  "go.useLanguageServer": true,
  "go.languageServerExperimentalFeatures": {
    "format": true,
    "autoComplete": true,
    "rename": true,
    "goToDefinition": true,
    "hover": true,
    "signatureHelp": true,
    "goToTypeDefinition": true,
    "goToImplementation": true,
    "documentSymbols": true,
    "workspaceSymbols": true,
    "findReferences": true,
    "diagnostics": true,
    "documentLink": true
  },
  "go.toolsGopath": "d:\\go",

Describe the bug

I have manually upgraded go compiler to 1.13.4.
After this nothing works anymore
When I start Visual studio code it says it needs to update go tools.
Update starts but fails because all tools report "access is denied"
I I try debugging delve complains telling me that: "Version of Delve is too old for this version of Go (maximum supported version 1.12, suppress this error with --check-go-version=false)"

Steps to reproduce the behavior:

  1. Upgrade go compiler to 1.13.4
  2. Open Visual studio code
  3. Press Ctrl Shift P
  4. Select Go: Install/Update tools
  5. select your preference of tools
  6. Look at errors in the Output pane (See below for error detail)

Screenshots or recordings

Output of tools update:
Using the value d:\go from the go.toolsGopath setting.
Installing 12 tools at d:\go\bin in module mode.
gocode
gopkgs
go-outline
go-symbols
guru
gorename
dlv
gocode-gomod
godef
goimports
golint
gopls

Installing github.com/mdempsky/gocode FAILED
Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED
Installing github.com/ramya-rao-a/go-outline FAILED
Installing github.com/acroca/go-symbols FAILED
Installing golang.org/x/tools/cmd/guru FAILED
Installing golang.org/x/tools/cmd/gorename FAILED
Installing github.com/go-delve/delve/cmd/dlv FAILED
Installing github.com/stamblerre/gocode FAILED
Installing github.com/rogpeppe/godef FAILED
Installing golang.org/x/tools/cmd/goimports FAILED
Installing golang.org/x/lint/golint FAILED
Installing golang.org/x/tools/gopls SUCCEEDED

10 tools failed to install.

gocode:
Error: Command failed: c:\go\bin\go.exe get -v github.com/mdempsky/gocode
go: finding github.com/mdempsky/gocode latest
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
build github.com/mdempsky/gocode: cannot load golang.org/x/tools/go/gcexportdata: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-162181577 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.
go: finding github.com/mdempsky/gocode latest
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
build github.com/mdempsky/gocode: cannot load golang.org/x/tools/go/gcexportdata: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-162181577 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.

go-outline:
Error: Command failed: c:\go\bin\go.exe get -v github.com/ramya-rao-a/go-outline
go: finding github.com/ramya-rao-a/go-outline latest
go: finding golang.org/x/tools latest
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
build github.com/ramya-rao-a/go-outline: cannot load golang.org/x/tools/go/buildutil: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-861491774 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.
go: finding github.com/ramya-rao-a/go-outline latest
go: finding golang.org/x/tools latest
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
build github.com/ramya-rao-a/go-outline: cannot load golang.org/x/tools/go/buildutil: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-861491774 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.

go-symbols:
Error: Command failed: c:\go\bin\go.exe get -v github.com/acroca/go-symbols
go: finding golang.org/x/tools latest
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
build github.com/acroca/go-symbols: cannot load golang.org/x/tools/go/buildutil: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-975959578 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.
go: finding golang.org/x/tools latest
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
build github.com/acroca/go-symbols: cannot load golang.org/x/tools/go/buildutil: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-975959578 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.

guru:
Error: Command failed: c:\go\bin\go.exe get -v golang.org/x/tools/cmd/guru
go: finding golang.org/x/tools latest
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
go get golang.org/x/tools/cmd/guru: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-321705022 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.
go: finding golang.org/x/tools latest
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
go get golang.org/x/tools/cmd/guru: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-321705022 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.

gorename:
Error: Command failed: c:\go\bin\go.exe get -v golang.org/x/tools/cmd/gorename
go: finding golang.org/x/tools latest
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
go get golang.org/x/tools/cmd/gorename: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-227549402 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.
go: finding golang.org/x/tools latest
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
go get golang.org/x/tools/cmd/gorename: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-227549402 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.

dlv:
Error: Command failed: c:\go\bin\go.exe get -v github.com/go-delve/delve/cmd/dlv
go: extracting github.com/go-delve/delve v1.3.2
go get github.com/go-delve/delve/cmd/dlv: rename d:\go\pkg\mod\github.com\go-delve\delve@v1.3.2.tmp-884088698 d:\go\pkg\mod\github.com\go-delve\delve@v1.3.2: Access is denied.
go: extracting github.com/go-delve/delve v1.3.2
go get github.com/go-delve/delve/cmd/dlv: rename d:\go\pkg\mod\github.com\go-delve\delve@v1.3.2.tmp-884088698 d:\go\pkg\mod\github.com\go-delve\delve@v1.3.2: Access is denied.

gocode-gomod:
Error: Command failed: c:\go\bin\go.exe get -v -d github.com/stamblerre/gocode
go: extracting github.com/stamblerre/gocode v1.0.0
go get github.com/stamblerre/gocode: rename d:\go\pkg\mod\github.com\stamblerre\gocode@v1.0.0.tmp-608084638 d:\go\pkg\mod\github.com\stamblerre\gocode@v1.0.0: Access is denied.
go: extracting github.com/stamblerre/gocode v1.0.0
go get github.com/stamblerre/gocode: rename d:\go\pkg\mod\github.com\stamblerre\gocode@v1.0.0.tmp-608084638 d:\go\pkg\mod\github.com\stamblerre\gocode@v1.0.0: Access is denied.

godef:
Error: Command failed: c:\go\bin\go.exe get -v github.com/rogpeppe/godef
go: extracting golang.org/x/tools v0.0.0-20181130195746-895048a75ecf
build github.com/rogpeppe/godef: cannot load golang.org/x/tools/go/ast/astutil: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20181130195746-895048a75ecf.tmp-281861802 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20181130195746-895048a75ecf: Access is denied.
go: extracting golang.org/x/tools v0.0.0-20181130195746-895048a75ecf
build github.com/rogpeppe/godef: cannot load golang.org/x/tools/go/ast/astutil: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20181130195746-895048a75ecf.tmp-281861802 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20181130195746-895048a75ecf: Access is denied.

goimports:
Error: Command failed: c:\go\bin\go.exe get -v golang.org/x/tools/cmd/goimports
go: finding golang.org/x/tools latest
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
go get golang.org/x/tools/cmd/goimports: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-789239246 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.
go: finding golang.org/x/tools latest
go: extracting golang.org/x/tools v0.0.0-20191111154804-8cb0d02132ec
go get golang.org/x/tools/cmd/goimports: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec.tmp-789239246 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191111154804-8cb0d02132ec: Access is denied.

golint:
Error: Command failed: c:\go\bin\go.exe get -v golang.org/x/lint/golint
go: finding golang.org/x/lint latest
go: extracting golang.org/x/tools v0.0.0-20190311212946-11955173bddd
build golang.org/x/lint/golint: cannot load golang.org/x/tools/go/ast/astutil: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20190311212946-11955173bddd.tmp-568541006 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20190311212946-11955173bddd: Access is denied.
go: finding golang.org/x/lint latest
go: extracting golang.org/x/tools v0.0.0-20190311212946-11955173bddd
build golang.org/x/lint/golint: cannot load golang.org/x/tools/go/ast/astutil: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20190311212946-11955173bddd.tmp-568541006 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20190311212946-11955173bddd: Access is denied.

@stamblerre
Copy link
Contributor

This may very well be a bug in the way that vscode-go installs these tools, but I've never seen such an error before. @jayconrod - have you ever encountered something like this?

@OneOfOne
Copy link
Contributor

Probably related to golang/go#35043, windows is wonderful like that.

@alfmos
Copy link
Author

alfmos commented Nov 12, 2019

As a confirmation, reopening vs code asked for gopls update, and this time it reports the exact command failing, and as you supposed it's a rename. Here the output:

Using the value d:\go from the go.toolsGopath setting.
Installing 1 tool at d:\go\bin in module mode.
gopls

Installing golang.org/x/tools/gopls FAILED

1 tools failed to install.

gopls:
Error: Command failed: c:\go\bin\go.exe get -v golang.org/x/tools/gopls
go: finding golang.org/x/tools/gopls v0.2.0
go: downloading golang.org/x/tools/gopls v0.2.0
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20191112005509-a3f652f18032
go: extracting golang.org/x/tools/gopls v0.2.0
go: extracting golang.org/x/tools v0.0.0-20191112005509-a3f652f18032
go: downloading golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go: extracting golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go get golang.org/x/tools/gopls: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe.tmp-150253189 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe: Access is denied.
go: finding golang.org/x/tools/gopls v0.2.0
go: downloading golang.org/x/tools/gopls v0.2.0
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20191112005509-a3f652f18032
go: extracting golang.org/x/tools/gopls v0.2.0
go: extracting golang.org/x/tools v0.0.0-20191112005509-a3f652f18032
go: downloading golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go: extracting golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go get golang.org/x/tools/gopls: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe.tmp-150253189 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe: Access is denied.

Doing the same command externally works, however

@jayconrod
Copy link

@alfmos The errors you're seeing are reported by the go command after it extracts a module zip file, as it tries to move the extracted directory into place in the module cache.

Could you take a quick look in the module cache and see if there is a permissions problem?

  • Does the directory d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe exist? Is it owned by another user? Does it have any unusual ACLs or permissions? Are there files inside?
  • How about the parent directory d:\go\pkg\mod\golang.org\x? Same questions.
  • What file system is this on (I'm assuming NTFS on a second drive, but correct me if I'm wrong). Would anything prevent file locking from working there?

You can work around this by setting the GOPATH environment variable to a different directory. That will move the module cache.

Alternatively, you can clear the cache by running go clean -modcache.

@jayconrod
Copy link

@OneOfOne I don't think golang/go#35043 is the cause. Module zip directories are not set to read-only until after they are renamed. I'm guessing the cache is either in some partial state it can't recover from or directories in it are owned by multiple users.

@jayconrod
Copy link

cc @bcmills

@alfmos
Copy link
Author

alfmos commented Nov 13, 2019

properties
@jayconrod I have included a printscreen of the directory and I don't see any issue on permissions.
d is indeed a second disk, local to the pc.
No one is locking directories, and launching go goet from outside vs code doesn't give error (but doesn't solve the problem)
I reverted to 1.12 to continue working. I'm going to install 1.13 again, I'll give a try to your workarounds and I'll let you know.
P.S. I work in an Active directory environment, but I am domain admin and I have all permissions

@alfmos
Copy link
Author

alfmos commented Nov 13, 2019

Reinstalled go 1.13
launched go clean -modcache
Started vc code, asked for updating gopls, but installation failed.
I have also changed d:\go permissions giving complete control to authenticated users and local users, but nothing changes
Going to try changing GOPATH
Usual error:
Using the value d:\go from the go.toolsGopath setting.
Installing 1 tool at d:\go\bin in module mode.
gopls

Installing golang.org/x/tools/gopls FAILED

1 tools failed to install.

gopls:
Error: Command failed: c:\go\bin\go.exe get -v golang.org/x/tools/gopls
go: finding golang.org/x/tools/gopls v0.2.0
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools/gopls v0.2.0
go: downloading golang.org/x/tools v0.0.0-20191113055240-e33b02e76616
go: extracting golang.org/x/tools/gopls v0.2.0
go: extracting golang.org/x/tools v0.0.0-20191113055240-e33b02e76616
go: downloading golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go: extracting golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go get golang.org/x/tools/gopls: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe.tmp-556064501 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe: Access is denied.
go: finding golang.org/x/tools/gopls v0.2.0
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools/gopls v0.2.0
go: downloading golang.org/x/tools v0.0.0-20191113055240-e33b02e76616
go: extracting golang.org/x/tools/gopls v0.2.0
go: extracting golang.org/x/tools v0.0.0-20191113055240-e33b02e76616
go: downloading golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go: extracting golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go get golang.org/x/tools/gopls: rename d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe.tmp-556064501 d:\go\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe: Access is denied.

@alfmos
Copy link
Author

alfmos commented Nov 13, 2019

New try:
created d:\gocache
Assigned complete permissions to all users
chenged in vs code all references
{
"php.validate.executablePath": "d:\php\php.exe",
"window.zoomLevel": 0,
"svn.enableProposedApi": "product",

"go.delveConfig": {
    "dlvLoadConfig": {
      "followPointers": true,
      "maxVariableRecurse": 1,
      "maxStringLen": 4000,
      "maxArrayValues": 4000,
      "maxStructFields": -1
    },
    "apiVersion": 2,
    "showGlobalVariables": true
  },

  "workbench.editor.enablePreview": false,
  "go.gopath": "d:\\gocache\\",
  "go.vetOnSave": "workspace",
  "go.formatTool": "goimports",
  "explorer.confirmDragAndDrop": false,
  "go.useLanguageServer": true,
  "go.languageServerExperimentalFeatures": {
    "format": true,
    "autoComplete": true,
    "rename": true,
    "goToDefinition": true,
    "hover": true,
    "signatureHelp": true,
    "goToTypeDefinition": true,
    "goToImplementation": true,
    "documentSymbols": true,
    "workspaceSymbols": true,
    "findReferences": true,
    "diagnostics": true,
    "documentLink": true
  },
  "csv-preview.resizeColumns": "all",
  "csv-preview.separator": ";",
  "go.toolsGopath": "d:\\gocache",

}
started vs code
tried to update gopls, but always same error on rename:

Using the value d:\gocache from the go.toolsGopath setting.
Installing 1 tool at d:\gocache\bin in module mode.
gopls

Installing golang.org/x/tools/gopls FAILED

1 tools failed to install.

gopls:
Error: Command failed: c:\go\bin\go.exe get -v golang.org/x/tools/gopls
go: finding golang.org/x/tools/gopls v0.2.0
go: downloading golang.org/x/tools/gopls v0.2.0
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20191113055240-e33b02e76616
go: extracting golang.org/x/tools/gopls v0.2.0
go: extracting golang.org/x/tools v0.0.0-20191113055240-e33b02e76616
go: downloading golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go: extracting golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go get golang.org/x/tools/gopls: rename d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe.tmp-673560245 d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe: Access is denied.
go: finding golang.org/x/tools/gopls v0.2.0
go: downloading golang.org/x/tools/gopls v0.2.0
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20191113055240-e33b02e76616
go: extracting golang.org/x/tools/gopls v0.2.0
go: extracting golang.org/x/tools v0.0.0-20191113055240-e33b02e76616
go: downloading golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go: extracting golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go get golang.org/x/tools/gopls: rename d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe.tmp-673560245 d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe: Access is denied.

@alfmos
Copy link
Author

alfmos commented Nov 13, 2019

Finally, I have reverted to go 1.12 leaving d:\gocache as gopath, and I have some modules succeding and many others failing:
Using the value d:\gocache from the go.toolsGopath setting.
Installing 13 tools at d:\gocache\bin in module mode.
gocode
gopkgs
go-outline
go-symbols
guru
gorename
goplay
dlv
gocode-gomod
godef
goimports
golint
gopls

Installing github.com/mdempsky/gocode FAILED
Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED
Installing github.com/ramya-rao-a/go-outline SUCCEEDED
Installing github.com/acroca/go-symbols SUCCEEDED
Installing golang.org/x/tools/cmd/guru SUCCEEDED
Installing golang.org/x/tools/cmd/gorename SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv FAILED
Installing github.com/stamblerre/gocode FAILED
Installing github.com/rogpeppe/godef FAILED
Installing golang.org/x/tools/cmd/goimports SUCCEEDED
Installing golang.org/x/lint/golint FAILED
Installing golang.org/x/tools/gopls FAILED

6 tools failed to install.

gocode:
Error: Command failed: c:\go\bin\go.exe get -v github.com/mdempsky/gocode
go: finding github.com/mdempsky/gocode latest
go: downloading github.com/mdempsky/gocode v0.0.0-20190203001940-7fb65232883f
go: extracting github.com/mdempsky/gocode v0.0.0-20190203001940-7fb65232883f
package github.com/mdempsky/gocode: unknown import path "github.com/mdempsky/gocode": rename d:\gocache\pkg\mod\github.com\mdempsky\gocode@v0.0.0-20190203001940-7fb65232883f.tmp-367254985 d:\gocache\pkg\mod\github.com\mdempsky\gocode@v0.0.0-20190203001940-7fb65232883f: Access is denied.
go: finding github.com/mdempsky/gocode latest
go: downloading github.com/mdempsky/gocode v0.0.0-20190203001940-7fb65232883f
go: extracting github.com/mdempsky/gocode v0.0.0-20190203001940-7fb65232883f
package github.com/mdempsky/gocode: unknown import path "github.com/mdempsky/gocode": rename d:\gocache\pkg\mod\github.com\mdempsky\gocode@v0.0.0-20190203001940-7fb65232883f.tmp-367254985 d:\gocache\pkg\mod\github.com\mdempsky\gocode@v0.0.0-20190203001940-7fb65232883f: Access is denied.

dlv:
Error: Command failed: c:\go\bin\go.exe get -v github.com/go-delve/delve/cmd/dlv
go: finding github.com/go-delve/delve/cmd/dlv latest
go: finding github.com/go-delve/delve/cmd latest
go: finding github.com/go-delve/delve v1.3.2
go: downloading github.com/go-delve/delve v1.3.2
go: extracting github.com/go-delve/delve v1.3.2
go get github.com/go-delve/delve/cmd/dlv: rename d:\gocache\pkg\mod\github.com\go-delve\delve@v1.3.2.tmp-870332282 d:\gocache\pkg\mod\github.com\go-delve\delve@v1.3.2: Access is denied.
go: finding github.com/go-delve/delve/cmd/dlv latest
go: finding github.com/go-delve/delve/cmd latest
go: finding github.com/go-delve/delve v1.3.2
go: downloading github.com/go-delve/delve v1.3.2
go: extracting github.com/go-delve/delve v1.3.2
go get github.com/go-delve/delve/cmd/dlv: rename d:\gocache\pkg\mod\github.com\go-delve\delve@v1.3.2.tmp-870332282 d:\gocache\pkg\mod\github.com\go-delve\delve@v1.3.2: Access is denied.

gocode-gomod:
Error: Command failed: c:\go\bin\go.exe get -v -d github.com/stamblerre/gocode
go: finding github.com/stamblerre/gocode v1.0.0
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
get "golang.org/x/tools": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools?go-get=1
go: finding golang.org/x/tools v0.0.0-20191030062658-86caa796c7ab
go: finding github.com/keegancsmith/rpc v1.1.0
go: downloading github.com/stamblerre/gocode v1.0.0
go: extracting github.com/stamblerre/gocode v1.0.0
package github.com/stamblerre/gocode: unknown import path "github.com/stamblerre/gocode": rename d:\gocache\pkg\mod\github.com\stamblerre\gocode@v1.0.0.tmp-161512124 d:\gocache\pkg\mod\github.com\stamblerre\gocode@v1.0.0: Access is denied.
go: finding github.com/stamblerre/gocode v1.0.0
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
get "golang.org/x/tools": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools?go-get=1
go: finding golang.org/x/tools v0.0.0-20191030062658-86caa796c7ab
go: finding github.com/keegancsmith/rpc v1.1.0
go: downloading github.com/stamblerre/gocode v1.0.0
go: extracting github.com/stamblerre/gocode v1.0.0
package github.com/stamblerre/gocode: unknown import path "github.com/stamblerre/gocode": rename d:\gocache\pkg\mod\github.com\stamblerre\gocode@v1.0.0.tmp-161512124 d:\gocache\pkg\mod\github.com\stamblerre\gocode@v1.0.0: Access is denied.

godef:
Error: Command failed: c:\go\bin\go.exe get -v github.com/rogpeppe/godef
go: finding github.com/rogpeppe/godef v1.1.1
Fetching https://golang.org/x/tools?go-get=1
Fetching https://9fans.net/go?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
get "golang.org/x/tools": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools?go-get=1
go: finding golang.org/x/tools v0.0.0-20181130195746-895048a75ecf
Parsing meta tags from https://9fans.net/go?go-get=1 (status code 200)
get "9fans.net/go": found meta tag get.metaImport{Prefix:"9fans.net/go", VCS:"git", RepoRoot:"https://github.com/9fans/go"} at https://9fans.net/go?go-get=1
go: finding 9fans.net/go v0.0.0-20181112161441-237454027057
go: downloading github.com/rogpeppe/godef v1.1.1
go: extracting github.com/rogpeppe/godef v1.1.1
go: downloading golang.org/x/tools v0.0.0-20181130195746-895048a75ecf
go: downloading 9fans.net/go v0.0.0-20181112161441-237454027057
go: extracting 9fans.net/go v0.0.0-20181112161441-237454027057
go: extracting golang.org/x/tools v0.0.0-20181130195746-895048a75ecf
build github.com/rogpeppe/godef: cannot load golang.org/x/tools/go/ast/astutil: rename d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20181130195746-895048a75ecf.tmp-202471880 d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20181130195746-895048a75ecf: Access is denied.
go: finding github.com/rogpeppe/godef v1.1.1
Fetching https://golang.org/x/tools?go-get=1
Fetching https://9fans.net/go?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
get "golang.org/x/tools": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools?go-get=1
go: finding golang.org/x/tools v0.0.0-20181130195746-895048a75ecf
Parsing meta tags from https://9fans.net/go?go-get=1 (status code 200)
get "9fans.net/go": found meta tag get.metaImport{Prefix:"9fans.net/go", VCS:"git", RepoRoot:"https://github.com/9fans/go"} at https://9fans.net/go?go-get=1
go: finding 9fans.net/go v0.0.0-20181112161441-237454027057
go: downloading github.com/rogpeppe/godef v1.1.1
go: extracting github.com/rogpeppe/godef v1.1.1
go: downloading golang.org/x/tools v0.0.0-20181130195746-895048a75ecf
go: downloading 9fans.net/go v0.0.0-20181112161441-237454027057
go: extracting 9fans.net/go v0.0.0-20181112161441-237454027057
go: extracting golang.org/x/tools v0.0.0-20181130195746-895048a75ecf
build github.com/rogpeppe/godef: cannot load golang.org/x/tools/go/ast/astutil: rename d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20181130195746-895048a75ecf.tmp-202471880 d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20181130195746-895048a75ecf: Access is denied.

golint:
Error: Command failed: c:\go\bin\go.exe get -v golang.org/x/lint/golint
Fetching https://golang.org/x/lint/golint?go-get=1
Parsing meta tags from https://golang.org/x/lint/golint?go-get=1 (status code 200)
get "golang.org/x/lint/golint": found meta tag get.metaImport{Prefix:"golang.org/x/lint", VCS:"git", RepoRoot:"https://go.googlesource.com/lint"} at https://golang.org/x/lint/golint?go-get=1
get "golang.org/x/lint/golint": verifying non-authoritative meta tag
Fetching https://golang.org/x/lint?go-get=1
Parsing meta tags from https://golang.org/x/lint?go-get=1 (status code 200)
go: finding golang.org/x/lint/golint latest
Fetching https://golang.org/x/lint?go-get=1
Parsing meta tags from https://golang.org/x/lint?go-get=1 (status code 200)
get "golang.org/x/lint": found meta tag get.metaImport{Prefix:"golang.org/x/lint", VCS:"git", RepoRoot:"https://go.googlesource.com/lint"} at https://golang.org/x/lint?go-get=1
go: finding golang.org/x/lint latest
go: downloading golang.org/x/lint v0.0.0-20190930215403-16217165b5de
go: extracting golang.org/x/lint v0.0.0-20190930215403-16217165b5de
go: downloading golang.org/x/tools v0.0.0-20190311212946-11955173bddd
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
get "golang.org/x/tools": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools?go-get=1
go: extracting golang.org/x/tools v0.0.0-20190311212946-11955173bddd
build golang.org/x/lint/golint: cannot load golang.org/x/tools/go/ast/astutil: rename d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20190311212946-11955173bddd.tmp-984696182 d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20190311212946-11955173bddd: Access is denied.
Fetching https://golang.org/x/lint/golint?go-get=1
Parsing meta tags from https://golang.org/x/lint/golint?go-get=1 (status code 200)
get "golang.org/x/lint/golint": found meta tag get.metaImport{Prefix:"golang.org/x/lint", VCS:"git", RepoRoot:"https://go.googlesource.com/lint"} at https://golang.org/x/lint/golint?go-get=1
get "golang.org/x/lint/golint": verifying non-authoritative meta tag
Fetching https://golang.org/x/lint?go-get=1
Parsing meta tags from https://golang.org/x/lint?go-get=1 (status code 200)
go: finding golang.org/x/lint/golint latest
Fetching https://golang.org/x/lint?go-get=1
Parsing meta tags from https://golang.org/x/lint?go-get=1 (status code 200)
get "golang.org/x/lint": found meta tag get.metaImport{Prefix:"golang.org/x/lint", VCS:"git", RepoRoot:"https://go.googlesource.com/lint"} at https://golang.org/x/lint?go-get=1
go: finding golang.org/x/lint latest
go: downloading golang.org/x/lint v0.0.0-20190930215403-16217165b5de
go: extracting golang.org/x/lint v0.0.0-20190930215403-16217165b5de
go: downloading golang.org/x/tools v0.0.0-20190311212946-11955173bddd
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
get "golang.org/x/tools": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools?go-get=1
go: extracting golang.org/x/tools v0.0.0-20190311212946-11955173bddd
build golang.org/x/lint/golint: cannot load golang.org/x/tools/go/ast/astutil: rename d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20190311212946-11955173bddd.tmp-984696182 d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20190311212946-11955173bddd: Access is denied.

gopls:
Error: Command failed: c:\go\bin\go.exe get -v golang.org/x/tools/gopls
Fetching https://golang.org/x/tools/gopls?go-get=1
Parsing meta tags from https://golang.org/x/tools/gopls?go-get=1 (status code 200)
get "golang.org/x/tools/gopls": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/gopls?go-get=1
get "golang.org/x/tools/gopls": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
go: extracting golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
package golang.org/x/tools/gopls: unknown import path "golang.org/x/tools/gopls": rename d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe.tmp-563455064 d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe: Access is denied.
Fetching https://golang.org/x/tools/gopls?go-get=1
Parsing meta tags from https://golang.org/x/tools/gopls?go-get=1 (status code 200)
get "golang.org/x/tools/gopls": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/gopls?go-get=1
get "golang.org/x/tools/gopls": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
go: extracting golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
package golang.org/x/tools/gopls: unknown import path "golang.org/x/tools/gopls": rename d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe.tmp-563455064 d:\gocache\pkg\mod\golang.org\x\tools@v0.0.0-20191108194844-46f05828f2fe: Access is denied.

@bcmills
Copy link

bcmills commented Nov 13, 2019

@alfmos, what filesystem is your d: drive using?

@alfmos
Copy link
Author

alfmos commented Nov 13, 2019

Ntfs

@bcmills
Copy link

bcmills commented Nov 14, 2019

@alfmos, what (if any) antivirus programs do you have running? (Is it possible that that or a similar local utility is pinning the directory?)

@alfmos
Copy link
Author

alfmos commented Nov 14, 2019

@bcmills I have kaspersky. It seems unlikely to me that it blocks writing on a directory.
Moreover, I installed and upgraded many modules until 1 month ago.
Anyway, I’ll try tomorrow with Kaspersky disabled.
Tell me what could I do to help finding the issue and I will.
I am stuck with go, tools and modules, And I would like to be able to upgrade them.

@alfmos
Copy link
Author

alfmos commented Nov 15, 2019

@bcmills I tried without Kaspersky but no way. Same results

@alfmos
Copy link
Author

alfmos commented Nov 15, 2019

I did another experiment.
I ran
go get -v -u all
from a cmd window. Everything went fine.
Reopening vsCode it complained only about gopls, all modules are seen as updated now.
so I went back to the command line and I ran
c:\go\bin\go.exe get -v -u golang.org/x/tools/gopls
and, surprise, the error is there!

c:\go\bin\go.exe get -v -u golang.org/x/tools/gopls
go: extracting honnef.co/go/tools v0.0.1-2019.2.3
go: finding golang.org/x/tools latest
go: finding golang.org/x/xerrors latest
go: finding golang.org/x/sync latest
go: downloading golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898
go: extracting golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898
go: downloading golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
go: extracting golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
build golang.org/x/tools/gopls: cannot load honnef.co/go/tools/simple: rename d:\go\pkg\mod\honnef.co\go\tools@v0.0.1-2019.2.3.tmp-898147750 d:\go\pkg\mod\honnef.co\go\tools@v0.0.1-2019.2.3: Access is denied.

So maybe I should post the error to the golang repository?
By the way deleting the directory d:\go\pkg\mod\honnef.co\ and relaunching
c:\go\bin\go.exe get -v -u golang.org/x/tools/gopls
solved the issue and now I have everything updated and working with go 1.13.4

@stamblerre
Copy link
Contributor

@alfmos: Glad you were able to update the tools. Just wanted to let you know that you shouldn't use the -u flag with gopls, and VS Code no longer uses it (since it installs tools with GO111MODULE=on for versions of Go >= 1.11). Using -u means that you will get a tool and its dependencies at master, rather than at a specific version. For gopls in particular, you will want to use a tagged version as there may be breakages at master.

@jayconrod
Copy link

Using -u means that you will get a tool and its dependencies at master, rather than at a specific version.

Small correction: with -u, you'll still get the versions of packages you ask for on the command line, but you'll get the latest version of those packages' transitive dependencies. latest means the highest release version, or if there is no release version, the highest pre-release version. You'll only get a pseudo-version for master if there are no tagged versions.

So maybe I should post the error to the golang repository?

@alfmos Feel free to open an issue there, and we can investigate further. I suspect that something is holding a file open in one of the directories being renamed.

@strowk
Copy link

strowk commented Dec 3, 2019

I had this error reproducing a few times

$ GO111MODULE=on go get golang.org/x/tools/gopls@latest
go: extracting honnef.co/go/tools v0.0.1-2019.2.3
build golang.org/x/tools/gopls: cannot load honnef.co/go/tools/simple: rename C:\Users\USER\go\pkg\mod\honnef.co\go\tools@v0.0.1-2019.2.3.tmp-656298690 C:\Users\USER\go\pkg\mod\honnef.co\go\tools@v0.0.1-2019.2.3: Access is denied.

Tried deleting the C:\Users\USER\go\pkg\mod\honnef.co\go\ and running again - same error, while the folder does not even have any files.

History: I had usual installation vscode with gocode and others (working find, but, as you probably guessed - SUPER slowly), so I've seen this tempting suggestion about gopls, expected that it would work faster, but.. I clicked "update", it showed me a lot of 'Access is denied' and eventually that I need to reload window.
I closed and opened it, and a few times I tried to restart vscode - it said that gopls appears to be out of date, updating shows same 'Access is denied' and as far as I can see - all features stopped working intellisense, navigating. Then I tried all lot of workarounds, nothing helped, including running CMD in Adminstrator mode and updating gopls from there.

Eventually at one of the runs, vscode finally did updated gopls and \honnef.co\go\tools@v0.0.1-2019.2.3 appeared.
Sadly I don't really see any speed up. What I did noticed is that files that were perfectly ok before, now started to show 'no package to import', while go build in shell works just fine.

UPD: turned out I needed to open vscode exactly at the folder where go module was located, otherwise gopls does not work. Now navigation and intellisense work BLAZING FAST. I mean compared to the old gocode setup.

I also later noticed that the same 'Access is denied' happened on other modules, like for example 'x/crypto'. And it happened while I've been running 'go build' and these modules were being installed.
So this looks more like go<->Windows random incompatibility issue, than vscode problem.

@stamblerre
Copy link
Contributor

Thanks for the detail, @strowk! I agree that this sounds like an issue with Go and not with VS Code. I will close this issue, but please follow along with golang/go#36568 if this continues to affect you.

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 27, 2020
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

7 participants