pg_net icon indicating copy to clipboard operation
pg_net copied to clipboard

"SSL connect error", "Error in the HTTP2 framing layer" while using edge functions

Open steve-chavez opened this issue 2 years ago • 2 comments

Problem

A customer has reported "SSL connect error", "Error in the HTTP2 framing layer" showing in the pg_net._http_response table while making calls to Supabase edge functions. The customer informs this happens after 270 requests.

This seems to be related to libcurl:

  • https://github.com/curl/curl/issues/3750
  • https://github.com/curl/curl/issues/10634. According to https://github.com/curl/curl/commit/cbe9d82c22c38753ad6372e5040e4c51b3695dc7, this fix is available on curl 8.0.0. While the Supabase platform has curl 7.68.0.

Proposal

Vendor libcurl, this way we get the latest fixes and we're not dependent on the Supabase platform version.

steve-chavez avatar Nov 02 '23 16:11 steve-chavez

When are we going to upgrade to using curl version 8?

I am using the hosted version of Supabase. I can easily reproduce this error... just do GET calls that return JSON bodies. I do about 500 calls within couple of minutes and I see these SSL errors.

How do I know the curl version being used by my system? I ran the following query. The result has no mention of the curl version.

select backend_type from pg_stat_activity where backend_type like '%pg_net%';

backend_type
pg_net 0.8.0 worker

metarama avatar Jul 04 '24 08:07 metarama

This defect in pg_net is a Showstopper. Abandoned pg_net. Using http extension.

metarama avatar Jul 04 '24 22:07 metarama

The result has no mention of the curl version.

We used to have that at one point https://github.com/supabase/pg_net/pull/122 but it was reverted https://github.com/supabase/pg_net/pull/124. Maybe we can bring it back.

Now that we have a Nix build we might be able to fix this issue too.

steve-chavez avatar Aug 08 '24 06:08 steve-chavez

This should no longer happen now that Supabase cloud has libcurl 8.6.0.

Please reopen if the error persists.

steve-chavez avatar Sep 12 '24 15:09 steve-chavez

@steve-chavez we are facing the same issue, a lot of POST requests are going into these errors.

harshgour avatar Sep 25 '24 04:09 harshgour

@harshgour Which version of pg_net are you using? Check with:

select extversion from pg_extension where extname = 'pg_net';

The latest version is 0.10.0

steve-chavez avatar Sep 25 '24 14:09 steve-chavez