Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: 'Access is denied' when renaming module cache directory #36568

Open
kiwionly opened this issue Jan 15, 2020 · 3 comments
Open

cmd/go: 'Access is denied' when renaming module cache directory #36568

kiwionly opened this issue Jan 15, 2020 · 3 comments

Comments

@kiwionly
Copy link

@kiwionly kiwionly commented Jan 15, 2020

What version of Go are you using (go version)?

13.6

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

Window 10, intel

go env Output
$ go env

What did you do?

I had a mod file which is 1.13

When I run go build, it download the dependency, however, it end with error like this. e.g.

cannot load golang.org/x/net/html: rename C:\Users\502380\go\pkg\mod\golang.org\x\net@v0.0.0-20190620200207-3b0461eec859.tmp-839788141 C:\Users\502380\go\pkg\mod\golang.org\x\net@v0.0.0-20190620200207-3b0461eec859:

What did you expect to see?

build should successful without any error.

What did you see instead?

#This is running in jetbrain goland

go: extracting golang.org/x/net v0.0.0-20190620200207-3b0461eec859
build command-line-arguments: cannot load golang.org/x/net/html: rename C:\Users\502380\go\pkg\mod\golang.org\x\net@v0.0.0-20190620200207-3b0461eec859.tmp-839788141 C:\Users\502380\go\pkg\mod\golang.org\x\net@v0.0.0-20190620200207-3b0461eec859: Access is denied.

@kiwionly kiwionly changed the title Cannot rename dependency mod from name@version.tmp-xxx to name@version Cannot build: when rename dependency mod from name@version.tmp-xxx to name@version, fail Jan 15, 2020
@cagedmantis cagedmantis changed the title Cannot build: when rename dependency mod from name@version.tmp-xxx to name@version, fail cmd/go: Cannot build: when rename dependency mod from name@version.tmp-xxx to name@version, fail Jan 15, 2020
@cagedmantis cagedmantis added this to the Backlog milestone Jan 16, 2020
@cagedmantis cagedmantis changed the title cmd/go: Cannot build: when rename dependency mod from name@version.tmp-xxx to name@version, fail cmd/go: cannot build when rename dependency mod from name@version.tmp-xxx to name@version Jan 16, 2020
@cagedmantis

This comment has been minimized.

Copy link
Contributor

@cagedmantis cagedmantis commented Jan 16, 2020

@kiwionly Could you provide an example of the code that produced the error, preferably as a Go playground link?

@jayconrod

This comment has been minimized.

Copy link
Contributor

@jayconrod jayconrod commented Jan 16, 2020

Seems like the same issue as microsoft/vscode-go#2897. We've never been able to reproduce this.

Could you post a listing of the directory C:\Users\502380\go\pkg\mod\golang.org\x\?
Are you able to reproduce this or did it just happen once? How about after clearing the module cache with go clean -modcache?

@jayconrod jayconrod changed the title cmd/go: cannot build when rename dependency mod from name@version.tmp-xxx to name@version cmd/go: ' Jan 16, 2020
@jayconrod jayconrod changed the title cmd/go: ' cmd/go: 'Access is denied' when renaming module cache directory Jan 16, 2020
@kiwionly

This comment has been minimized.

Copy link
Author

@kiwionly kiwionly commented Jan 17, 2020

@cagedmantis @jayconrod I am doing go build with module using Jetbrain Goland, some how command prompt also able to produce the error.

Note that my application contain a lot of dependency, and i need to rerun > go build , sometime it success, sometime it will fail with error message below ( depend on the package, some package will have issue, then I run go build again, no more issue/)

Here is the error when running in command prompt using go get, but actually the error is same ( except go build is loading a lot of dependency compare to go get below, but github.com/go-playground/locales is the one that always fail )

C:\Users\502380\GolandProjects\myproject>go get github.com/go-playground/universal-translator
go: finding github.com/go-playground/universal-translator v0.17.0
go: downloading github.com/go-playground/universal-translator v0.17.0
go: extracting github.com/go-playground/universal-translator v0.17.0
go: downloading github.com/go-playground/locales v0.13.0
go: extracting github.com/go-playground/locales v0.13.0
..\..\go\pkg\mod\github.com\go-playground\universal-translator@v0.17.0\errors.go:7:2: rename C:\Users\502380\go\pkg\mod\github.com\go-playground\locales@v0.13.0.tmp-022886503
 C:\Users\502380\go\pkg\mod\github.com\go-playground\locales@v0.13.0: Access is denied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.