Unsolicited response received on idle HTTP channel starting with "null"; err=<nil>

Hi, I'm using traefik in front of FastAPI. This is my version:

Version:      2.5.7
Codename:     brie
Go version:   go1.17.6
Built:        2022-01-20T16:16:23Z
OS/Arch:      linux/amd64

Everything runs smoothly, but when I call endpoints that return 204 No content, I get in the log the following messages:

my-fastapi    | INFO:     172.18.0.2:43972 - "DELETE /foo/bar HTTP/1.1" 204 No Content
traefik       | 2022/05/12 10:21:52 transport.go:2242: Unsolicited response received on idle HTTP channel starting with "null"; err=<nil>

This happens only with empty responses. Is there a way to fix?

Turned out it was a FastAPI behavior. In particular, it sends null also in the case of 204 with the default response type. Solved in FastAPI. Sorry for this post.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.