{"record":{"id":"63f33e53eaf9d5fa","repo":"GoogleContainerTools/skaffold","slug":"starting-logger-w","errorCode":null,"errorMessage":"starting logger: %w","messagePattern":"starting logger: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/runner/deploy.go","lineNumber":55,"sourceCode":"func (r *SkaffoldRunner) DeployAndLog(ctx context.Context, out io.Writer, artifacts []graph.Artifact, list manifest.ManifestListByConfig) error {\n\tdefer r.deployer.GetLogger().Stop()\n\n\t// Logs should be retrieved up to just before the deploy\n\tr.deployer.GetLogger().SetSince(time.Now())\n\t// First deploy\n\tif err := r.Deploy(ctx, out, artifacts, list); err != nil {\n\t\treturn err\n\t}\n\n\tdefer r.deployer.GetAccessor().Stop()\n\n\tif err := r.deployer.GetAccessor().Start(ctx, out); err != nil {\n\t\tlog.Entry(ctx).Warn(\"Error starting port forwarding:\", err)\n\t}\n\n\t// Start printing the logs after deploy is finished\n\tif err := r.deployer.GetLogger().Start(ctx, out); err != nil {\n\t\treturn fmt.Errorf(\"starting logger: %w\", err)\n\t}\n\n\tif r.runCtx.Tail() || r.runCtx.PortForward() {\n\t\toutput.Yellow.Fprintln(out, \"Press Ctrl+C to exit\")\n\t\t<-ctx.Done()\n\t}\n\n\treturn nil\n}\n\nfunc (r *SkaffoldRunner) Deploy(ctx context.Context, out io.Writer, artifacts []graph.Artifact, list manifest.ManifestListByConfig) error {\n\tdefer r.deployer.GetStatusMonitor().Reset()\n\n\tout, ctx = output.WithEventContext(ctx, out, constants.Deploy, constants.SubtaskIDNone)\n\n\tif len(artifacts) > 0 {\n\t\toutput.Default.Fprintln(out, \"Tags used in deployment:\")\n\t}","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/runner/deploy.go#L37-L73","documentation":"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.","triggerScenarios":"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.","commonSituations":"Cluster connectivity lost mid-session; kubeconfig context pointing at an unreachable cluster; logger unable to open the log stream after port-forward/accessor setup.","solutions":["Check cluster connectivity (`kubectl get pods`) and fix kubeconfig/context","Retry the command — transient API-server errors often resolve on a re-run","Run with `--tail=false`/without log streaming to deploy without the logger if streaming isn't needed"],"exampleFix":"// before\nskaffold dev --kubeconfig /stale/kubeconfig\n// after\nkubectl config use-context prod-context\nskaffold dev","handlingStrategy":"retry","validationCode":"// preflight cluster connectivity\nawait sh(\"kubectl get --raw=/healthz\")","typeGuard":null,"tryCatchPattern":"try {\n  await run('skaffold dev')\n} catch (err) {\n  if (/starting logger/.test(err.message)) {\n    await sleep(2000)\n    await run('skaffold dev') // retry; often a transient cluster/API error\n  } else throw err\n}","preventionTips":["Verify kubeconfig/context health before long dev sessions","Disable log tailing (--tail=false) if only deploy results matter","Keep cluster connection stable (VPN/relay) when streaming logs"],"tags":["deploy","logging","kubernetes"],"backgroundTag":"log-stream-start-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}