I have a strange and reproducible problem with Chrome and an html5 video
player. The video starts playing and after 15-20 secods it stops with this
error

Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH

The same video plays perfectly on safari and firefox, windows and mac
(don't have a linux box around to test it).

One solution I found is to set the client timeout really high, but I don't
think this is the best solution.

This is the configuration I'm using for the tests:

global
        maxconn         4096
        log             /var/run/haproxy.log    local0
        log             /var/run/haproxy.log    local1 notice
        uid             haproxy
        gid             haproxy
        daemon
        debug

# The public 'www' address in the DMZ
frontend public
        bind            0.0.0.0:85
        mode            http
        log             global
        option          httplog
        option          dontlognull
        option          httpclose
        monitor-uri     /monitoruri
        maxconn         8000
        timeout client  1000

        default_backend static


# The static backend
backend static
        mode            http
        balance         roundrobin
        timeout connect 5000
        timeout server  5000
        option          redispatch
        retries         2
        option          httpchk HEAD /
        server          statsrv1 127.0.0.1:80 check inter 1000

These are the logs I get starting haproxy with debug and opening the player:

-------------------------------------------------------------------------
Using chrome (stable)
00000000:public.accept(0004)=0006 from [x.x.x.x:51333]
00000000:public.clireq[0006:ffffffff]: GET
/ba157322aefdb9e0b4542b8a4aa4024a.mp4 HTTP/1.1
00000000:public.clihdr[0006:ffffffff]: Host: someserver:85
00000000:public.clihdr[0006:ffffffff]: Connection: keep-alive
00000000:public.clihdr[0006:ffffffff]: Cache-Control: max-age=0
00000000:public.clihdr[0006:ffffffff]: Accept-Encoding: identity;q=1, *;q=0
00000000:public.clihdr[0006:ffffffff]: User-Agent: Mozilla/5.0 (Macintosh;
Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/36.0.1985.125 Safari/537.36
00000000:public.clihdr[0006:ffffffff]: Accept: */*
00000000:public.clihdr[0006:ffffffff]: Referer: http://someserver/somepage
00000000:public.clihdr[0006:ffffffff]: Accept-Language: en-US,en;q=0.8
00000000:public.clihdr[0006:ffffffff]: Range: bytes=0-
00000000:static.srvrep[0006:0007]: HTTP/1.1 206 Partial Content
00000000:static.srvhdr[0006:0007]: Server: nginx/1.6.0
00000000:static.srvhdr[0006:0007]: Date: Fri, 01 Aug 2014 11:34:36 GMT
00000000:static.srvhdr[0006:0007]: Content-Type: video/mp4
00000000:static.srvhdr[0006:0007]: Content-Length: 14454928
00000000:static.srvhdr[0006:0007]: Last-Modified: Wed, 23 Jul 2014 14:37:00
GMT
00000000:static.srvhdr[0006:0007]: Connection: close
00000000:static.srvhdr[0006:0007]: ETag: "53cfc88c-dc9090"
00000000:static.srvhdr[0006:0007]: Content-Range: bytes 0-14454927/14454928
00000000:static.srvcls[0006:0007]
00000000:static.clicls[0006:0007]
00000000:static.closed[0006:0007]

-------------------------------------------------------------------------
Using firefox (stable)
00000000:public.accept(0004)=0006 from [x.x.x.x:51401]
00000000:public.clireq[0006:ffffffff]: GET
/ba157322aefdb9e0b4542b8a4aa4024a.webm HTTP/1.1
00000000:public.clihdr[0006:ffffffff]: Host: someserver:85
00000000:public.clihdr[0006:ffffffff]: User-Agent: Mozilla/5.0 (Macintosh;
Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Firefox/31.0
00000000:public.clihdr[0006:ffffffff]: Accept:
video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5
00000000:public.clihdr[0006:ffffffff]: Accept-Language: en-US,en;q=0.5
00000000:public.clihdr[0006:ffffffff]: DNT: 1
00000000:public.clihdr[0006:ffffffff]: Range: bytes=0-
00000000:public.clihdr[0006:ffffffff]: Referer: http://someserver/somepage
00000000:public.clihdr[0006:ffffffff]: Connection: keep-alive
00000000:static.srvrep[0006:0007]: HTTP/1.1 206 Partial Content
00000000:static.srvhdr[0006:0007]: Server: nginx/1.6.0
00000000:static.srvhdr[0006:0007]: Date: Fri, 01 Aug 2014 11:41:12 GMT
00000000:static.srvhdr[0006:0007]: Content-Type: video/webm
00000000:static.srvhdr[0006:0007]: Content-Length: 18259592
00000000:static.srvhdr[0006:0007]: Last-Modified: Wed, 23 Jul 2014 14:35:33
GMT
00000000:static.srvhdr[0006:0007]: Connection: close
00000000:static.srvhdr[0006:0007]: ETag: "53cfc835-1169e88"
00000000:static.srvhdr[0006:0007]: Content-Range: bytes 0-18259591/18259592
00000001:public.accept(0004)=0008 from [x.x.x.x:51402]
00000001:public.clicls[0008:ffffffff]
00000001:public.closed[0008:ffffffff]
00000000:static.srvcls[0006:0007]
00000000:static.clicls[0006:0007]
00000000:static.closed[0006:0007]

-------------------------------------------------------------------------
Using safari (stable)
00000000:public.accept(0004)=0006 from [x.x.x.x:51375]
00000000:public.clireq[0006:ffffffff]: GET
/ba157322aefdb9e0b4542b8a4aa4024a.mp4 HTTP/1.1
00000000:public.clihdr[0006:ffffffff]: Host: someserver:85
00000000:public.clihdr[0006:ffffffff]: Cookie:
00000000:public.clihdr[0006:ffffffff]: X-Playback-Session-Id:
8D3ECFD0-DD09-4D50-A6AC-CE3897A5D47E
00000000:public.clihdr[0006:ffffffff]: Range: bytes=0-1
00000000:public.clihdr[0006:ffffffff]: Accept: */*
00000000:public.clihdr[0006:ffffffff]: User-Agent: Mozilla/5.0 (Macintosh;
Intel Mac OS X 10_9_4) AppleWebKit/537.77.4 (KHTML, like Gecko)
Version/7.0.5 Safari/537.77.4
00000000:public.clihdr[0006:ffffffff]: Referer: http://someserver/somepage
00000000:public.clihdr[0006:ffffffff]: Accept-Encoding: identity
00000000:public.clihdr[0006:ffffffff]: Connection: keep-alive
00000000:static.srvrep[0006:0007]: HTTP/1.1 206 Partial Content
00000000:static.srvhdr[0006:0007]: Server: nginx/1.6.0
00000000:static.srvhdr[0006:0007]: Date: Fri, 01 Aug 2014 11:38:21 GMT
00000000:static.srvhdr[0006:0007]: Content-Type: video/mp4
00000000:static.srvhdr[0006:0007]: Content-Length: 2
00000000:static.srvhdr[0006:0007]: Last-Modified: Wed, 23 Jul 2014 14:37:00
GMT
00000000:static.srvhdr[0006:0007]: Connection: close
00000000:static.srvhdr[0006:0007]: ETag: "53cfc88c-dc9090"
00000000:static.srvhdr[0006:0007]: Content-Range: bytes 0-1/14454928
00000000:static.srvcls[0006:0007]
00000000:static.clicls[0006:0007]
00000000:static.closed[0006:0007]
00000001:public.accept(0004)=0006 from [x.x.x.x:51376]
00000001:public.clireq[0006:ffffffff]: GET
/ba157322aefdb9e0b4542b8a4aa4024a.mp4 HTTP/1.1
00000001:public.clihdr[0006:ffffffff]: Host: someserver:85
00000001:public.clihdr[0006:ffffffff]: Cookie:
00000001:public.clihdr[0006:ffffffff]: X-Playback-Session-Id:
8D3ECFD0-DD09-4D50-A6AC-CE3897A5D47E
00000001:public.clihdr[0006:ffffffff]: Range: bytes=0-14454927
00000001:public.clihdr[0006:ffffffff]: Accept: */*
00000001:public.clihdr[0006:ffffffff]: User-Agent: Mozilla/5.0 (Macintosh;
Intel Mac OS X 10_9_4) AppleWebKit/537.77.4 (KHTML, like Gecko)
Version/7.0.5 Safari/537.77.4
00000001:public.clihdr[0006:ffffffff]: Referer: http://someserver/somepage
00000001:public.clihdr[0006:ffffffff]: Accept-Encoding: identity
00000001:public.clihdr[0006:ffffffff]: Connection: keep-alive
00000001:static.srvrep[0006:0007]: HTTP/1.1 206 Partial Content
00000001:static.srvhdr[0006:0007]: Server: nginx/1.6.0
00000001:static.srvhdr[0006:0007]: Date: Fri, 01 Aug 2014 11:38:21 GMT
00000001:static.srvhdr[0006:0007]: Content-Type: video/mp4
00000001:static.srvhdr[0006:0007]: Content-Length: 14454928
00000001:static.srvhdr[0006:0007]: Last-Modified: Wed, 23 Jul 2014 14:37:00
GMT
00000001:static.srvhdr[0006:0007]: Connection: close
00000001:static.srvhdr[0006:0007]: ETag: "53cfc88c-dc9090"
00000001:static.srvhdr[0006:0007]: Content-Range: bytes 0-14454927/14454928
00000001:static.srvcls[0006:0007]
00000001:static.clicls[0006:0007]
00000001:static.closed[0006:0007]

Any ideas on how to fix this? it's definitely browser related, maybe
something related to this?

https://code.google.com/p/chromium/issues/detail?id=111281

Reply via email to