Http: multiple response.WriteHeader calls

I’m seeing a bunch of http: multiple response.WriteHeader calls output in the logs.

Is this something to worry about and be tracked down?

I’m using “cache” and “proxy” - I don’t know if that indicates direction.,,,, {
	cache {
		status_header X-Cache-Status
	proxy / {

http:// {
	root /var/www

I can’t seem to reproduce the precise occurrence of http: multiple response.WriteHeader calls by making requests to the domains.

Requests to the all Connection: close (so no keep alive).

Seeing this in 0.11.0 and previous 0.10.x

My money’s on cache as the culprit; I’m not aware of any clashing WriteHeader response calls in the proxy code. Are you able to test for a while without cache and see if the error persists?

Edit: Might have something to do with the way cache copies the request and sends the copy down the middleware chain in order to retrieve the response to be cached?

As to whether it’s something that needs worrying about, that’s a solid maybe. For instances of multiple WriteHeader calls, the later calls are ignored, so if they’re adding important information it might be lost.


Thanks for your insight @Whitestrake

I tried removing the cache config sections consisting of the following:

	cache {
		status_header X-Cache-Status

And ran for over 24 hours without an occurrence of the log:

http: multiple response.WriteHeader calls

Put the config sections back in and saw an occurrence of the offending log entry after just 5 minutes and then several after that within 2-3 minutes.

Reported the bug in the cache project issues:

1 Like

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