New issue
Advanced search Search tips

Issue 606990 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Chrome aborts http2 stream w/ net::ERR_SPDY_PROTOCOL_ERROR when response is given before entire request DATA is consumed.

Reported by n...@channelmeter.com, Apr 26 2016

Issue description

Chrome Version       : 50.0.2661.86 (Official Build) (64-bit)
URLs (if applicable) :
Other browsers tested:
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari: Untested
    Firefox: OK
         IE: Untested

What steps will reproduce the problem?
(1) Connect to a http2 server, and POST a huge file to that server
(2) The server should ignore the DATA and respond with a response as soon as possible
(3)

What is the expected result?

Chrome retrieves the response with 413 status code.

What happens instead?

Chrome fails the request with net::ERR_SPDY_PROTOCOL_ERROR


Please provide any additional information below. Attach a screenshot if
possible.


I've been trying to debug this issue in a golang http2 server, the discussion which can be followed here - https://github.com/golang/go/issues/15425

I even used Wireshark to sniff what was going on, and AFAICT nothing here violates the spec, which leads me to think it might be an issue with Chrome. 

https://github.com/golang/go/files/237642/ChromeWiresharkout_key.zip (also attached)

This is wireshark output (decode port 1333 as SSL and use the session keys provided, see https://blog.cloudflare.com/tools-for-debugging-testing-and-using-http-2/).

To run a sample server, the easiest thing you can do is generate a valid SSL cert, and run this code (provided you have a go environment installed).

(Use `go get github.com/nemothekid/net/http2` to download my modified http2 code in go that prevents another control flow error)

https://gist.github.com/nemothekid/c3abd23f4448b1a7022bf6de0919d61d
 
ChromeGolangHttp2.pcapng
108 KB Download
sessionkeys.txt
24.4 KB View Download
Labels: Te-NeedsFurtherTriage
Components: Internals>Network>HTTP2

Comment 3 by b...@chromium.org, Apr 29 2016

Labels: -Pri-3 -Te-NeedsFurtherTriage Pri-2
Owner: b...@chromium.org
Status: Assigned (was: Unconfirmed)
Note that this might be related to  issue 603182 .
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 27 2016

Comment 5 by b...@chromium.org, Nov 15 2016

Labels: M-57
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1ff808709f5e371c20c7238c429db5f2c23e6d95

commit 1ff808709f5e371c20c7238c429db5f2c23e6d95
Author: bnc <bnc@chromium.org>
Date: Fri Dec 16 20:57:57 2016

Add regression tests for https://crbug.com/606990.

It seems like https://crbug.com/606990 is fixed, this CL adds regression
tests for it.

BUG=606990

Review-Url: https://codereview.chromium.org/2576283005
Cr-Commit-Position: refs/heads/master@{#439187}

[modify] https://crrev.com/1ff808709f5e371c20c7238c429db5f2c23e6d95/net/spdy/spdy_network_transaction_unittest.cc

Comment 7 by b...@chromium.org, Dec 16 2016

Status: Fixed (was: Assigned)
I added two regression tests and they pass.  I assume this was fixed by https://crrev.com/2526003002, which moved some of the HTTP/2 stream state logic from SpdySession to SpdyStream.  Therefore I am closing this issue as Fixed.  Please open a new issue if you still encounter this problem in Chrome 57.0.2936.0 or above.
I believe I am experiencing this issue in Chrome Version 57.0.2987.88 beta (64-bit) on OS X 10.11.6.

When making a CORS ajax PUT (only about 100KB), the server sends a 403 response before receiving the full request body.  Chrome throws a net::ERR_SPDY_PROTOCOL_ERROR, meaning I can't get at the response status code or body.  I believe I have CORS set up correctly (everything works as expected except for this).

From chrome://net-internals/#events&q=type:HTTP2_SESSION%20is:active

t=1178148 [st=   0] +HTTP2_SESSION  [dt=?]
                     --> host = "api.crosscountryapp.com:443"
                     --> proxy = "DIRECT"
t=1178148 [st=   0]    HTTP2_SESSION_INITIALIZED
                       --> protocol = "h2"
                       --> source_dependency = 30820 (SOCKET)
t=1178148 [st=   0]    HTTP2_SESSION_SEND_SETTINGS
                       --> settings = ["[id:1 value:65536]","[id:3 value:1000]","[id:4 value:6291456]"]
t=1178148 [st=   0]    HTTP2_STREAM_UPDATE_RECV_WINDOW
                       --> delta = 15663105
                       --> window_size = 15728640
t=1178148 [st=   0]    HTTP2_SESSION_SENT_WINDOW_UPDATE_FRAME
                       --> delta = 15663105
                       --> stream_id = 0
t=1178149 [st=   1]    HTTP2_SESSION_SEND_HEADERS
                       --> exclusive = true
                       --> fin = true
                       --> has_priority = true
                       --> :method: OPTIONS
                           :authority: api.crosscountryapp.com
                           :scheme: https
                           :path: /geometries/cva632
                           access-control-request-method: PUT
                           origin: https://toolkit.crosscountryapp.com
                           user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.88 Safari/537.36
                           access-control-request-headers: authorization,if-match
                           accept: */*
                           referer: https://toolkit.crosscountryapp.com/geometries/cva632?originCollection=courses&originKey=draft-2017-cci-one-star
                           accept-encoding: gzip, deflate, sdch, br
                           accept-language: en-AU,en;q=0.8,en-NZ;q=0.6
                           dnt: 1
                       --> parent_stream_id = 0
                       --> stream_id = 1
                       --> weight = 220
t=1178294 [st= 146]    HTTP2_SESSION_RECV_SETTINGS
                       --> host = "api.crosscountryapp.com:443"
t=1178294 [st= 146]    HTTP2_SESSION_RECV_SETTING
                       --> id = 3
                       --> value = 128
t=1178294 [st= 146]    HTTP2_SESSION_UPDATE_STREAMS_SEND_WINDOW_SIZE
                       --> delta_window_size = -65535
t=1178294 [st= 146]    HTTP2_SESSION_RECV_SETTING
                       --> id = 4
                       --> value = 0
t=1178294 [st= 146]    HTTP2_SESSION_RECV_SETTING
                       --> id = 5
                       --> value = 16777215
t=1178294 [st= 146]    HTTP2_SESSION_RECEIVED_WINDOW_UPDATE_FRAME
                       --> delta = 2147418112
                       --> stream_id = 0
t=1178294 [st= 146]    HTTP2_SESSION_UPDATE_SEND_WINDOW
                       --> delta = 2147418112
                       --> window_size = 2147483647
t=1178381 [st= 233]    HTTP2_SESSION_RECV_HEADERS
                       --> fin = true
                       --> :status: 204
                           server: openresty/1.9.15.1
                           date: Tue, 07 Mar 2017 14:54:27 GMT
                           access-control-allow-origin: https://toolkit.crosscountryapp.com
                           access-control-allow-credentials: true
                           access-control-expose-headers: ETag
                           access-control-allow-methods: PUT
                           access-control-allow-headers: authorization,if-match
                       --> stream_id = 1
t=1178382 [st= 234]    HTTP2_SESSION_RECV_DATA
                       --> fin = true
                       --> size = 0
                       --> stream_id = 1
t=1178425 [st= 277]    HTTP2_SESSION_SEND_HEADERS
                       --> exclusive = true
                       --> fin = false
                       --> has_priority = true
                       --> :method: PUT
                           :authority: api.crosscountryapp.com
                           :scheme: https
                           :path: /geometries/cva632
                           content-length: 176033
                           cache-control: max-age=0
                           authorization: CrossCountry-Token [31 bytes were stripped]
                           origin: https://toolkit.crosscountryapp.com
                           user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.88 Safari/537.36
                           content-type: application/x-www-form-urlencoded
                           accept: application/json, text/javascript
                           if-match: "4-6d0a6658fa5843f8b070ec291d6f8c7a"
                           referer: https://toolkit.crosscountryapp.com/geometries/cva632?originCollection=courses&originKey=draft-2017-cci-one-star
                           accept-encoding: gzip, deflate, sdch, br
                           accept-language: en-AU,en;q=0.8,en-NZ;q=0.6
                           dnt: 1
                       --> parent_stream_id = 0
                       --> stream_id = 3
                       --> weight = 220
t=1178425 [st= 277]    HTTP2_SESSION_STREAM_STALLED_BY_STREAM_SEND_WINDOW
                       --> stream_id = 3
t=1178580 [st= 432]    HTTP2_SESSION_RECEIVED_WINDOW_UPDATE_FRAME
                       --> delta = 2147483647
                       --> stream_id = 3
t=1178580 [st= 432]    HTTP2_SESSION_SEND_DATA
                       --> fin = false
                       --> size = 2852
                       --> stream_id = 3
t=1178580 [st= 432]    HTTP2_SESSION_UPDATE_SEND_WINDOW
                       --> delta = -2852
                       --> window_size = 2147480795
t=1178580 [st= 432]    HTTP2_SESSION_SEND_DATA
                       --> fin = false
                       --> size = 2852
                       --> stream_id = 3

.... lots more of HTTP2_SESSION_UPDATE_SEND_WINDOW & HTTP2_SESSION_SEND_DATA ...

t=1179011 [st= 863]    HTTP2_SESSION_UPDATE_SEND_WINDOW
                       --> delta = -785
                       --> window_size = 2147307614
t=1179714 [st=1566]    HTTP2_SESSION_RECV_HEADERS
                       --> fin = false
                       --> :status: 403
                           server: openresty/1.9.15.1
                           date: Tue, 07 Mar 2017 14:54:28 GMT
                           content-type: application/json
                           access-control-allow-origin: https://toolkit.crosscountryapp.com
                           access-control-allow-credentials: true
                           access-control-expose-headers: ETag
                       --> stream_id = 3
t=1179715 [st=1567]    HTTP2_SESSION_RST_STREAM
                       --> description = ""
                       --> status = 2
                       --> stream_id = 3


Comment 9 by b...@chromium.org, Mar 7 2017

Status: Assigned (was: Fixed)
You can fix this very easily.
Here are all cause and solution to Fix ERR_SPDY_PROTOCOL_ERROR
https://www.howtoseeks.com/err_spdy_protocol_error/

Comment 11 Deleted

Sign in to add a comment