amir20/dozzle · warning
deadline exceeded: with
Error message
deadline exceeded: %v with %w
What it means
rpcErrToErr maps gRPC status code DeadlineExceeded to "deadline exceeded: %v with %w", wrapping context.DeadlineExceeded. The RPC did not complete before its context deadline (or the gRPC keepalive/timeout window elapsed).
Solutions
- Retry the RPC with a fresh, longer deadline (errors.Is(err, context.DeadlineExceeded) makes it identifiable)
- Increase the ctx timeout passed to streaming calls, or drop deadlines for long-lived streams
- Check network latency/packet loss between Dozzle server and agent host
- Verify the agent container is not resource-starved (CPU throttling, disk pressure) on the remote node
Example fix
// before
ctx, cancel := context.WithTimeout(ctx, 2*time.Second)
stream, err := client.StreamContainerLogs(ctx, req)
// after
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
stream, err := client.StreamContainerLogs(ctx, req)
if err != nil && errors.Is(err, context.DeadlineExceeded) {
// retry with backoff
} Defensive patterns
Strategy: retry
Try / catch
if err != nil && errors.Is(err, context.DeadlineExceeded) {
time.Sleep(backoff)
retryWithLongerDeadline()
return
} Prevention
- Use generous deadlines (or none) for long-lived streams; reserve short deadlines for unary calls
- Check network latency between server and agent hosts during deployment
- Alert on agent host resource pressure (CPU/disk) that slows RPC responses
When it happens
Trigger: Any agent RPC (streaming or unary) executed with a ctx whose deadline expired; keepalive Timeout (10s) elapsing without transport activity; slow Docker operations on a loaded host.
Common situations: Agent host under heavy I/O so log streams stall; network partition between server and agent node; setting an aggressive context.WithTimeout on log fetches; container stats streams stalling behind a slow disk.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- failed to connect to
- unknown code: with
- failed to parse certificate
- EOF error while converting gRPC to error
- canceled: with
AI-assisted analysis of amir20/dozzle@d9463cbe21 (2026-09-07).
Data as JSON: /api/errors/29da412efb612b46.
Report an issue: GitHub.
Appendix: source
Thrown at internal/agent/client.go:125
func rpcErrToErr(err error) error {
if err == nil {
return nil
}
status, ok := status.FromError(err)
if !ok {
return err
}
if status.Code() == codes.Unknown && status.Message() == "EOF" {
return fmt.Errorf("EOF error while converting gRPC to error: %w", io.EOF)
}
switch status.Code() {
case codes.Canceled:
return fmt.Errorf("canceled: %v with %w", status.Message(), context.Canceled)
case codes.DeadlineExceeded:
return fmt.Errorf("deadline exceeded: %v with %w", status.Message(), context.DeadlineExceeded)
case codes.Unknown:
return fmt.Errorf("unknown error: %v with %w", status.Message(), err)
case codes.OK:
return nil
default:
return fmt.Errorf("unknown code: %v with %w", status.Code(), err)
}
}
func (c *Client) LogsBetweenDates(ctx context.Context, containerID string, since time.Time, until time.Time, std container.StdType) (<-chan *container.LogEvent, error) {
stream, err := c.client.LogsBetweenDates(ctx, &pb.LogsBetweenDatesRequest{
ContainerId: containerID,
Since: timestamppb.New(since),
Until: timestamppb.New(until),
StreamTypes: int32(std),
})
if err != nil {View on GitHub (pinned to d9463cbe21)