traefik: Internal server error in buffering
Do you want to request a feature or report a bug?
Bug
What did you do?
I used labels in docker-compose.yml
to configure the buffering of a backend:
nginx:
image: nginx
labels:
traefik.backend: 'nginx'
traefik.backend.buffering.maxRequestBodyBytes: '8589934592'
traefik.backend.buffering.maxResponseBodyBytes: '8589934592'
traefik.backend.buffering.memRequestBodyBytes: '268436456'
traefik.backend.buffering.memResponseBodyBytes: '268435456'
traefik.backend.buffering.retryExpression: 'IsNetworkError() && Attempts() <= 2'
traefik.enable: 'true'
traefik.frontend.rule: 'Host: nginx.example.com'
traefik.port: '80'
networks:
- web
restart: always
volumes:
- ...
And I got an Internal Server Error when accessed the Host: nginx.example.com .
The And I’m sure that the backend works well too.
When I removed the labels about buffering, the traefik works normally!docker-compose.yml
works well in traefik v1.7.7.
What did you expect to see?
Access the host normally.
What did you see instead?
500: Internal Server Error
Output of traefik version
: (What version of Traefik are you using?)
Version: v1.7.8
Codename: maroilles
Go version: go1.11.5
Built: 2019-01-29_04:33:36PM
OS/Arch: linux/amd64
What is your environment & configuration (arguments, toml, provider, platform, …)?
debug = true
defaultEntryPoints = ['https', 'http']
logLevel = 'DEBUG'
[entryPoints]
[entryPoints.http]
address = ':80'
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ':443'
[entryPoints.https.tls]
[traefikLog]
filePath = 'traefik.log'
format = 'json'
[accessLog]
format = 'json'
[docker]
endpoint = 'unix:///var/run/docker.sock'
exposedByDefault = false
domain = 'example.com'
network = 'web'
watch = true
If applicable, please paste the log output in DEBUG level (--logLevel=DEBUG
switch)
I found these messages in the debug log:
{
"level": "debug",
"msg": "Upstream ResponseWriter of type *pipelining.writerWithoutCloseNotify does not implement http.CloseNotifier. Returning dummy channel.",
"time": "2019-02-03T11:38:05Z"
}
{
"level": "error",
"msg": "vulcand/oxy/buffer: failed to read response, err: no data ready",
"time": "2019-02-03T11:38:06Z"
}
{
"level": "debug",
"msg": "'500 Internal Server Error' caused by: no data ready",
"time": "2019-02-03T11:38:06Z"
}
And I think the vulcand/oxy/buffer
caused the issue.
The whole DEBUG log is debug.log.
I think my report will help you!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 22
Hey @mpl, hitting the same issue OP posted. Running traefik:2.1.2. Hopefully I could give some insight on repro steps. Run this python script to simulate the 302 redirect (as mentioned above, uncommenting the Content-Length header fixes the problem).
$ python3 server.py 7777 http://localhost:8080/
dynamic_conf.yml (replace LOCAL_IP with something traefik can access)
traefik.yml
However, RFC 7230 lists the few responses without a body, 302 is not one of them:
It seems the link in the body is not required but the
Content-Length: 0
is still a requirement.The RFC 7231, published in 2007 and obsoleting the RFC 2616, was reworded to remove the requirement to have a body with an hyperlink to the new location :