cloudflare / cloudflare/cloudflared

🐛 Normal HTTP/2 stream cancellations (error code 0 / NO_ERROR) are logged at ERR level

Open
#1,726 0 comments 0 reactions 0 assignees View on GitHub
Priority: Normal Type: Bug
Dominant language
Go
Stars
15.6k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug
When a remote client gracefully terminates a long-lived HTTP/2 stream (such as closing a browser tab tailing Server-Sent Events, WebSockets, or live log streams), cloudflared logs the stream cancellation at ERR severity. Per RFC 9113 (HTTP/2), error code 0x0 (NO_ERROR) indicates that the stream closure is non-erroneous and intentional. Logging these events as system errors creates false positives in monitoring systems (e.g., Datadog, Grafana) and unnecessarily pollutes log outputs.

### To Reproduce
Steps to reproduce the behavior:

- Proxy an application with long-lived HTTP/2 streaming or log-tailing endpoints via cloudflared (e.g., Home Assistant's /api/hassio/addons/.../logs/follow).
- Open the streaming endpoint in a web browser.
- Close the browser tab or refresh the page to trigger a client-side stream reset (RST_STREAM).

See error in cloudflared stdout/stderr.

### Expected behavior
RST_STREAM frames with error code 0 (NO_ERROR) should be recognized as normal client disconnects and logged under DEBUG or INFO severity rather than ERR.

### Environment and versions

OS: Linux (Home Assistant OS)
Architecture: ARM64 / x86_64
Version: 2026.8.2

### Logs and errors
```
2026-08-25T08:07:02Z ERR error="stream 41 canceled by remote with error code 0" connIndex=3 event=1 ingressRule=0 originService=http://homeassistant
2026-08-25T08:07:02Z ERR Request failed error="stream 41 canceled by remote with error code 0" connIndex=3 dest=https://ha.example.com/api/hassio/addons/cloudflared/logs/follow?lines=100 event=0 ip=198.41.192.77 type=http
```

### Additional context
This occurs because the ingress proxy layer routes any non-nil stream error return code directly to the error logger without filtering for HTTP/2 0x0 (NO_ERROR) status codes.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the ingress proxy layer's handling of non-nil stream errors during the provided long-lived HTTP/2 streaming reproduction. Verify behavior with a client that closes a browser tab or refreshes an SSE, WebSocket, or log stream; done means RST_STREAM error code 0 is logged at DEBUG or INFO instead of ERR, while other failures remain errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.