Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE with error 16 #5670

Closed
lxqwh opened this issue Jul 10, 2020 · 11 comments
Closed

CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE with error 16 #5670

lxqwh opened this issue Jul 10, 2020 · 11 comments

Comments

@lxqwh
Copy link

lxqwh commented Jul 10, 2020

Sometimes, I got failed with errorcode 16 when I set CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE on to use http2(nghttp2) directly. And I am sure that my server supports h2c (it usually works fine)

I did this

With multi handle interface, and 64 requests parallelly.
At beginning, all requests is will, And then comes failures in succession
17:44:23.010 handle: 0x960a4000)Found bundle for host 111.206.23.51: 0x94e6d878 [can multiplex]
17:44:23.010 handle: 0x960a4000)Re-using existing connection! (#133) with host 111.206.23.51
17:44:23.010 handle: 0x960a4000)Connected to 111.206.23.51 () port 80 (#133)
17:44:23.011 handle: 0x960a4000)Using Stream ID: 273 (easy handle 0x960a4000)
17:44:23.011 handle: 0x960a4000)GET /videos/v0/20200605/99/c5/824aeafae365b02e4ca7f25a4810218a.mp4?key=0af89d06169db0f6df20358d952a841cf&dis_k=26de1f4b6b3dfe1d89369baa73700b77a&dis_t=1594287862&dis_dz=CNC-QiYi&dis_st=44&src=iqiyi.com&dis_hit=0&uuid=ca6c0ef0-5f06e6f6-292&ve=be4c77dbf91bb90f2fadcebbdddf2f09&m=v&dfp=&qd_tvid=16501095300&qd_p=ca6c0ef0&qd_k=bc152f5539b9e7a394e3985f788de2bb&pv=0.1&rj=1&qd_src=08020661010000000000&qd_vip=1&dis_src=vrs&qd_uid=1812458959&qd_tm=1594287862116&sgti=22_vr_7cdf9febba9123744dfdca2c1c0e10f8_1549106468577_1594287598796 HTTP/2
17:44:23.011 Host: 111.206.23.51
17:44:23.011 accept: /
17:44:23.011 accept-encoding: gzip, deflate
17:44:23.011 qyid: vr_7cdf9febba9123744dfdca2c1c0e10f8_1549106468577
17:44:23.011 user-agent: QYPlayer/Android/4.6.1801;BT/mcto;Pt/Mobile;NetType/wifi;Hv/10.1.2.301;QTP/1.1.44.11
17:44:23.011 range: bytes=0-1441
17:44:23.011

17:44:23.011 handle: 0x960a4000)stopped the pause stream!
17:44:23.011 handle: 0x960a4000)Connection #133 to host 111.206.23.51 left intact

I expected the following

expected no error occur

curl/libcurl version

libcurl/7.69.1 BoringSSL zlib/1.2.8 c-ares/1.14.0 nghttp2/1.40.0

operating system

Android

@sterchelen
Copy link
Contributor

Hi @lxqwh,

Does it works without CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE activated, use either CURL_HTTP_VERSION_2_0 or CURL_HTTP_VERSION_2TLS if you have tls.

@lxqwh
Copy link
Author

lxqwh commented Jul 10, 2020

We tested h2 over tls, it works fine. But we didn't do large scale tests for it.
h2c is heavily used in our app, mainly for VR piece videos download. It's Highly concurrent. h2 over tls is not suitable for it's high cpu cost.

@sterchelen
Copy link
Contributor

All right, did you try setting the error buffer --> https://curl.haxx.se/libcurl/c/CURLOPT_ERRORBUFFER.html
Might be helpful :)

@bagder bagder added the HTTP/2 label Jul 10, 2020
@bagder
Copy link
Member

bagder commented Jul 10, 2020

"Prior knowledge" is not plain h2c. Ordinary HTTP/2 done over clear text (h2c) is done with an upgrade procedure from HTTP/1, while prior knowledge skips that upgrade step - much more rare use case and setup.

@bagder
Copy link
Member

bagder commented Jul 12, 2020

Please help us and describe how we can reproduce this problem or give us a much more detailed description of the problem with logs.

@jay jay added the needs-info label Jul 15, 2020
@lxqwh
Copy link
Author

lxqwh commented Aug 21, 2020

image

At the beginning, all the requests are finished successfully (red box). But after 7s, All requests Get error 16 (green box),add can't capture any packets for those requests.
image

http2_error16_.zip

@bagder
Copy link
Member

bagder commented Aug 21, 2020

Please describe how we can reproduce this

@lxqwh
Copy link
Author

lxqwh commented Aug 24, 2020

image
It same to be that when client side had sent a GOAWAY(FRAME_SIZE_ERROR(6), too large frame size),libcurl reuse the connection to create a new stream.

@lxqwh
Copy link
Author

lxqwh commented Aug 24, 2020

2020-08-21 17:23:24.371 32768 bytes stray data read before trying h2 connection
2020-08-21 17:23:24.371 Found bundle for host 111.206.23.48: 0xa1430bb0 [can multiplex]
2020-08-21 17:23:24.371 Re-using existing connection! (#51) with host 111.206.23.48
2020-08-21 17:23:24.371 Connected to 111.206.23.48 () port 80 (#51)
2020-08-21 17:23:24.372 Using Stream ID: 71d (easy handle 0x76eff000)
2020-08-21 17:23:24.372 Send header (reid: 38476348, handle: 0x76eff000)GET /videos/v0/20200730/c5/9a/82be32f68000940139742f149c2b5aab.mp4?key=0bfe78de2a2e62409d6448d36ae4c9a56&dis_k=2590d5da0ed5883ac13f1f1ad797a73dd&dis_t=1598001804&dis_dz=CNC-QiYi&dis_st=44&src=iqiyi.com&dis_hit=0&uuid=ca6c0ef0-5f3f928c-294&ve=c8ca25d552369c36ab1995b858484c49&m=v&dfp=&qd_tvid=9000000051599600&qd_p=ca6c0ef0&qd_k=e11a2127c4d1e639b1bd27a511ba9b9c&pv=0.1&rj=1&qd_src=08020661010000000000&qd_vip=1&dis_src=vrs&qd_uid=1812458959&qd_tm=1598001803174&sgti=22_vr_138f6c518d2927b4b4aca288a434c35f_1597403903101_1598001802706 HTTP/2
2020-08-21 17:23:24.373 stopped the pause stream!
2020-08-21 17:23:24.373 Connection #51 to host 111.206.23.48 left intact

when creating Stream 71d,GOAWAY had already sent by client

@bagder
Copy link
Member

bagder commented Sep 19, 2020

Have you tried this with the latest libcurl version?

@bagder
Copy link
Member

bagder commented Oct 1, 2020

This issue has not gotten sufficient attention for a while and will therefore be closed.

If you still experience problems and can bring more information or data to this issue, we can certainly open it again and continue from here. (Or just open a new issue.)

Thanks!

@bagder bagder closed this as completed Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants