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/build/cmd/retrybuilds: ignores -builder argument when -loghash is specified #27055

Open
paulzhol opened this issue Aug 17, 2018 · 2 comments
Open
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@paulzhol
Copy link
Member

paulzhol commented Aug 17, 2018

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

@paulzhol paulzhol added the Builders x/build issues (builders, bots, dashboards) label Aug 17, 2018
@paulzhol
Copy link
Member Author

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.

@bradfitz bradfitz changed the title golang.org/x/build/cmd/retrybuilds: ignores -builder argument when -loghash is specified x/build/cmd/retrybuilds: ignores -builder argument when -loghash is specified Aug 17, 2018
@gopherbot gopherbot added this to the Unreleased milestone Aug 17, 2018
@bradfitz
Copy link
Contributor

/cc @dmitshur

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) 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

4 participants