go: x/net/http2: GET fails on content with very large header

What version of Go are you using (go version)?

go1.8.1.typealias

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

Tried to read a GCS object with large metadata, which results in a large header (value is 100,000 bytes long).

import "cloud.google.com/go/storage"
...
 r, err := obj.NewReader(ctx)

If possible, provide a recipe for reproducing the error.

I can do this if you need it.

What did you expect to see?

Here’s the http2debug=2 output when the metadata value has size 100:

2017/06/15 16:03:08 http2: Transport failed to get client conn for storage.googleapis.com:443: http2: no cached connection was available
2017/06/15 16:03:08 http2: Transport creating client conn 0xc420972820 to [2607:f8b0:4006:819::2010]:443
2017/06/15 16:03:08 http2: Framer 0xc420d72340: wrote SETTINGS len=18, settings: ENABLE_PUSH=0, INITIAL_WINDOW_SIZE=4194304, MAX_HEADER_LIST_SIZE=10485760
2017/06/15 16:03:08 http2: Framer 0xc420d72340: wrote WINDOW_UPDATE len=4 (conn) incr=1073741824
2017/06/15 16:03:08 http2: Transport encoding header ":authority" = "storage.googleapis.com"
2017/06/15 16:03:08 http2: Transport encoding header ":method" = "GET"
2017/06/15 16:03:08 http2: Transport encoding header ":path" = "/veener-jba/metadata-test"
2017/06/15 16:03:08 http2: Transport encoding header ":scheme" = "https"
2017/06/15 16:03:08 http2: Transport encoding header "user-agent" = "gcloud-golang-storage/20151204"
2017/06/15 16:03:08 http2: Transport encoding header "authorization" = "Bearer [redacted]"
2017/06/15 16:03:08 http2: Transport encoding header "accept-encoding" = "gzip"
2017/06/15 16:03:08 http2: Framer 0xc420d72340: wrote HEADERS flags=END_STREAM|END_HEADERS stream=1 len=179
2017/06/15 16:03:08 http2: Framer 0xc420d72340: read SETTINGS len=18, settings: MAX_CONCURRENT_STREAMS=100, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=16384
2017/06/15 16:03:08 http2: Transport received SETTINGS len=18, settings: MAX_CONCURRENT_STREAMS=100, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=16384
2017/06/15 16:03:08 Unhandled Setting: [MAX_HEADER_LIST_SIZE = 16384]
2017/06/15 16:03:08 http2: Framer 0xc420d72340: wrote SETTINGS flags=ACK len=0
2017/06/15 16:03:08 http2: Framer 0xc420d72340: read WINDOW_UPDATE len=4 (conn) incr=983041
2017/06/15 16:03:08 http2: Transport received WINDOW_UPDATE len=4 (conn) incr=983041
2017/06/15 16:03:08 http2: Framer 0xc420d72340: read SETTINGS flags=ACK len=0
2017/06/15 16:03:08 http2: Transport received SETTINGS flags=ACK len=0
2017/06/15 16:03:08 http2: Framer 0xc420d72340: read HEADERS flags=END_HEADERS stream=1 len=1243
2017/06/15 16:03:08 http2: decoded hpack field header field ":status" = "200"
2017/06/15 16:03:08 http2: decoded hpack field header field "expires" = "Thu, 15 Jun 2017 20:03:08 GMT"
2017/06/15 16:03:08 http2: decoded hpack field header field "date" = "Thu, 15 Jun 2017 20:03:08 GMT"
2017/06/15 16:03:08 http2: decoded hpack field header field "cache-control" = "private, max-age=0"
2017/06/15 16:03:08 http2: decoded hpack field header field "last-modified" = "Thu, 15 Jun 2017 20:03:08 GMT"
2017/06/15 16:03:08 http2: decoded hpack field header field "etag" = "\"7324a8fc1e479cffa07031d88f05267b\""
2017/06/15 16:03:08 http2: decoded hpack field header field "x-goog-meta-k1" = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
2017/06/15 16:03:08 http2: decoded hpack field header field "content-type" = "text/plain; charset=utf-8"
2017/06/15 16:03:08 http2: decoded hpack field header field "accept-ranges" = "bytes"
2017/06/15 16:03:08 http2: decoded hpack field header field "content-length" = "16"
2017/06/15 16:03:08 http2: decoded hpack field header field "server" = "UploadServer"

