supabase / pg_net

A PostgreSQL extension that enables asynchronous (non-blocking) HTTP/HTTPS requests with SQL
https://supabase.github.io/pg_net
Apache License 2.0
236 stars 18 forks source link

pg_net worker on hosted not running/requests not being executed #76

Closed ScarVite closed 1 year ago

ScarVite commented 1 year ago

Bug report

Describe the bug

After installing the pg_net extension via Database->Extensions GUI the Queries do not get executed, as the background worker is not running. tested this on self-hosted and it's working like intended there

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to Databases -> Click on Extensions -> Enable pg_net
  2. Switch to SQL Tab and execute following query select net.check_worker_is_up()
  3. Failed to run sql query: the pg_net background worker is not up Other way to test:
  4. Go to Databases -> Click on Extensions -> Enable pg_net
  5. Switch to SQL Tab and execute following query select net.http_get('https://filesamples.com/samples/code/json/sample2.json') and take note of the responding id.
  6. select net.http_collect_response(id) - id = result from query before
  7. get error "request matching request_id not found"

Expected behavior

check_worker_is_up should return the process id of the running worker. http_collect_response should return the status success and data along with it success (this is on my local supabase cli instance)

Screenshots

As you can see, the response is not collect and instead it tells the request failed collect_response

As you can see here the worker is not running. worker

Additional context

This works on local. The error "request matching request_id not found" only comes to be, as a result of the request not being executed and instead "vanishing"

steve-chavez commented 1 year ago

Can you share the output of:

select extversion from pg_extension where extname = 'pg_net';
ScarVite commented 1 year ago

Hey, Happy New Year!

Somehow didn't get notified about your comment, but when running your query i got "0.6" as the response

steve-chavez commented 1 year ago

I believe this was related to https://github.com/supabase/pg_net/issues/80. This has been fixed on 0.7, which will be deployed to Supabase soon.

northfacejmb commented 7 months ago

Stumbled onto this while debugging some unexpected behavior related to PG_Net. select extversion from pg_extension where extname = 'pg_net'; = 0.7.1

While the posts above says this was fixed in #80, I got a few ERROR,"request matching request_id not found" errors while debugging a que_system that works but sometimes gets this error before it tries again.