curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Libcurl reports 'Error in the HTTP2 framing layer' (16) for outgoing request.

From: Shikha Sharma via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 27 May 2021 12:26:01 +0200

Hello,

I am facing an issue where curls responds with error "'Error in the
HTTP2 framing layer' (16)" to the application.

Curl version: libcurl-7.74.0

Scenario: Sending multiple outgoing HTTP2 requests to an external HTTP
server.

Issue: The first request is processed okay and then randomly some
request start reporting the above error. The server responds with GoAway
frame after each response.

So it looks as if its a race condition where the client starts
processing the new request and creates a stream on the existing
connection before the goaway frame from the previous connection is
processed. The request is ultimately dropped and application using
libcurl receives the framing error.

The verbose output for curl is as below:

* 17 bytes stray data read before trying h2 connection
* Found bundle for host 127.0.0.1: 0x7fbc08011db0 [can multiplex]
* Hostname 127.0.0.1 was found in DNS cache
*   Trying 127.0.0.1:10001...
* Connected to 127.0.0.1 (127.0.0.1) port 10001 (#55)
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after
upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fbc08000a30)
> POST /nausf-auth/v1/ue-authentications HTTP/2
Host: 127.0.0.1:10001
user-agent: bf-am-http
accept: application/json
cache-control: no-cache
content-type: application/json
content-length: 106

* We are completely uploaded and fine
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 201
< content-type: application/json
< location:
http://192.168.56.101:8001/nausf-auth/v1/ue-authentications/suci-0-208-93-0000-0-0-0000000003

< content-length: 366
< date: Wed, 26 May 2021 12:16:58 GMT
<
* Connection #55 to host 127.0.0.1 left intact
* Found bundle for host 127.0.0.1: 0x7fbc08011db0 [can multiplex]
* 17 bytes stray data read before trying h2 connection
* Re-using existing connection! (#55) with host 127.0.0.1
* Connected to 127.0.0.1 (127.0.0.1) port 10001 (#55)
* Using Stream ID: 3 (easy handle 0x7fbc08000a30)
> POST /nausf-auth/v1/ue-authentications HTTP/2
Host: 127.0.0.1:10001
user-agent: bf-am-http
accept: application/json
cache-control: no-cache
content-type: application/json
content-length: 106

* stopped the pause stream!
* Closing connection 55

The next request after this works fine.

The screenshot of pcap is attached.

Is there a way this race condition/ error can be avoided?

Please let me know if more information is needed for this.


Regards,

Shikha



-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html

Screenshot_from_2021-05-27_11-26-56.png
(image/png attachment: Screenshot_from_2021-05-27_11-26-56.png)

Received on 2021-05-27