{"record":{"id":"e37efa0c11b79e53","repo":"GoogleContainerTools/skaffold","slug":"starting-logger-w-e37efa","errorCode":null,"errorMessage":"starting logger: %w","messagePattern":"starting logger: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/runner/verify.go","lineNumber":43,"sourceCode":"\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/constants\"\n\tdeployutil \"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/deploy/util\"\n\teventV2 \"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/event/v2\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/graph\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/instrumentation\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/output\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/output/log\"\n)\n\n// VerifyAndLog deploys a list of already built artifacts and optionally show the logs.\nfunc (r *SkaffoldRunner) VerifyAndLog(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error {\n\tdefer r.verifier.GetLogger().Stop()\n\n\t// Logs should be retrieved up to just before the verify tests run\n\tr.verifier.GetLogger().SetSince(time.Now())\n\n\t// Start logger immediately as it needs to be running to get test logs immediately\n\tif err := r.verifier.GetLogger().Start(ctx, out); err != nil {\n\t\treturn fmt.Errorf(\"starting logger: %w\", err)\n\t}\n\n\t// Run verify\n\tif err := r.Verify(ctx, out, artifacts); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (r *SkaffoldRunner) Verify(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error {\n\tdefer r.verifier.GetStatusMonitor().Reset()\n\n\tout, ctx = output.WithEventContext(ctx, out, constants.Verify, constants.SubtaskIDNone)\n\n\tif len(artifacts) > 0 {\n\t\toutput.Default.Fprintln(out, \"Tags used in verification:\")\n","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/runner/verify.go#L25-L61","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nkubectl auth can-i get pods/log -n test-ns  # 'no'\n// after: grant log read access\nkubectl create rolebinding log-reader --role=view --user=$USER -n test-ns","handlingStrategy":"try-catch","validationCode":"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\") }","typeGuard":null,"tryCatchPattern":"err := r.VerifyAndLog(ctx, out, artifacts)\nif err != nil && strings.Contains(err.Error(), \"starting logger\") {\n    return fmt.Errorf(\"verify logger could not start; check cluster access/RBAC: %v\", err)\n}\nreturn err","preventionTips":["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"],"tags":["skaffold","logging","kubernetes","verify","go"],"backgroundTag":"logger-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"}