What did you see instead?

With size 100000:

2017/06/15 16:04:10 http2: Transport failed to get client conn for storage.googleapis.com:443: http2: no cached connection was available
2017/06/15 16:04:10 http2: Transport creating client conn 0xc420d6a000 to [2607:f8b0:4006:819::2010]:443
2017/06/15 16:04:10 http2: Framer 0xc4200816c0: wrote SETTINGS len=18, settings: ENABLE_PUSH=0, INITIAL_WINDOW_SIZE=4194304, MAX_HEADER_LIST_SIZE=10485760
2017/06/15 16:04:10 http2: Framer 0xc4200816c0: wrote WINDOW_UPDATE len=4 (conn) incr=1073741824
2017/06/15 16:04:10 http2: Transport encoding header ":authority" = "storage.googleapis.com"
2017/06/15 16:04:10 http2: Framer 0xc4200816c0: read SETTINGS len=18, settings: MAX_CONCURRENT_STREAMS=100, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=16384
2017/06/15 16:04:10 http2: Transport received SETTINGS len=18, settings: MAX_CONCURRENT_STREAMS=100, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=16384
2017/06/15 16:04:10 http2: Transport encoding header ":method" = "GET"
2017/06/15 16:04:10 http2: Transport encoding header ":path" = "/veener-jba/metadata-test"
2017/06/15 16:04:10 http2: Transport encoding header ":scheme" = "https"
2017/06/15 16:04:10 http2: Transport encoding header "authorization" = "Bearer [redacted]"
2017/06/15 16:04:10 http2: Transport encoding header "user-agent" = "gcloud-golang-storage/20151204"
2017/06/15 16:04:10 http2: Transport encoding header "accept-encoding" = "gzip"
2017/06/15 16:04:10 http2: Framer 0xc4200816c0: wrote HEADERS flags=END_STREAM|END_HEADERS stream=1 len=179
2017/06/15 16:04:10 Unhandled Setting: [MAX_HEADER_LIST_SIZE = 16384]
2017/06/15 16:04:10 http2: Framer 0xc4200816c0: wrote SETTINGS flags=ACK len=0
2017/06/15 16:04:10 http2: Framer 0xc4200816c0: read WINDOW_UPDATE len=4 (conn) incr=983041
2017/06/15 16:04:10 http2: Transport received WINDOW_UPDATE len=4 (conn) incr=983041
2017/06/15 16:04:10 http2: Framer 0xc4200816c0: read SETTINGS flags=ACK len=0
2017/06/15 16:04:10 http2: Transport received SETTINGS flags=ACK len=0
2017/06/15 16:05:39 http2: Transport closing idle conn 0xc420072680 (forSingleUse=false, maxStream=1)
2017/06/15 16:05:39 http2: Transport readFrame error on conn 0xc420072680: (*net.OpError) read tcp [2620:0:1003:1001:6ce4:cf29:3a31:6e42]:58414->[2607:f8b0:4006:819::200d]:443: use of closed network connection
2017/06/15 16:05:40 http2: Transport closing idle conn 0xc420d6a9c0 (forSingleUse=false, maxStream=1)
2017/06/15 16:05:40 http2: Transport readFrame error on conn 0xc420d6a9c0: (*net.OpError) read tcp [2620:0:1003:1001:6ce4:cf29:3a31:6e42]:37024->[2607:f8b0:4006:814::200a]:443: use of closed network connection
2017/06/15 16:08:10 http2: Transport readFrame error on conn 0xc420d6a000: (*errors.errorString) EOF
2017/06/15 16:08:10 RoundTrip failure: unexpected EOF

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (16 by maintainers)

Most upvoted comments

Update: fixed in GFE and deployed.