Closed isley-griffith closed 5 months ago
What did you do to fix this?
@clementpeleman Make sure you set the secret in the vault.
After replacing with your project-id, run the following:
select vault.create_secret(
'https://<your-project-id>.supabase.co',
'supabase_url'
);
Great, thanks! I thought this file did run automatically..
@clementpeleman unfortunately it requires your unique project-id. Quite the headache, this one.
Yes, I see. Thanks for the clarification. I had this configured in the seed.sql file, but not quite sure what that's for then. Maybe some verification if it is using the correct project?
@clementpeleman It is to call the proper edge function.
In this function:
create function private.handle_storage_update()
returns trigger
language plpgsql
as $$
declare
document_id bigint;
result int;
begin
insert into documents (name, storage_object_id, created_by)
values (new.path_tokens[2], new.id, new.owner)
returning id into document_id;
select
net.http_post(
url := supabase_url() || '/functions/v1/process', <==============
headers := jsonb_build_object(
'Content-Type', 'application/json',
'Authorization', current_setting('request.headers')::json->>'authorization'
),
body := jsonb_build_object(
'document_id', document_id
)
)
into result;
return null;
end;
$$;
The proper edge function, "/functions/v1/process" is appended to the supabase_url, which is what you provide to the vault.
Bug report
Describe the bug
Hello,
After connecting it up to a Supabase project, I am getting the following error when uploading through the application or through the Supabase dashboard:
Failed to upload roman-empire-1.md: insert into "objects" ("bucket_id", "metadata", "name", "owner", "owner_id", "version") values ($1, DEFAULT, $2, DEFAULT, DEFAULT, $3) - null value in column "url" of relation "http_request_queue" violates not-null constraint
I am doing the cloud Supabase version.
To Reproduce
npm i
supabase link --project-ref=<your-ref>
npx supabase db push
npm run dev
and try to upload a .md file.Expected behavior
To be able to upload a .md file.
Screenshots
System information
OS: macOS, Macbook Pro M1 Max
Version of supabase-js: latest
Version of Node.js: 18.17.1