GoogleContainerTools/skaffold · error

starting logger: %w

Error message

starting logger: %w

What it means

DeployAndLog deploys and then starts the log streamer. This error wraps a failure from the logger's Start call, which tails container logs after deployment. It means the log streaming component could not be initialized, not that the deploy itself failed.

Source

Thrown at pkg/skaffold/runner/deploy.go:55

func (r *SkaffoldRunner) DeployAndLog(ctx context.Context, out io.Writer, artifacts []graph.Artifact, list manifest.ManifestListByConfig) error {
	defer r.deployer.GetLogger().Stop()

	// Logs should be retrieved up to just before the deploy
	r.deployer.GetLogger().SetSince(time.Now())
	// First deploy
	if err := r.Deploy(ctx, out, artifacts, list); err != nil {
		return err
	}

	defer r.deployer.GetAccessor().Stop()

	if err := r.deployer.GetAccessor().Start(ctx, out); err != nil {
		log.Entry(ctx).Warn("Error starting port forwarding:", err)
	}

	// Start printing the logs after deploy is finished
	if err := r.deployer.GetLogger().Start(ctx, out); err != nil {
		return fmt.Errorf("starting logger: %w", err)
	}

	if r.runCtx.Tail() || r.runCtx.PortForward() {
		output.Yellow.Fprintln(out, "Press Ctrl+C to exit")
		<-ctx.Done()
	}

	return nil
}

func (r *SkaffoldRunner) Deploy(ctx context.Context, out io.Writer, artifacts []graph.Artifact, list manifest.ManifestListByConfig) error {
	defer r.deployer.GetStatusMonitor().Reset()

	out, ctx = output.WithEventContext(ctx, out, constants.Deploy, constants.SubtaskIDNone)

	if len(artifacts) > 0 {
		output.Default.Fprintln(out, "Tags used in deployment:")
	}

View on GitHub (pinned to a1189de023)

Solutions

  1. Check cluster connectivity (`kubectl get pods`) and fix kubeconfig/context
  2. Retry the command — transient API-server errors often resolve on a re-run
  3. Run with `--tail=false`/without log streaming to deploy without the logger if streaming isn't needed

Example fix

// before
skaffold dev --kubeconfig /stale/kubeconfig
// after
kubectl config use-context prod-context
skaffold dev
Defensive patterns

Strategy: retry

Validate before calling

// preflight cluster connectivity
await sh("kubectl get --raw=/healthz")

Try / catch

try {
  await run('skaffold dev')
} catch (err) {
  if (/starting logger/.test(err.message)) {
    await sleep(2000)
    await run('skaffold dev') // retry; often a transient cluster/API error
  } else throw err
}

Prevention

When it happens

Trigger: Calling DeployAndLog (via `skaffold dev`/`run` with logging enabled) where the logger's Start fails — e.g. the Kubernetes log API is unreachable, the cluster connection dropped, or the pod watcher failed to initialize.

Common situations: Cluster connectivity lost mid-session; kubeconfig context pointing at an unreachable cluster; logger unable to open the log stream after port-forward/accessor setup.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/63f33e53eaf9d5fa. Report an issue: GitHub.