Skip to content

go: writing stat cache:, permission denied #26814

@zongUMR

Description

@zongUMR

Please answer these questions before submitting your issue. Thanks!

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

go version go1.11beta2 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/zongmeng/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/zongmeng/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/66/h198vsq94gjbzhkj2vbg1rqr0000gn/T/go-build558650207=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

I have a simple project that uses go mod. when I open the project in VSCode, it show the follow error for me:

go: finding github.com/gin-gonic/gin v1.1.4
go: finding github.com/golang/protobuf v1.1.0
go: finding github.com/mattn/go-isatty v0.0.3
go: finding github.com/fatih/structs v1.0.0
go: finding github.com/manucorporat/sse v0.0.0-20160126180136-ee05b128a739
go: writing stat cache: open /User/zongmeng/go/src/mod/cache/download/github.com/manucorporat/sse/@v/v0.0.0-20160126180136-ee05b128a739.info.tmp-461144603: permission denied
go: writing stat cache: open /User/zongmeng/go/src/mod/cache/download/github.com/gin-gonic/gin/@v/v1.1.4.info.tmp-063973566: permission denied
go: writing stat cache: open /User/zongmeng/go/src/mod/cache/download/github.com/golang/protobuf/@v/v1.1.0.info.tmp-237748485: permission denied
go: writing stat cache: open /User/zongmeng/go/src/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.3.info.tmp-024245408: permission denied
go: writing stat cache: open /User/zongmeng/go/src/mod/cache/download/github.com/fatih/structs/@v/v1.0.0.info.tmp-128475519: permission denied
go: writing go.mod cache: open /User/zongmeng/go/src/mod/cache/download/github.com/gin-gonic/gin/@v/v1.1.4.mod.tmp-010532562: permission denied
go: writing go.mod cache: open /User/zongmeng/go/src/mod/cache/download/github.com/manucorporat/sse/@v/v0.0.0-20160126180136-ee05b128a739.mod.tmp-504665609: permission denied
go: writing go.mod cache: open /User/zongmeng/go/src/mod/cache/download/github.com/golang/protobuf/@v/v1.1.0.mod.tmp-027138004: permission denied
go: writing go.mod cache: open /User/zongmeng/go/src/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.3.mod.tmp-102994211: permission denied
go: writing go.mod cache: open /User/zongmeng/go/src/mod/cache/download/github.com/fatih/structs/@v/v1.0.0.mod.tmp-207383078: permission denied
go: finding gopkg.in/yaml.v2 v2.2.1
go: writing stat cache: open /User/zongmeng/go/src/mod/cache/download/gopkg.in/yaml.v2/@v/v2.2.1.info.tmp-428832589: permission denied
go: writing go.mod cache: open /User/zongmeng/go/src/mod/cache/download/gopkg.in/yaml.v2/@v/v2.2.1.mod.tmp-323851336: permission denied
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: finding gopkg.in/go-playground/validator.v8 v8.18.2
go: writing stat cache: open /User/zongmeng/go/src/mod/cache/download/gopkg.in/check.v1/@v/v0.0.0-20161208181325-20d25e280405.info.tmp-817140487: permission denied
go: writing stat cache: open /User/zongmeng/go/src/mod/cache/download/gopkg.in/go-playground/validator.v8/@v/v8.18.2.info.tmp-273428666: permission denied
go: writing go.mod cache: open /User/zongmeng/go/src/mod/cache/download/gopkg.in/check.v1/@v/v0.0.0-20161208181325-20d25e280405.mod.tmp-604255953: permission denied
go: writing go.mod cache: open /User/zongmeng/go/src/mod/cache/download/gopkg.in/go-playground/validator.v8/@v/v8.18.2.mod.tmp-086728188: permission denied
go: golang.org/x/net@v0.0.0-20180801234040-f4c29de78a2a: unrecognized import path "golang.org/x/net" (https fetch: Get https://golang.org/x/net?go-get=1: dial tcp 172.217.194.141:443: i/o timeout)
go: error loading module requirements

I got into this first wrong dictionary/User/zongmeng/go/src/mod/cache/download/github.com/manucorporat/sse/@v and check its permission:
ls -l, it shows:
screen shot 2018-08-05 at 4 41 55 pm
)

Other problem is same

What did you expect to see?

What did you see instead?

As the image shows, the two files don't have enough permission. They were created by go mod automatucally. I am not sure that is normal or not

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions