GoogleContainerTools/skaffold · error
starting logger: %w
Error message
starting logger: %w
What it means
VerifyAndLog starts the verify run's log streamer before executing verify tests so test logs are captured. If the verifier's logger fails to start (e.g. cannot initialize its output stream or connection), the error is wrapped as "starting logger: %w" and the verify run aborts.
Source
Thrown at pkg/skaffold/runner/verify.go:43
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/constants"
deployutil "github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/deploy/util"
eventV2 "github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/event/v2"
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/graph"
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/instrumentation"
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/output"
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/output/log"
)
// VerifyAndLog deploys a list of already built artifacts and optionally show the logs.
func (r *SkaffoldRunner) VerifyAndLog(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error {
defer r.verifier.GetLogger().Stop()
// Logs should be retrieved up to just before the verify tests run
r.verifier.GetLogger().SetSince(time.Now())
// Start logger immediately as it needs to be running to get test logs immediately
if err := r.verifier.GetLogger().Start(ctx, out); err != nil {
return fmt.Errorf("starting logger: %w", err)
}
// Run verify
if err := r.Verify(ctx, out, artifacts); err != nil {
return err
}
return nil
}
func (r *SkaffoldRunner) Verify(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error {
defer r.verifier.GetStatusMonitor().Reset()
out, ctx = output.WithEventContext(ctx, out, constants.Verify, constants.SubtaskIDNone)
if len(artifacts) > 0 {
output.Default.Fprintln(out, "Tags used in verification:")
View on GitHub (pinned to a1189de023)
Solutions
- Read the wrapped cause after 'starting logger:'
- Verify cluster connectivity and RBAC permission to read pod logs (`kubectl logs` works)
- Re-run with the cluster/context the verify pods run in
- Update Skaffold if the cause points to a logger internals bug
Example fix
// before kubectl auth can-i get pods/log -n test-ns # 'no' // after: grant log read access kubectl create rolebinding log-reader --role=view --user=$USER -n test-ns
Defensive patterns
Strategy: try-catch
Validate before calling
if err := exec.Command("kubectl", "auth", "can-i", "get", "pods/log").Run(); err != nil { return errors.New("missing RBAC permission to read pod logs; verify logger will fail to start") } Try / catch
err := r.VerifyAndLog(ctx, out, artifacts)
if err != nil && strings.Contains(err.Error(), "starting logger") {
return fmt.Errorf("verify logger could not start; check cluster access/RBAC: %v", err)
}
return err Prevention
- Grant pod/log read RBAC in the verify namespace
- Ensure the target cluster is reachable before `skaffold verify`
- Confirm the logger's output writer is open and non-nil
When it happens
Trigger: Calling VerifyAndLog when r.verifier.GetLogger().Start(ctx, out) returns an error — logger initialization failure such as failure to set up the kubernetes log source or write to the output writer.
Common situations: Running `skaffold verify` against a cluster whose log streaming is broken (RBAC denied for pod log reads), unreachable cluster, or a closed output writer in the caller.
Related errors
- starting logger: %w
- getting current cluster context: %w
- getting cluster: %w
- c.Message (pod status condition message)
- unable to lookup minikube executable. Please add it to PATH
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/e37efa0c11b79e53.
Report an issue: GitHub.