May u check if this address to your problem? https://github.com/jsr-io/jsr/issues/564
Hey mate, are you using any proxy/vpn? seems the main typescript file of edge functions canβt hit this package from `jsr`
Hey guys π Sorry for my delay on this response, We've being investigating this situation and I was making sure to get an appropriated answer for it. - What caused `SUPABASE_EDGE_RUNTIME_ERROR`? We've a healthy check detection that closes incoming connections to avoid Out-Of-Memory errors. It happens due Service reaching the end of its life-time while still serving some edge-function. When this situation happened a `503` error was sent back with a generic error code `SUPABASE_EDGE_RUNTIME_ERROR`. - Why this is now returning `SUPABASE_EDGE_RUNTIME_SERVICE_DEGRADED`? To improve error handling, we introduced this new error code that better explains this situation instead of generic `SUPABASE_EDGE_RUNTIME_ERROR`. - Why it seems solved for a while? We changed some infrastructure features in order to fix the problem but seems it wasn't enough. - How we're procceding now? We're deploying a new retry-on-degraded feature, that will run at platform level. It should retry your edge-function automatically in case of unhealthy service. It may increase the latency up to `600ms` as a trade-off we execute the request instead of fail-fast. As an addition, we've also changed the conditions for returning `503` to be less agressive. The situation should be solved in the next couple hours. Please any feedback or question is always wellcome π
Hey guys!! I'm already following the latency issue all this morning. We're investigating the root cause, I hope it get solved soon <:peepoHeart:1047242157221757018>
Hey everyone <:peepoHeart:1047242157221757018> <@246369113293848577> thanks for reporting it! We're following up this region. It got a few spikes but seems coming back to low again...
Hey <@1465370082795327720> π To validate your users with new assymetric JWT, you need to follow the [steps described here](https://supabase.com/docs/guides/functions/auth#integrating-with-supabase-auth). You can handle the JWT token, and use Supabase auth to validate it. Using the `getClaims()` method
Hey there! Please check this documentation: https://supabase.com/docs/guides/functions/auth
I think it should work for this other scenario too! Since you'll be updating the current user password. If you need a more privileged case like an admin dashboard you need to go with this [admin submodule](https://supabase.com/docs/reference/javascript/admin-api)
Hi π Its your database running? try: ```bash supabase stop supabase db diff -f <name> ``` Also double check if your schemas folder/file path is well defined at `config.toml` file
Since you added 30K it should be `6KB * 30,000 = 180MB`
The correct is: `6KB * 885,000 = ~5.31GB`
Sorry, I checked again and seems that bad converted
Maybe, if possible, you should try to incrementally ingest new records. Like feeding records in small batches or when you create them. Instead of a big embedding process. But, of course it will depends on your application case.
I think its a normal behaviour, since a lot of data changed at once, it probably could triggered some optimisation routine that reordered your data or did something like that.
If you're incrementally adding records it may doesn't reflect at same way as a big batch. I do believe that it could be related with pg indexes trying to manage as well the other services arround it. If you look the 1ΒΊ chart, the memory was initially cached, then after your intervention it has been moved out causing this dark green spike. And at the end it started to be cached again.
You can check the execution limits in [this page](https://supabase.com/docs/guides/functions/limits#runtime-limits). - 140s Free tier - 400s Paid tier
If the service takes to long to respond your function may be dropped at the middle, you can try fetch it from a [background task](https://supabase.com/docs/guides/functions/background-tasks), that allows long running tasks.
Hi <@1163441218370404433> π May you share the code snippet that you're using for generating the password reset emails? Here you can find the [docs about password reset](https://supabase.com/docs/guides/auth/passwords?queryGroups=flow&flow=implicit&queryGroups=framework&framework=nextjs#resetting-a-password) Note there's 2 possible always, **implict** flow or **PKCE** From your snippet, it seems that you're using the 2ΒΊ one, can you confirm if you're following all steps? Pls, double check if you'd correctly setup the email template
Then, don't forget that your available memory is also consumed by other services: *Besides Postgres, a wide range of services are running under the hood resulting in an elevated base memory usage.*
`6KB * 885K = ~885MB` You can round it to almost `1Gb`by sum embeddings + other table data
if you're using a `float32` vector of `1536` it will be approximately `~4 Bytes * 1536 = ~6KB` Then multiplying by the records that you added `6KB * 10,0000 = ~60MB` π€ How much records do you have in total?
Depending on your use case, perhaps a [halfvec](https://github.com/pgvector/pgvector?tab=readme-ov-file#half-precision-indexing) can help you
what the dims size that you're using? depending on the vector type it can eat a lot of memory space
Hi <@663929340240855041> can you share a code snippet of your embedder function? Also how are you processing it? using supabase queues, background tasks or anything else?
> Which suggests that the issue is coming from these lines: Update these lines to match the snippet from the suggestion that I mentioned above
There's already a [PR](https://github.com/wasm-bindgen/wasm-bindgen/pull/4795) to fix it, hope that wasm team could merge it soon. Meanwhile users need to [follow this ](https://github.com/supabase/edge-runtime/issues/640#issuecomment-3503339438)
This problem seems related with this [GH issue](https://github.com/supabase/edge-runtime/issues/640) Please try to update your wasm entrypoint file to load the same way I suggested in [this comment](https://github.com/supabase/edge-runtime/issues/640#issuecomment-3503339438) It happens cause `fetch(wasmUrl)` is not supported by Deno, its a [upstream issue](https://github.com/wasm-bindgen/wasm-bindgen/issues/4794) from `wasm-bindgen` tool
Hey <@1134343362858713098> π I was able to update functions on my project, May you try again? If the problem persists, please try to update it locally and then [deploy using CLI](https://supabase.com/docs/guides/functions/quickstart#step-6-deploy-to-production)
For now, you need to update local files to change your edge-functions. Also be aware that the video uses a Non-Production setup and its should used only for local development. If you need to SelfHost a production ready project you must follow the [self-hosting docs](https://supabase.com/docs/guides/self-hosting) !!! **Exposing `supabase init` projects are unsafe and shouldn't be used for production porpouses** !!!!
The community version of the [Edge Functions Managment API](https://github.com/supabase/supabase/pull/40690) is still under development. We're planning to start with Readonly operations and then deployment features
https://supabase.com/dashboard/support/new
Please open a costumer support ticket for it
Just need to adapt some parts, like using from Supabase auth etc...
Yes you can, the `sdk` library can be used by both client and backend sides! You can use it from your BE in the same way of an edge-function (a Supabase worker endpoint)
Based on your description, seems your'e trying to build a multi-tenant application. Supabase can be used for all kind of projects, you just need to define your db schemas and enforce RLS policies β This one will make your life so much easier cause you don't need to worry about filtering data based on vendor or checking permission (My fav thing about supa is RLS) π Then all frontend things can also be rendered based on current tenant, so its more about your domain logic than Supabase itself!
If possible, try generate the `deno-lock` file locally an then change its version to `4`
Hey <@224501376380698634> π Supabase is a Backend as a service, this way you can replace almost all BE code by Supabase and take benefit of its features!! But if you're looking on just use the Auth, I think you should have try the [oAuth Server guide](https://supabase.com/docs/guides/auth/oauth-server)
It should be in the middleware
You can use the same approach of the JWT validator template that I sent, but translating it for a python equivalent
Hey <@1340316497502928917> π If you're trying to integrate Clerk with Edge Functions, you need to follow this [answer](https://github.com/orgs/supabase/discussions/34988#discussioncomment-14970798) where I do explain about this topic. In addiction you should use the following [template](https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/_shared/jwt/clerk.ts) β Feel free to customise it based on your application needs
This is how appers on my side
I believe that just resuming it should be fine! My free testing projects got this a lot of times, and I do always just click in the "resume" button at dashboard to get it online again
Hey <@1132907025785958410> π Are you trying to compile from source? if so you have 2 options to run `studio` 1. using the local version (cli): At the project root folder you need to run the following commands ```sh pnpm install pnpm run dev:studio-local ``` then navigate to `http://localhost:8082` 2. full docker environment, its will map your local folder to the studio container, so you can benefit of hot-reloading at same time of container env: ```sh cd docker docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up -d docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml watch studio ``` There's another way using `pnpm run dev:studio` but honesty I don't know how to use this one π
> best practices for routing It will depend on your preferences, there people that like to use some route handler convention like the one I paste above, others that prefer to just split the code logic in a decoupled style. In my case I like to keep it simple, following the default convention "single endpoint per function folder" while decoupling business logic in different files to share code in other places. There's a lot of [official examples](https://supabase.com/docs/guides/functions#examples) in the docs page. > How to handle POST + JSON parsing properly in Deno Deno makes it pretty simple, you can just extract it from `await request.json()`, but if you need to enforce validation, I do suggest to wrap it with [zod library](https://zod.dev/basics) . To return a json result is so simple a `Response.json()` > How to handle environment variables You can read envs by calling `Deno.env.get('VAR_NAME')`, please check the [secrets guide](https://supabase.com/docs/guides/functions/secrets) to learn how expose envs with Supabase edge-functions
Hey <@341072861617717248> π Edge functions already uses a single function endpoint convention, so each `functions/<function-name>/index.ts` will be translate as `api/functions/v1/<endpoint-name>`. I suggest you to check the [sb/supabase examples](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions) as well the [sb/edge-runtime examples](https://github.com/supabase/edge-runtime/tree/main/examples) folders. Some of then uses popular http libs like express, fastify, or oak. If you need to declare sub-routes inside a single edge-function, the [oak](https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/oak-server/index.ts) server is a great example. What's also possible todo is to have multiple `Http methods` in the same function, then you can structure your project folder to split the logical code in different files: ``` functions/<function-name> |-> index.ts // function handler entrypoint |-> post.ts // some code logic for post request |-> get.ts // some code logic for get request ``` ```ts // functions/<function-name>/index.ts import { handlePost } from "./post.ts" import { handleGet } from "./get.ts" Deno.serve(async(req: Request) => { const method = req.method; if(method === "POST") return await handlePost(req); if(method === "GET") return await handlePost(req); return Response.json({ error: "method not allowed" }, 405); }); ```
Hey <@1226972506565382198> π Yes! like <@1031542272254279710> mentioned, you need to update the your [createClient](https://github.com/amal-chandran/supabase-experiments/blob/fbd893494e351a34fff10b297634aa4fb75bc3f0/apps/web/src/lib/supabase-client.ts#L16) definition to use your database types: First compile your database types: ```sh supabase gen types typescript > some-path/database.types.ts ``` Then use it while instancing your supabase client ```ts import { createClient } from '@supabase/supabase-js' import { Database } from './database.types' // Importing the compiled types const supabase = createClient<Database>(...) // Referencing it as TS Generic parameter ``` You can find the full documentation [here](https://supabase.com/docs/reference/javascript/typescript-support) !
cc <@925342452586532874>
Hi <@935143551057133568> > I started playing with N8N... Tested a few embeddings, those were quite slow, You don't need n8n or any other external tool! But I high recommend using [pgflow](https://www.pgflow.dev/) on top of your edge-functions. Using it you can orchestrate your supabase db to handle pipeline processing in the most easiest way!! Edge Runtime also haves a built-in [onnx compatibility](https://onnxruntime.ai/) so it ensures fast inference when using [transformers.js](https://github.com/huggingface/transformers.js) library! Here you can find example of a [Ticket classifier](https://github.com/kallebysantos/bugguana) app that uses AI pipeline to classify discord threads β just like this one For vector searching, you can check this [Natural search](https://github.com/supabase/smart-office-demo/tree/main/supabase/functions/room-natural-search) example, from [smart-office-demo](https://github.com/supabase/smart-office-demo) project. This one is very nice, cause it combines [HyDE](https://youtu.be/v_BnBEubv58) + [Self Querying Retrieval](https://youtu.be/f4LeWlt3T8Y) + [Hybrid search](https://supabase.com/docs/guides/ai/hybrid-search) concepts to create a very powerful natural language search bar. This project also uses pgflow to process embeddings!
Soon π€
it is, do you prefer Nextj or other framework? I saw you may been using tanstack