Tidb: Unrecognized import path "golang.org/x/

Created on 24 Dec 2018  Â·  8Comments  Â·  Source: pingcap/tidb

When I run:

make server


I got following error message. I was struggling to find why the error happens.

CGO_ENABLED=0 GO111MODULE=on go build -ldflags '-X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=v2.1.0-rc.3-352-g20a468d55" -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=2018-12-24 01:40:02" -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=20a468d558505d4643ce38fa59fa7884099b5a08" -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=myfeature" -X "github.com/pingcap/tidb/util/printer.GoVersion=go version go1.11.4 darwin/amd64" ' -o bin/tidb-server tidb-server/main.go go: finding github.com/stretchr/testify v1.2.2 go: finding github.com/stretchr/objx v0.1.1 go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/sync" (https fetch: Get https://golang.org/x/sync?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/net" (https fetch: Get https://golang.org/x/net?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: google.golang.org/[email protected]: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/net" (https fetch: Get https://golang.org/x/net?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/net" (https fetch: Get https://golang.org/x/net?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: google.golang.org/[email protected]: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/text" (https fetch: Get https://golang.org/x/text?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/text" (https fetch: Get https://golang.org/x/text?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/tools" (https fetch: Get https://golang.org/x/tools?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/tools" (https fetch: Get https://golang.org/x/tools?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: finding github.com/davecgh/go-spew v1.1.1 go: finding github.com/konsorten/go-windows-terminal-sequences v1.0.1 go: finding github.com/pmezard/go-difflib v1.0.0 go: google.golang.org/[email protected]: unrecognized import path "google.golang.org/genproto" (https fetch: Get https://google.golang.org/genproto?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/crypto" (https fetch: Get https://golang.org/x/crypto?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/time" (https fetch: Get https://golang.org/x/time?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: error loading module requirements make: *** [server] Error 1

typquestion

Most helpful comment

try to setup a proxy, it worked for me.

export GOPROXY=https://goproxy.io

All 8 comments

@Frankjunyulin I think it has something to do with your network. You can try to set the HTTP_PROXY to access the golang.org.

met the same problem.. Even if I downloaded these packages manually from Mirror library in GitHub.
@lamxTyler What if l haven't a proxy?

@Rosmeee unfortunately, there is no way for now. Please setup a proxy.

I am in China

I add some replace to go.mod and success

replace (
cloud.google.com/go => github.com/googleapis/google-cloud-go v0.39.0
go.etcd.io/bbolt v1.3.2 => github.com/etcd-io/bbolt v1.3.2
go.etcd.io/etcd v3.3.13+incompatible => github.com/etcd-io/etcd v3.3.13+incompatible
go.opencensus.io => github.com/census-instrumentation/opencensus-go v0.21.0
go.uber.org/atomic v1.3.2 => github.com/uber-go/atomic v1.3.2
go.uber.org/multierr => github.com/uber-go/multierr v1.1.1-0.20190429210458-bd075f90b08f
go.uber.org/zap v1.9.1 => github.com/uber-go/zap v1.9.1
golang.org/x/crypto => github.com/golang/crypto v0.0.0-20190605123033-f99c8df09eb5
golang.org/x/exp => github.com/golang/exp v0.0.0-20190510132918-efd6b22b2522
golang.org/x/image => github.com/golang/image v0.0.0-20190523035834-f03afa92d3ff
golang.org/x/lint => github.com/golang/lint v0.0.0-20190409202823-959b441ac422
golang.org/x/mobile => github.com/golang/mobile v0.0.0-20190509164839-32b2708ab171
golang.org/x/net => github.com/golang/net v0.0.0-20190603091049-60506f45cf65
golang.org/x/oauth2 => github.com/golang/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sync => github.com/golang/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys => github.com/golang/sys v0.0.0-20190602015325-4c4f7f33c9ed
golang.org/x/text => github.com/golang/text v0.3.2
golang.org/x/time => github.com/golang/time v0.0.0-20190308202827-9d24e82272b4
golang.org/x/tools => github.com/golang/tools v0.0.0-20190606050223-4d9ae51c2468
google.golang.org/api => github.com/googleapis/google-api-go-client v0.5.0
google.golang.org/appengine => github.com/golang/appengine v1.6.0
google.golang.org/genproto => github.com/google/go-genproto v0.0.0-20190605220351-eb0b1bdb6ae6
google.golang.org/grpc => github.com/grpc/grpc-go v1.21.1
)

I am in China

I add some replace to go.mod and success

replace (
cloud.google.com/go => github.com/googleapis/google-cloud-go v0.39.0
go.etcd.io/bbolt v1.3.2 => github.com/etcd-io/bbolt v1.3.2
go.etcd.io/etcd v3.3.13+incompatible => github.com/etcd-io/etcd v3.3.13+incompatible
go.opencensus.io => github.com/census-instrumentation/opencensus-go v0.21.0
go.uber.org/atomic v1.3.2 => github.com/uber-go/atomic v1.3.2
go.uber.org/multierr => github.com/uber-go/multierr v1.1.1-0.20190429210458-bd075f90b08f
go.uber.org/zap v1.9.1 => github.com/uber-go/zap v1.9.1
golang.org/x/crypto => github.com/golang/crypto v0.0.0-20190605123033-f99c8df09eb5
golang.org/x/exp => github.com/golang/exp v0.0.0-20190510132918-efd6b22b2522
golang.org/x/image => github.com/golang/image v0.0.0-20190523035834-f03afa92d3ff
golang.org/x/lint => github.com/golang/lint v0.0.0-20190409202823-959b441ac422
golang.org/x/mobile => github.com/golang/mobile v0.0.0-20190509164839-32b2708ab171
golang.org/x/net => github.com/golang/net v0.0.0-20190603091049-60506f45cf65
golang.org/x/oauth2 => github.com/golang/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sync => github.com/golang/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys => github.com/golang/sys v0.0.0-20190602015325-4c4f7f33c9ed
golang.org/x/text => github.com/golang/text v0.3.2
golang.org/x/time => github.com/golang/time v0.0.0-20190308202827-9d24e82272b4
golang.org/x/tools => github.com/golang/tools v0.0.0-20190606050223-4d9ae51c2468
google.golang.org/api => github.com/googleapis/google-api-go-client v0.5.0
google.golang.org/appengine => github.com/golang/appengine v1.6.0
google.golang.org/genproto => github.com/google/go-genproto v0.0.0-20190605220351-eb0b1bdb6ae6
google.golang.org/grpc => github.com/grpc/grpc-go v1.21.1
)
the same to you

try to setup a proxy, it worked for me.

export GOPROXY=https://goproxy.io

GOPROXY is a good chioce……

Thanks for all answers

Was this page helpful?
0 / 5 - 0 ratings