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: Sorry, host unauthorized. #20247

Closed
liamnaddell opened this issue May 4, 2017 · 11 comments
Closed

cmd/go: Sorry, host unauthorized. #20247

liamnaddell opened this issue May 4, 2017 · 11 comments

Comments

@liamnaddell
Copy link

liamnaddell commented May 4, 2017

Please answer these questions before submitting your issue. Thanks!

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

1.8.1

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/liam/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hq/v7wjj6rx23ncpg2bp_3zrms80000gn/T/go-build210902941=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

Compiled a binary
The error is on a program I am not allowed to share unfortunately

What did you expect to see?

I don't know since I cannot compile the binary

What did you see instead?

Sorry, host (HARDWAREIDOFSOMESORT) unauthorized.

I am not sure if I should post the hardware Id for security reasons. I installed golang via brew
My OS is a Macbook Pro 13inch.(on apple hardware)

The problem might be with my goarch, but I am not sure, and I do not know how to set it to the right value.

@josharian
Copy link
Contributor

Can you at least show us the invocation (optionally mildly redacted) of the go command that you are using? And also the output if you run it with the -x flag? (go build -x ...)

@josharian josharian changed the title Sorry, host unauthorized. cmd/go: Sorry, host unauthorized. May 4, 2017
@liamnaddell
Copy link
Author

UPDATE: I am using the go-sqlite3 lib

@liamnaddell
Copy link
Author

I am trying to, the errors in the code have changed when I set GOARCH to 386

@liamnaddell
Copy link
Author

I think this is a problem with the go-sqlite3 lib which uses CGO

@liamnaddell
Copy link
Author

liamnaddell commented May 4, 2017

Here is the output when I type go build -x (with goarch set to amd64)

WORK=/var/folders/hq/v7wjj6rx23ncpg2bp_3zrms80000gn/T/go-build951901880
mkdir -p $WORK/github.com/skilstak/sk/cmd/sk/_obj/
mkdir -p $WORK/github.com/skilstak/sk/cmd/sk/_obj/exe/
cd /Users/liam/go/src/github.com/skilstak/sk/cmd/sk
/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64/compile -o $WORK/github.com/skilstak/sk/cmd/sk.a -trimpath $WORK -p main -complete -buildid e09c9ed37e74b8a78957d7fd1ba044970c8ce92a -D _/Users/liam/go/src/github.com/skilstak/sk/cmd/sk -I $WORK -I /Users/liam/go/pkg/darwin_amd64 -pack ./main.go
cd .
/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64/link -o $WORK/github.com/skilstak/sk/cmd/sk/_obj/exe/a.out -L $WORK -L /Users/liam/go/pkg/darwin_amd64 -extld=clang -buildmode=exe -buildid=e09c9ed37e74b8a78957d7fd1ba044970c8ce92a $WORK/github.com/skilstak/sk/cmd/sk.a
mv $WORK/github.com/skilstak/sk/cmd/sk/_obj/exe/a.out sk

And here is the output with GOARCH set to 386

WORK=/var/folders/hq/v7wjj6rx23ncpg2bp_3zrms80000gn/T/go-build361352098
mkdir -p $WORK/github.com/mattn/go-sqlite3/_obj/
mkdir -p $WORK/github.com/mattn/
cd /Users/liam/go/src/github.com/mattn/go-sqlite3
/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64/compile -o $WORK/github.com/mattn/go-sqlite3.a -trimpath $WORK -p github.com/mattn/go-sqlite3 -complete -buildid 243eef54ca2810e6cd70d3740496e335b4080a24 -D _/Users/liam/go/src/github.com/mattn/go-sqlite3 -I $WORK -I /Users/liam/go/pkg/darwin_386 -pack ./doc.go ./sqlite3_go18.go
# github.com/mattn/go-sqlite3
../../../../mattn/go-sqlite3/sqlite3_go18.go:18: undefined: SQLiteConn
../../../../mattn/go-sqlite3/sqlite3_go18.go:26: undefined: SQLiteConn
../../../../mattn/go-sqlite3/sqlite3_go18.go:27: undefined: namedValue
../../../../mattn/go-sqlite3/sqlite3_go18.go:29: undefined: namedValue
../../../../mattn/go-sqlite3/sqlite3_go18.go:35: undefined: SQLiteConn
../../../../mattn/go-sqlite3/sqlite3_go18.go:36: undefined: namedValue
../../../../mattn/go-sqlite3/sqlite3_go18.go:44: undefined: SQLiteConn
../../../../mattn/go-sqlite3/sqlite3_go18.go:49: undefined: SQLiteConn
../../../../mattn/go-sqlite3/sqlite3_go18.go:54: undefined: SQLiteStmt
../../../../mattn/go-sqlite3/sqlite3_go18.go:63: undefined: SQLiteStmt
../../../../mattn/go-sqlite3/sqlite3_go18.go:36: too many errors

@josharian
Copy link
Contributor

I don't see the host unauthorized message in the output you provided.

Please provide the full output for a single run with no GOARCH set, including the error message. You can redact individual bits (like the hardware id, if that's what it is), but the more complete a picture we have, the better we can help. I've never seen a "host unauthorized" message before.

@liamnaddell
Copy link
Author

The host unauthorized part comes when you run the binary

@liamnaddell
Copy link
Author

In go 1.8 the message was Killed:9

@liamnaddell
Copy link
Author

liamnaddell commented May 4, 2017

export GOARCH="" does not change the goarch when I run go env
But when I export goarch to 386, I get new errors in libs that I did not get before
hence the sqlite3 errors posted above.
BTW: the sqlite3 lib has a +build go1.8 flag in it
the file that is causing the problems is right here:
https://github.com/mattn/go-sqlite3/blob/master/sqlite3_go18.go

@bradfitz
Copy link
Contributor

bradfitz commented May 4, 2017

Maybe you have some antivirus software on your machine preventing which binaries you're allowed to run. This might also be an sqlite package problem. In any case, I don't see a Go issue here.

Let's move debugging to the mailing list. See https://golang.org/wiki/Questions.

@bradfitz bradfitz closed this as completed May 4, 2017
@liamnaddell
Copy link
Author

Thank you guys so much

@golang golang locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants