Incomplete downloads

Today I started having a network problem. However, I've already seen this problem in the past, when somebody has a really nasty connection. In my case, today a network node is losing tons of packets.

When this happens, Traefik will, at some point, break the connection. For example, downloading a file with curl, curl failed with:

curl https://www.example.com/web/content/252029-1b9dc64/web.assets_backend.js > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 40 1834k   40  748k    0     0  14742      0  0:02:07  0:00:51  0:01:16 22117
curl: (18) transfer closed with 1112977 bytes remaining to read

At the same time, traefik logged this (important line last):

INFO[2019-10-01T10:55:25Z] Traefik version v1.7.18 built on 2019-09-26_01:56:30PM 
INFO[2019-10-01T10:55:25Z] 
Stats collection is disabled.
Help us improve Traefik by turning this feature on :)
More details on: https://docs.traefik.io/v1.7/basics/#collected-data 
INFO[2019-10-01T10:55:25Z] Preparing server http &{Address::80 TLS:<nil> Redirect:0xc000916e00 Auth:<nil> WhitelistSourceRange:[] WhiteList:<nil> Compress:true ProxyProtocol:<nil> ForwardedHeaders:0xc00089bbc0} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s 
INFO[2019-10-01T10:55:25Z] Preparing server https &{Address::443 TLS:0xc0003ffef0 Redirect:<nil> Auth:<nil> WhitelistSourceRange:[] WhiteList:<nil> Compress:true ProxyProtocol:<nil> ForwardedHeaders:0xc00089bc80} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s 
INFO[2019-10-01T10:55:25Z] Starting server on :80                       
INFO[2019-10-01T10:55:25Z] Starting provider configuration.ProviderAggregator {} 
INFO[2019-10-01T10:55:25Z] Starting server on :443                      
INFO[2019-10-01T10:55:25Z] Starting provider *docker.Provider {"Watch":true,"Filename":"","Constraints":null,"Trace":false,"TemplateVersion":2,"DebugLogGeneratedTemplate":false,"Endpoint":"http://dockersocket:2375","Domain":"","TLS":null,"ExposedByDefault":false,"UseBindPortIP":false,"SwarmMode":false,"Network":"","SwarmModeRefreshSeconds":15} 
INFO[2019-10-01T10:55:25Z] Starting provider *acme.Provider {"Email":"example@example.com","ACMELogging":true,"CAServer":"https://acme-v02.api.letsencrypt.org/directory","Storage":"/etc/traefik/acme/acme.json","EntryPoint":"https","KeyType":"","OnHostRule":true,"OnDemand":false,"DNSChallenge":null,"HTTPChallenge":{"EntryPoint":"http"},"TLSChallenge":null,"Domains":null,"Store":{}} 
INFO[2019-10-01T10:55:25Z] Testing certificate renew...                 
INFO[2019-10-01T10:55:25Z] Server configuration reloaded on :443        
INFO[2019-10-01T10:55:25Z] Server configuration reloaded on :80         
INFO[2019-10-01T10:55:26Z] Server configuration reloaded on :80         
INFO[2019-10-01T10:55:26Z] Server configuration reloaded on :443        
2019/10/01 10:57:30 reverseproxy.go:447: httputil: ReverseProxy read error during body copy: unexpected EOF
ERRO[2019-10-01T11:05:25Z] Provider connection error unexpected EOF, retrying in 450.062643ms 

I found https://github.com/moby/moby/issues/30405 which could be related and indicate that this is only Docker problem, but... it's a big problem!

Has anybody faced this issue before? And any clues on fixing it? Thanks!

Today I found Truncated body when unexpected EOF · Issue #2903 · traefik/traefik · GitHub which became stale but is exactly my problem.

The OP was told:

It seems that this is a backend issue caused when requesting gzip encoding.

What does that mean? :roll_eyes:

Hi. I have the some issue with traefik. My scheme:

Client -> Cloudflare -> Traefik(v2.2.1) -> Caddy file server

wget https://domain.com/myfile.dmg
--2020-12-12 13:40:56--  https://domain.com/myfile.dmg
Resolving domain.com (domain.com)... 104.26.12.129, 104.26.13.129, 172.67.73.252
Connecting to domain.com (domain.com)|104.26.12.129|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 71088228 (68M) [application/x-apple-diskimage]
Saving to: ‘myfile.dmg’

myfile.dmg                                             80%[=========================================================================================================================================>                                  ]  54,62M  1,67MB/s    in 41s

2020-12-12 13:41:37 (1,33 MB/s) - Connection closed at byte 57268888. Retrying.