For each of the following invocations:

go run retrybuilds.go -builder freebsd-arm-paulzhol -key ~/path/to/key -branch release-branch.go1.11 -loghash e46f527e53acd7ec0053e9bbcf5ade31024faa72
go run retrybuilds.go -builder host-freebsd-arm-paulzhol -key ~/path/to/key -branch release-branch.go1.11 -loghash e46f527e53acd7ec0053e9bbcf5ade31024faa72
go run retrybuilds.go -builder typo-host-freebsd-arm-paulzhol -key ~/path/to/key -branch release-branch.go1.11 -loghash e46f527e53acd7ec0053e9bbcf5ade31024faa72

Dashboard responds with:

2018/08/17 13:51:51 Clearing freebsd-arm-paulzhol, hash 807e7f2420c683384dc9c6db498808ba1b7aab17
2018/08/17 13:51:52 Dashboard error: invalid key "XXXXXXXXXXXXXXXXXXXX" for builder "freebsd-arm-paulzhol"
exit status 1

The reason for the authentication failure is that the https://build.golang.org/?mode=failures&branch=release-branch.go1.11 endpoint used internally by the failures() function returns an old-style builder name (freebsd-arm-paulzhol instead of host-freebsd-arm-paulzhol):

807e7f2420c683384dc9c6db498808ba1b7aab17 darwin-amd64-10_10 https://build.golang.org/log/5bb9038d7ab8345880bc9801458b11943ef360b4
807e7f2420c683384dc9c6db498808ba1b7aab17 freebsd-arm-paulzhol https://build.golang.org/log/e46f527e53acd7ec0053e9bbcf5ade31024faa72
807e7f2420c683384dc9c6db498808ba1b7aab17 linux-amd64-longtest https://build.golang.org/log/d33696be77944dc640a4b2e269e496f7f939e982
807e7f2420c683384dc9c6db498808ba1b7aab17 linux-amd64-nocgo https://build.golang.org/log/772e6432980b375acc5c1c56388f8beb22444039
807e7f2420c683384dc9c6db498808ba1b7aab17 linux-ppc64-buildlet https://build.golang.org/log/5b26c2423570dd4ef45a31c4c22181709dfa0552
807e7f2420c683384dc9c6db498808ba1b7aab17 windows-arm https://build.golang.org/log/90e43643ee340cb455cbf940cf25f738eb80652f
807e7f2420c683384dc9c6db498808ba1b7aab17 plan9-386 https://build.golang.org/log/8a8b44a262f70706831d9ca00d6f1adfb1be21f4

While the correct builder name is needed to verify the key: https://github.com/golang/build/blob/ef878539c7d7b3c385a0670fa85bad3878fcc879/app/appengine/handler.go#L1020-L1024

Note that if the -loghash is not used, but the commit hash is specified directly with -hash then the command line -builder argument is used correctly and the /?mode=failures endpoint is not consulted.

/cc @bradfitz

Comment From: paulzhol

As a quick fix, replacing the builder name returned from failures() with *builder should work. But maybe something like mapBuilderToHostType https://github.com/golang/build/blob/64a630379a90769340966d6de6b38db589132909/cmd/coordinator/reverse.go#L606 needs to be called either on the client side of retrybuild or in the Dashboard AuthHandler instead.

Comment From: bradfitz

/cc @dmitshur

Comment From: gopherbot

Change https://go.dev/cl/600855 mentions this issue: retrybuilds: rewrite tool to support LUCI