{"record":{"id":"84ccc0c9474d0f42","repo":"cilium/cilium","slug":"failure-during-tcproute-checks-w","errorCode":null,"errorMessage":"failure during TCPRoute checks: %w","messagePattern":"failure during TCPRoute checks: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"operator/pkg/gateway-api/status_route.go","lineNumber":383,"sourceCode":"}\n\nfunc (m *RouteStatusManager) setTCPRouteStatuses(ctx context.Context, scopedLog *slog.Logger, tcpRoutes []gatewayv1.TCPRoute, grants []gatewayv1.ReferenceGrant) error {\n\tscopedLog.Debug(\"Updating TCPRoute statuses for Gateway\", numRoutes, len(tcpRoutes))\n\tfor tcpRouteIndex, original := range tcpRoutes {\n\t\ttcpr := original.DeepCopy()\n\t\ttcpr.Status.Parents = pruneRouteParentStatuses(tcpr.Status.Parents, tcpr.Spec.ParentRefs, m.controllerName)\n\n\t\ti := &routechecks.TCPRouteInput{\n\t\t\tCtx:            ctx,\n\t\t\tLogger:         scopedLog.With(logfields.TCPRoute, tcpr),\n\t\t\tClient:         m.client,\n\t\t\tGrants:         grants,\n\t\t\tTCPRoute:       tcpr,\n\t\t\tControllerName: m.controllerName,\n\t\t}\n\n\t\tif err := m.runCommonRouteChecks(ctx, i, tcpr.Spec.ParentRefs, tcpr.Namespace); err != nil {\n\t\t\treturn fmt.Errorf(\"failure during TCPRoute checks: %w\", err)\n\t\t}\n\n\t\tif err := m.updateTCPRouteStatus(ctx, scopedLog, &original, tcpr); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to update TCPRoute status: %w\", err)\n\t\t}\n\n\t\ttcpRoutes[tcpRouteIndex].Status = tcpr.Status\n\t}\n\n\treturn nil\n}\n\nfunc (m *RouteStatusManager) setUDPRouteStatuses(ctx context.Context, scopedLog *slog.Logger, udpRoutes []gatewayv1.UDPRoute, grants []gatewayv1.ReferenceGrant) error {\n\tscopedLog.Debug(\"Updating UDPRoute statuses for Gateway\", numRoutes, len(udpRoutes))\n\tfor udpRouteIndex, original := range udpRoutes {\n\t\tudpr := original.DeepCopy()\n\t\tudpr.Status.Parents = pruneRouteParentStatuses(udpr.Status.Parents, udpr.Spec.ParentRefs, m.controllerName)\n","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/operator/pkg/gateway-api/status_route.go#L365-L401","documentation":"setTCPRouteStatuses runs common parentRef/reference-grant checks for each TCPRoute before writing status. This error wraps any failure returned by runCommonRouteChecks so SetRouteStatuses reports that TCPRoute processing aborted during the check phase.","triggerScenarios":"m.runCommonRouteChecks(ctx, i, tcpr.Spec.ParentRefs, tcpr.Namespace) returns a non-nil error while processing a TCPRoute.","commonSituations":"Context cancellation mid-reconcile; API errors fetching referenced Gateways or ReferenceGrants; missing/invalid parentRefs pointing at nonexistent Gateways.","solutions":["Inspect the wrapped inner error for the root cause","Requeue/retry the reconcile for transient API failures","Verify parentRefs target an existing Gateway in an allowed namespace","Check operator RBAC for reading Gateways and ReferenceGrants"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"kubectl get gateway -n <ns> && kubectl get referencegrant -A","typeGuard":null,"tryCatchPattern":"if err := m.runCommonRouteChecks(ctx, i, tcpr.Spec.ParentRefs, tcpr.Namespace); err != nil {\n    logger.Error(err, \"tcproute checks failed\", \"namespace\", tcpr.Namespace, \"name\", tcpr.Name)\n    return fmt.Errorf(\"failure during TCPRoute checks: %w\", err)\n}","preventionTips":["Validate parentRefs against live Gateways before applying TCPRoutes","Add ReferenceGrants for cross-namespace references","Ensure operator RBAC can list/get Gateways and ReferenceGrants","Requeue on failure rather than dropping the route silently"],"tags":["tcproute","gateway-api","status-update","kubernetes"],"backgroundTag":"route-status-check-failure","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}