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.

Re: 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 17:22:33 +0200

Thanks for your reply.

I tried it with the latest version and unfortunately it still doesnt work.

curl -V
curl 7.77.0 (x86_64-redhat-linux-gnu) libcurl/7.77.0 NSS/3.53.1
zlib/1.2.7 libpsl/0.7.0 (+libicu/50.1.2) libssh2/1.9.0 nghttp2/1.39.1
OpenLDAP/2.4.44 libmetalink/0.1.3
Release-Date: 2021-05-26
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap
ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos
Largefile libz Metalink NTLM NTLM_WB PSL SPNEGO SSL UnixSockets

HTTP2 connection with prior knowledge initiated by curl, No TLS. Server
sends GoAway frame after processing each request.


On 5/27/21 1:36 PM, Daniel Stenberg wrote:
> On Thu, 27 May 2021, Shikha Sharma via curl-library wrote:
>
>> 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.
>
> I'm afraid this descripion lacks details to allow us to draw many
> conclusions. You also didn't mention if you use h2 over TLS or not and
> you didn't state which nghttp2 version you're using.

>> 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.
>
> If that's true then it sounds like a bug to me. We've fixed several h2
> related bugs since 7.74.0 so I'd recommand you start out by trying the
> latest curl version and see if anything gets better.
>

Addiing curl verbose logs of couple of curl requests, 1 is okay, 2nd
fails and 3rd is okay again.

I * Too old connection (172 seconds), disconnect it
* Connection 90 seems to be dead!
* Closing connection 90
* Hostname in DNS cache was stale, zapped
*   Trying 127.0.0.1:10001...
* Connected to 127.0.0.1 (127.0.0.1) port 10001 (#91)
* 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: Thu, 27 May 2021 12:22:20 GMT
<
* Connection #91 to host 127.0.0.1 left intact
--------------------------------------------------<Connection not marked
as closed yet>-------------------------
* Found bundle for host 127.0.0.1: 0x7fbc08007680 [can multiplex]
* 17 bytes stray data read before trying h2 connection
* Re-using existing connection! (#91) with host 127.0.0.1
* Connected to 127.0.0.1 (127.0.0.1) port 10001 (#91)
* Using Stream ID: 3 (easy handle 0x7fbc08000a30)
----------------------------------------------------<created new
stream>------------------------------------------------------
> 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!
------------------------------------------------------<Goaway processed?>
* Closing connection 91
* 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 (#92)
* 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: Thu, 27 May 2021 12:22:21 GMT
<
* Closing connection 92 ---------------------------------------Here
connection marked as closed already-------------------------------
* 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 (#93)
* 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: Thu, 27 May 2021 12:22:21 GMT
<
* Closing connection 93



-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html
Received on 2021-05-27