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

terraform vsphere provider on arm32 tries IPv6 to resolve the hostname and fails #636

Closed
arno01 opened this issue Oct 8, 2018 · 3 comments

Comments

@arno01
Copy link

arno01 commented Oct 8, 2018

Terraform/vSphere Provider Version

Terraform v0.11.8
+ provider.vsphere v1.8.1

Debug Output

Short:

* provider.vsphere: error setting up new vSphere SOAP client: Post https://mysite.com/sdk: dial tcp: lookup mysite.com on [::1]:53: read udp [::1]:36389->[::1]:53: read: connection refused

Long https://gist.github.com/arno01/68b49dd79c6813788e590f7088d62dc3

Expected Behavior

terraform should not struggle resolving the hostname.

Actual Behavior

terraform tries IPv6 to resolve the hostname and fails.

Steps to Reproduce

  1. terraform plan

Important Factoids

I think the issue lies down to how DNS resolution is implemented in the Golang as I came across the same exact issue with the minio client arm64 build minio/mc#2564

@arno01
Copy link
Author

arno01 commented Oct 8, 2018

Interesting. The above issue is gone when I am building v1.8.1 terraform-provider-vsphere directly in my Android.

go env

$ go env
GOARCH="arm64"
GOBIN=""
GOCACHE="/data/data/com.termux/files/home/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="android"
GOOS="android"
GOPATH="/data/data/com.termux/files/home/go"
GOPROXY=""
GORACE=""
GOROOT="/data/data/com.termux/files/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/data/data/com.termux/files/usr/lib/go/pkg/tool/android_arm64"
GCCGO="gccgo"
CC="aarch64-linux-android-clang"
CXX="aarch64-linux-android-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="/home/builder/.termux-build/_cache/18-aarch64-21-v1/bin/aarch64-linux-android-pkg-config"
GOGCCFLAGS="-fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/data/data/com.termux/files/usr/tmp/go-build226764631=/tmp/go-build -gno-record-gcc-switches"

Maybe this has something to do that I am having CGO_ENABLED=1 flag?
https://golang.org/pkg/net/#hdr-Name_Resolution

@arno01
Copy link
Author

arno01 commented Oct 8, 2018

I think this has something to do with golang/go#25321

Go (go resolver, not the Cgo one) prefers the IPv6 address over the IPv4 address and does not fall back to the IPv4 address if IPv6 is disabled.

So the right way would be to build for ARM with CGO enabled.

@bill-rich
Copy link
Contributor

I think you're correct there. Thanks for following up with the solution. I'll get this issue closed.

@ghost ghost locked and limited conversation to collaborators Apr 18, 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

2 participants