GoogleContainerTools/skaffold · error
StatusCode_LOG_STREAM_RUN_GCLOUD_NOT_FOUND
StatusCode_LOG_STREAM_RUN_GCLOUD_NOT_FOUND
Error message
gcloud not found
What it means
Skaffold's Cloud Run log tailer requires the Google Cloud CLI (`gcloud`) to set up port forwarding for Cloud Run services. Before starting the log stream, `runLogTailer.Start` checks whether `gcloud` is on the PATH; if not, it prints a message to the output writer and fails with StatusCode_LOG_STREAM_RUN_GCLOUD_NOT_FOUND. This is an environment prerequisite error, not a code bug.
Source
Thrown at pkg/skaffold/deploy/cloudrun/log.go:148
}
}
return nil
}
func (r *LogAggregator) Stop() {
for _, logTailer := range r.logTailers {
logTailer.Stop()
}
}
type runLogTailer struct {
resources *loggerTracker
}
func (r *runLogTailer) Start(ctx context.Context, out io.Writer) error {
if !gcloudInstalled() {
output.Red.Fprintln(out, "gcloud not found on path. Unable to set up Cloud Run port forwarding")
return sErrors.NewError(fmt.Errorf("gcloud not found"), &proto.ActionableErr{ErrCode: proto.StatusCode_LOG_STREAM_RUN_GCLOUD_NOT_FOUND})
}
if r.resources.resources == nil {
return nil
}
syncOut := &syncWriter{w: out}
go func() {
for _, resource := range r.resources.resources {
if !resource.isTailing {
cctx, cancel := context.WithCancel(ctx)
cmd := exec.CommandContext(cctx, "gcloud", getGcloudTailArgs(resource.name)...)
cmd.Env = os.Environ()
// gcloud uses buffered stream by default
cmd.Env = append(cmd.Env, "PYTHONUNBUFFERED=1") // gcloud defaults streaming output as buffered
pr, pw := io.Pipe()
cmd.Stderr = pw
cmd.Stdout = pw
resource.cancel = cancel
if err := cmd.Start(); err != nil {View on GitHub (pinned to a1189de023)
Solutions
- Install the Google Cloud CLI (https://cloud.google.com/sdk/docs/install) so `gcloud` is on the PATH
- If already installed, add its bin directory to PATH (e.g. `export PATH=$PATH:/usr/local/google-cloud-sdk/bin`) and re-run
- If log tailing is not needed, disable Cloud Run port-forwarding/log-streaming options (e.g. `--port-forward` off) to avoid the tailer
- In CI, use a Google Cloud base image or add a gcloud install step before running skaffold
Example fix
// before (Dockerfile/CI without gcloud)
FROM golang:1.21
RUN skaffold deploy --cloudrun ...
// after
FROM golang:1.21
RUN curl https://sdk.cloud.google.com | bash > /dev/null && \
mv google-cloud-sdk /usr/local/ && \
ln -s /usr/local/google-cloud-sdk/bin/gcloud /usr/local/bin/gcloud Defensive patterns
Strategy: validation
Validate before calling
if _, err := exec.LookPath("gcloud"); err != nil {
// install Google Cloud SDK or add gcloud to PATH before invoking skaffold
}
Prevention
- Install Google Cloud SDK in every environment (dev machine, CI image, devcontainer) that runs Cloud Run deploys
- Add a preflight PATH check for gcloud in CI pipelines before invoking skaffold
- Pin gcloud installation in Dockerfiles and symlink into /usr/local/bin
When it happens
Trigger: Running `skaffold run/dev/deploy` with a Cloud Run deployer (`deploy.cloudrun`) when the `gcloud` binary is not installed or is not on the PATH. Start() is invoked by the deploy loop to tail logs and set up port forwarding.
Common situations: Developer machine without Google Cloud SDK installed; gcloud installed but PATH not updated (e.g. installed via apt to a nonstandard location); running inside a CI container image lacking gcloud; using a minimal devcontainer.
Related errors
- unable to lookup minikube executable. Please add it to PATH
- strings.Join(errMsgs, "\n") (joined helm cleanup error messa
- failed to deploy: %w
- getting minikube executable: %w
- unable to find minikube executable. File not found %s
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/bb141ffef64afeb7.
Report an issue: GitHub.