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

toothrot opened this issue Jul 10, 2019 · 3 comments


Copy link

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?


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


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/ permission denied

goroutine 1 [running]:
runtime/debug.Stack(0xc05b87b8f8, 0xb07aa0, 0xc015dfbc70)
	/usr/lib/google-golang/src/runtime/debug/stack.go:24 +0x9d
	/tmp/tmp.sEifdHfRi9/pkg/mod/ +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
	/tmp/tmp.sEifdHfRi9/pkg/mod/ +0x12b
	/tmp/tmp.sEifdHfRi9/pkg/mod/ +0x43
	/tmp/tmp.sEifdHfRi9/pkg/mod/ +0x2b4
main.main.func1(0xc055a25ce0, 0x0, 0x0)
	/tmp/tmp.sEifdHfRi9/pkg/mod/ +0x178*GitHubRepo).ForeachMilestone(0xc0025d4180, 0xc05b87bf50, 0xc344dc, 0x2)
	/tmp/tmp.sEifdHfRi9/pkg/mod/ +0x9f
	/tmp/tmp.sEifdHfRi9/pkg/mod/ +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


This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2019

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


This comment has been minimized.

Copy link

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 step, since that's how it has been used and tested the most in the past.

Afterwards, as we do the work to make 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 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


This comment has been minimized.

Copy link

commented Sep 5, 2019

Change 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
None yet
3 participants
You can’t perform that action at this time.