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/releasebot: panic during unlink in prepare mode #33031

Closed
toothrot opened this issue Jul 10, 2019 · 3 comments

Comments

@toothrot
Copy link
Contributor

commented Jul 10, 2019

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

$ go version
go version go1.12.6 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

linux-amd64

What did you do?

$ releasebot --mode=prepare go1.11.12

What did you expect to see?

The release is ready.

What did you see instead?

PANIC: unlinkat /usr/local/google/home/rakoczy/go-releasebot-work/go1.11.12/gopath/pkg/mod/github.com/hashicorp/golang-lru@v0.5.1/doc.go: permission denied

goroutine 1 [running]:
runtime/debug.Stack(0xc05b87b8f8, 0xb07aa0, 0xc015dfbc70)
	/usr/lib/google-golang/src/runtime/debug/stack.go:24 +0x9d
main.(*Work).finally(0xc058719080)
	/tmp/tmp.sEifdHfRi9/pkg/mod/golang.org/x/build@v0.0.0-20190708145551-0fd1ffd8bb5c/cmd/releasebot/main.go:233 +0x65
panic(0xb07aa0, 0xc015dfbc70)
	/usr/lib/google-golang/src/runtime/panic.go:522 +0x1b5
log.(*Logger).Panic(0xc05b8d6b40, 0xc05b87bab8, 0x1, 0x1)
	/usr/lib/google-golang/src/log/log.go:212 +0xaa
main.(*Work).buildReleaseBinary(0xc058719080)
	/tmp/tmp.sEifdHfRi9/pkg/mod/golang.org/x/build@v0.0.0-20190708145551-0fd1ffd8bb5c/cmd/releasebot/main.go:545 +0x12b
main.(*Work).buildReleases(0xc058719080)
	/tmp/tmp.sEifdHfRi9/pkg/mod/golang.org/x/build@v0.0.0-20190708145551-0fd1ffd8bb5c/cmd/releasebot/main.go:556 +0x43
main.(*Work).doRelease(0xc058719080)
	/tmp/tmp.sEifdHfRi9/pkg/mod/golang.org/x/build@v0.0.0-20190708145551-0fd1ffd8bb5c/cmd/releasebot/main.go:343 +0x2b4
main.main.func1(0xc055a25ce0, 0x0, 0x0)
	/tmp/tmp.sEifdHfRi9/pkg/mod/golang.org/x/build@v0.0.0-20190708145551-0fd1ffd8bb5c/cmd/releasebot/main.go:111 +0x178
golang.org/x/build/maintner.(*GitHubRepo).ForeachMilestone(0xc0025d4180, 0xc05b87bf50, 0xc344dc, 0x2)
	/tmp/tmp.sEifdHfRi9/pkg/mod/golang.org/x/build@v0.0.0-20190708145551-0fd1ffd8bb5c/maintner/github.go:139 +0x9f
main.main()
	/tmp/tmp.sEifdHfRi9/pkg/mod/golang.org/x/build@v0.0.0-20190708145551-0fd1ffd8bb5c/cmd/releasebot/main.go:98 +0x503

Full log:
#32982 (comment)

When starting a --mode=prepare release, the GOPATH cleanup step for buildReleaseBinary() can fail with a permission error

releasebot should not fail to remove the files. It could use go clean -modcache if operating in module mode, or recursively change permissions in the directory path before removal.

@toothrot toothrot added this to the Unreleased milestone Jul 10, 2019

@toothrot toothrot changed the title x/build/cmd/releasebot: panic during unlink x/build/cmd/releasebot: panic during unlink in prepare mode Jul 10, 2019

@toothrot

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2019

@dmitshur Is this still an issue after your changes to releasebot?

@dmitshur

This comment has been minimized.

Copy link
Member

commented Sep 5, 2019

I looked, this is still an issue on master.

In the short term, we should fix the panic by enforcing GOPATH mode for the go get golang.org/x/build/cmd/release step, since that's how it has been used and tested the most in the past.

Afterwards, as we do the work to make golang.org/x/build/cmd/release installation happen in module mode, we should keep this pitfall in mind and avoid using os.RemoveAll on GOPATH workspaces that have been used in module mode.

Worth noting is that once we're building golang.org/x/build/cmd/release in module mode, it might not be necessary to create a temporary GOPATH workspace, we could just use the default one. The temporary GOPATH workspace was necessary when the release command was built in GOPATH mode as a way of ensuring a clean, latest version was installed, but the go.mod file can solve versioning more easily for us.

@dmitshur dmitshur added NeedsFix and removed NeedsInvestigation labels Sep 5, 2019

@dmitshur dmitshur self-assigned this Sep 5, 2019

@gopherbot

This comment has been minimized.

Copy link

commented Sep 5, 2019

Change https://golang.org/cl/193720 mentions this issue: cmd/releasebot: set GO111MODULE=off for go get .../cmd/release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.