Tried the latest commit but the problem persists. Here are my observations:
I configured 1 vhost to use TCP net output to Graylog
I stopped the Graylog TCP input
The TCP net log vhosts is unreachable, other vhosts (using file or UDP) are accessible
After a while I got this stacktrace:
2020/05/27 15:42:57 http2: panic serving [2001:41d0:8:1fdc::6:1]:41336: runtime error: invalid memory address or nil pointer dereference
goroutine 1362 [running]:
net/http.(*http2serverConn).runHandler.func1(0xc000010090, 0xc0001fdf8e, 0xc00055aa80)
/usr/local/go/src/net/http/h2_bundle.go:5713 +0x16b
panic(0x368020, 0x24e77c0)
/usr/local/go/src/runtime/panic.go:969 +0x166
github.com/caddyserver/caddy/v2/modules/logging.(*redialerConn).Write(0xc0000f9ab0, 0xc000c4ee00, 0x634, 0x700, 0x0, 0x8700c0, 0xc0001da370)
/root/caddy/caddy/modules/logging/netwriter.go:139 +0x1aa
go.uber.org/zap/zapcore.(*ioCore).Write(0xc000ee03f0, 0x0, 0xbfabb965a058315e, 0x136134b475, 0x257a5e0, 0xc00092a9e0, 0x15, 0x58d762, 0xf, 0x0, ...)
/root/go/pkg/mod/go.uber.org/zap@v1.15.0/zapcore/core.go:90 +0x106
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc000c29ce0, 0xc000c39180, 0x5, 0x5)
/root/go/pkg/mod/go.uber.org/zap@v1.15.0/zapcore/entry.go:216 +0x117
go.uber.org/zap.(*Logger).Info(0xc000a22900, 0x58d762, 0xf, 0xc000c39180, 0x5, 0x5)
/root/go/pkg/mod/go.uber.org/zap@v1.15.0/logger.go:187 +0x7f
github.com/caddyserver/caddy/v2/modules/caddyhttp.(*Server).ServeHTTP.func1(0xc000ecce80, 0x8a63e0, 0xc000ebbdd0, 0xc0001fd968, 0xc0009cb380, 0xc000962240, 0xc0001fdd68)
/root/caddy/caddy/modules/caddyhttp/server.go:182 +0x7ff
github.com/caddyserver/caddy/v2/modules/caddyhttp.(*Server).ServeHTTP(0xc000962240, 0x829c446f0, 0xc000ebbdd0, 0xc000ebc300)
/root/caddy/caddy/modules/caddyhttp/server.go:207 +0xe87
net/http.serverHandler.ServeHTTP(0xc00094d340, 0x88ddc0, 0xc000010090, 0xc000c36700)
/usr/local/go/src/net/http/server.go:2807 +0xa3
net/http.initALPNRequest.ServeHTTP(0x893640, 0xc000995800, 0xc000100e00, 0xc00094d340, 0x88ddc0, 0xc000010090, 0xc000c36700)
/usr/local/go/src/net/http/server.go:3381 +0x8d
net/http.(*http2serverConn).runHandler(0xc00055aa80, 0xc000010090, 0xc000c36700, 0xc000c43960)
/usr/local/go/src/net/http/h2_bundle.go:5720 +0x8b
created by net/http.(*http2serverConn).processHeaders
/usr/local/go/src/net/http/h2_bundle.go:5454 +0x4e1
After restarting the Graylog TCP input the reconnect errors re-occurred but the TCP net vhosts was reachable again:
2020-05-27 15:45:27.484295101 +0200 CEST m=+308.176867028 write error: write tcp 172.16.1.3:41449->172.16.1.7:5555: write: broken pipe
2020-05-27 15:45:28.697393487 +0200 CEST m=+309.389965423 write error: write tcp 172.16.1.3:41449->172.16.1.7:5555: write: broken pipe
2020-05-27 15:45:29.230636837 +0200 CEST m=+309.923208782 write error: write tcp 172.16.1.3:41449->172.16.1.7:5555: write: broken pipe
2020-05-27 15:45:30.676534301 +0200 CEST m=+311.369106259 write error: write tcp 172.16.1.3:41449->172.16.1.7:5555: write: broken pipe
2020-05-27 15:45:31.037263793 +0200 CEST m=+311.729835766 write error: write tcp 172.16.1.3:41449->172.16.1.7:5555: write: broken pipe
After restarting Caddy all is working again.
For now it’s not a big issue; I prefer UDP for logs (also use it for Syslog and GELF) so I fixed it that way.