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: can't ssh to x_tools-gotip-netbsd-arm64 gomote #70163

Closed
ianlancetaylor opened this issue Nov 1, 2024 · 7 comments
Closed

x/build: can't ssh to x_tools-gotip-netbsd-arm64 gomote #70163

ianlancetaylor opened this issue Nov 1, 2024 · 7 comments
Labels
Builders x/build issues (builders, bots, dashboards) DevExp anything around developer experience NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@ianlancetaylor
Copy link
Member

ianlancetaylor commented Nov 1, 2024

Go version

HEAD

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/iant/.cache/go-build'
GOENV='/home/iant/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/iant/gopath/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/iant/gopath'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org'
GOROOT='/home/iant/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/iant/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.24-bae2e968e2 Mon Sep 30 22:04:40 2024 +0000'
GODEBUG=''
GOTELEMETRY='on'
GOTELEMETRYDIR='/home/iant/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/iant/gopath/src/golang.org/x/tools/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4106496375=/tmp/go-build -gno-record-gcc-switches'

What did you do?

> gomote create x_tools-gotip-netbsd-arm64
> gomote ssh iant-x_tools-gotip-netbsd-arm64-0

What did you see happen?

unable to start shell "": exec: no command

What did you expect to see?

I expected to be connected to the gomote

CC @golang/release

@ianlancetaylor
Copy link
Member Author

CC @golang/release

@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Nov 1, 2024
@gopherbot gopherbot added this to the Unreleased milestone Nov 1, 2024
@ianlancetaylor
Copy link
Member Author

The same happens for a plain gotip-netbsd-arm64 gomote.

@dmitshur
Copy link
Contributor

dmitshur commented Nov 2, 2024

Thanks for reporting. Also CC @golang/netbsd.

ssh.go#L52 calls shell() to determine the command name, and on GOOS=netbsd, its implementation returns whatever the SHELL environment variable is set to:

https://cs.opensource.google/go/x/build/+/master:cmd/buildlet/buildlet.go;l=2041-2042;drc=0d31c9b6e4b5ca7b9505a983bd19ae246447f8ad

Unsurprisingly given the error, that environment variable isn't currently set on this builder:

$ gomote run $USER-gotip-netbsd-arm64-0 env | grep SHELL | wc -l
       0

I see that bash is available on the builder, and in PATH, so setting SHELL to bash in the environment of the swarming client might be all that's needed to let gomote ssh work on this builder. CC @bsiegert as the builder owner who would need to make that change.

An (inconvenient) workaround is to use gomote run, e.g.:

$ gomote run -system $USER-gotip-netbsd-arm64-0 bash -c 'echo test'
test

@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 2, 2024
@dmitshur dmitshur added the DevExp anything around developer experience label Nov 2, 2024
@bsiegert
Copy link
Contributor

bsiegert commented Nov 2, 2024

I can set the SHELL environment variable. There is at least bash and ksh available.

bsiegert added a commit to bsiegert/gobuilder-netbsd that referenced this issue Nov 2, 2024
@ianlancetaylor
Copy link
Member Author

Can we change the shell function to return a reasonable default if SHELL is not set in the environment? Using /bin/sh would be far better than completely failing.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/624796 mentions this issue: cmd/buildlet: set a safe default for shell

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) DevExp anything around developer experience NeedsFix The path to resolution is known, but the work has not been done.
Projects
Status: Done
Development

No branches or pull requests

5 participants