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

x/net: transport.go:598:14: undefined: tls.Dialer #45946

Closed
RobinUS2 opened this issue May 4, 2021 · 13 comments
Closed

x/net: transport.go:598:14: undefined: tls.Dialer #45946

RobinUS2 opened this issue May 4, 2021 · 13 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@RobinUS2
Copy link

RobinUS2 commented May 4, 2021

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

$ go version
go version go1.16.3 darwin/amd64

Does this issue reproduce with the latest release?

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

go env Output
$ go env
go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/robin/Documents/gopath/bin"
GOCACHE="/Users/robin/Library/Caches/go-build"
GOENV="/Users/robin/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="SNIP/gopath/pkg/mod"
GONOPROXY="github.com/SNIP"
GONOSUMDB="github.com/SNIP"
GOOS="darwin"
GOPATH="SNIP/gopath"
GOPRIVATE="github.com/SNIP"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="SNIP/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/k1/_rvgzc7j3wsdt783flh0h9gh0000gp/T/go-build3041542778=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go build .

What did you expect to see?

build go project that used to work before, seems to be a dependency of a dependency

What did you see instead?

vendor/golang.org/x/net/http2/transport.go:598:14: undefined: tls.Dialer

seems to be related to dependency change?

@@ -672,12 +723,11 @@ golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210226101413-39120d07d75e/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
+golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
golang.org/x/net v0.0.0-20210420210106-798c2154c571/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
+golang.org/x/net v0.0.0-20210421230115-4e50805a0758 h1:aEpZnXcAmXkd6AvLb2OPt+EN1Zu/8Ne3pCqPjja5PXY=
golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
-golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20210504132125-bbd867fde50d h1:nTDGCTeAu2LhcsHTRzjyIUbZHCJ4QePArsm27Hka0UM=
-golang.org/x/net v0.0.0-20210504132125-bbd867fde50d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=

@gopherbot gopherbot added this to the Unreleased milestone May 4, 2021
@ALTree
Copy link
Member

ALTree commented May 4, 2021

Possibly related to the recent bumps @bcmills did?

@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 4, 2021
@golang golang deleted a comment from matthewdaltonfanduel May 4, 2021
@ALTree ALTree mentioned this issue May 4, 2021
@RobHumphris
Copy link

I got this with the addition of the version requirement.

../../pkg/mod/golang.org/x/net@v0.0.0-20210504132125-bbd867fde50d/http2/transport.go:598:14: undefined: tls.Dialer
note: module requires Go 1.17```

@seankhliao
Copy link
Member

did you delete your old go installation before an upgrade?

@RobinUS2
Copy link
Author

RobinUS2 commented May 4, 2021

our go builds happen from scratch in a clean environment every time, those are broken too, so not related to a go installation issue I think

@bcmills
Copy link
Contributor

bcmills commented May 4, 2021

The use of tls.Dialer was added in CL 295173.

crypto/tls.Dialer itself was added to the tls package in Go 1.15 for #18482, so I wonder whether the go version reported above (go1.16.3) is actually the version you are using to build the package.

@bcmills
Copy link
Contributor

bcmills commented May 4, 2021

(I suspect that this is a duplicate of #45942.)

@RobinUS2
Copy link
Author

RobinUS2 commented May 4, 2021

hmm good point, build is done locally and then submitted to a Google Cloud Function , which is go 1.13

@deadeyegoodwin
Copy link

We are seeing this failure in an ubuntu 20.04 docker build. Was working ok until a few hours ago. Dockerfile below.

$ docker build .
...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for ca-certificates (20210119~20.04.1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Removing intermediate container 132d09cfb21b
 ---> 1eff09c30229
Step 5/5 : RUN go get github.com/golang/protobuf/protoc-gen-go &&     go get google.golang.org/grpc
 ---> Running in 86323270dc11
# golang.org/x/net/http2
root/go/src/golang.org/x/net/http2/transport.go:598:14: undefined: tls.Dialer
The command '/bin/sh -c go get github.com/golang/protobuf/protoc-gen-go &&     go get google.golang.org/grpc' returned a non-zero code: 2
FROM ubuntu:20.04

ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && apt-get install -y git golang-go

RUN go get github.com/golang/protobuf/protoc-gen-go && \
    go get google.golang.org/grpc

@ianlancetaylor
Copy link
Contributor

The golang.org/x packages generally only support the last two releases of Go, which currently means 1.15 and 1.16. If you want to use the tip x/net package, you must be using at least 1.15. Closing because I don't think there is a bug here.

@deadeyegoodwin
Copy link

deadeyegoodwin commented May 4, 2021

So "go get" of golang.org/x packages is now broken for ubuntu 20.04? Or is there some other recommended pattern when working with a distro that packages an older version of go?

@ianlancetaylor
Copy link
Contributor

If you are using a version of Go earlier than 1.15, then, yes, fetching tip of golang.org/x/net is broken.

There isn't an obvious solution here. We have a stated support policy for the golang.org/x repos (https://golang.org/wiki/X-Repositories). For that matter, we have a stated support policy for Go releases (https://golang.org/doc/devel/release.html#policy). We no longer support the Go 1.14 release, and we no longer support building the golang.org/x repos with the Go 1.14 release. Our support bandwidth is limited, and we have to set some limits.

I don't know what Ubuntu's support policies are. We do provide pre-built Go releases for Ubuntu and other Linux systems at https://golang.org/dl/, and you can of course build Go yourself from source.

@gopherbot
Copy link

Change https://golang.org/cl/317069 mentions this issue: crypto/tls: don't use tls.Dialer on pre-Go1.15 systems

gopherbot pushed a commit to golang/net that referenced this issue May 5, 2021
We have received many reports of build failures using Go 1.14,
enough to make it worth supporting that release even though it
is out of our support window.

For golang/go#45942
For golang/go#45943
For golang/go#45946
For golang/go#45950
For golang/go#45968

Change-Id: I9d6b1762ae622b3e9a5de5b1967264387166b1c7
Reviewed-on: https://go-review.googlesource.com/c/net/+/317069
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
@ianlancetaylor
Copy link
Contributor

Since this came up five times in 24 hours, I went ahead and patches golang.org/x/net so that it will work with versions of Go before 1.15. That should fix this problem. I still strongly encourage everyone to upgrade to a supported version of Go, and I do not promise that this will not break again in the future.

@golang golang locked and limited conversation to collaborators May 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

8 participants