The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
migrate(docs): troubleshooting 13 (#30941)
Charisc8b9615b3432
diff --git a/apps/docs/content/troubleshooting/dashboard-errors-when-managing-users-N1ls4A.mdx b/apps/docs/content/troubleshooting/dashboard-errors-when-managing-users-N1ls4A.mdxnew file mode 100644index 00000000000..22c725a26cd--- /dev/null+++ b/apps/docs/content/troubleshooting/dashboard-errors-when-managing-users-N1ls4A.mdx@@ -0,0 +1,104 @@+---+title = "Dashboard errors when managing users"+github_url = "https://github.com/orgs/supabase/discussions/21247"+date_created = "2024-02-14T04:26:37+00:00"+topics = ["auth", "studio"]+keywords = ["users"]++[api]+sdk = ["auth-signup"]++[[errors]]+message = "Failed to send magic link: failed to make magiclink request: Error sending magic link"++[[errors]]+message = "Failed to delete user: Database error deleting user"++[[errors]]+message = "Failed to create user: Database error creating new user"++[[errors]]+http_status_code = 500+message = "Database error saving new user"+---++## PROBLEM++### Receiving the following or _similar_ error messages in the Dashboard when managing users.++> ... Database error+> ... Error sending++<img+ width="243"+ src="https://github.com/supabase/supabase/assets/91111415/91732e7d-0e83-4bc8-8ce3-57ebd871d981"+/>+<img+ width="271"+ src="https://github.com/supabase/supabase/assets/91111415/30f4cd9f-3736-40ae-8606-2f060cfac0d0"+/>+<img+ width="271"+ src="https://github.com/supabase/supabase/assets/91111415/50961019-b461-44cb-9e4b-f1361aa3ad5d"+/>++### Or, receiving a comparable 500 error from the Auth REST API:++> Database error ...++<img+ width="496"+ alt="Screenshot 2024-02-13 at 10 59 17 PM"+ src="https://github.com/supabase/supabase/assets/91111415/cd151dda-5160-415c-925c-cea332887641"+/>++## SOLUTION 1 (trigger related)++Check if the auth schema contains any triggers in the [Dashboard's trigger section](https://supabase.com/dashboard/project/_/database/triggers). Remove all triggers by dropping their functions with a CASCADE modifier:++```sql+DROP FUNCTION <function name>() CASCADE;++-- If you'd prefer, you can drop the trigger alone with the following query:+-- DROP TRIGGER <trigger_name> on auth.<table_name>;+```++Then recreate the functions with a [security definer](https://supabase.com/docs/guides/database/functions#security-definer-vs-invoker) modifier before recreating the triggers.++The [SQL Editor](https://supabase.com/dashboard/project/_/sql/) contains a template for [User Management](https://supabase.com/dashboard/project/_/sql/quickstarts). Within it, there is a working example of how to setup triggers with security definers that may be worth referencing:++```sql+create table profiles (+ id uuid references auth.users on delete cascade not null primary key,+ updated_at timestamp with time zone,+ username text unique,+ full_name text,+ avatar_url text,+ website text,++ constraint username_length check (char_length(username) >= 3)+);++create function public.handle_new_user()+returns trigger as $$+begin+ insert into public.profiles (id, full_name, avatar_url)+ values (new.id, new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url');+ return new;+end;+$$ language plpgsql security definer;++create trigger on_auth_user_created+ after insert on auth.users+ for each row execute procedure public.handle_new_user();+```++### EXPLANATION++One of the most common design patterns in Supabase is to add a trigger to the `auth.users` table. The database role managing authentication (supabase_auth_admin) only has the necessary permissions it needs to perform its duties. So, when a trigger operated by the supabase_auth_admin interacts outside the auth schema, it causes a permission error.++A security definer function retains the privileges of the database user that created it. As long as it is the `postgres` role, your auth triggers should be able to engage with outside tables.++## SOLUTION 2 (constraint related)++If you did not create a trigger, check if you created a foreign/primary key relationship between the auth.users table and another table. If you did, then ALTER the [behavior](https://stackoverflow.com/questions/5383612/setting-up-table-relations-what-do-cascade-set-null-and-restrict-do) of the relationship and recreate it with a less [restrictive constraint](https://stackoverflow.com/questions/3359329/how-to-change-the-foreign-key-referential-action-behavior).diff --git a/apps/docs/content/troubleshooting/failed-to-fetch-in-dashboard-and-other-areas----browser-extension-dyDTRU.mdx b/apps/docs/content/troubleshooting/failed-to-fetch-in-dashboard-and-other-areas----browser-extension-dyDTRU.mdxnew file mode 100644index 00000000000..62174fc0c9c--- /dev/null+++ b/apps/docs/content/troubleshooting/failed-to-fetch-in-dashboard-and-other-areas----browser-extension-dyDTRU.mdx@@ -0,0 +1,24 @@+---+title = "Failed to Fetch in dashboard and other areas -- browser extension"+github_url = "https://github.com/orgs/supabase/discussions/17296"+date_created = "2023-09-09T13:22:26+00:00"+topics = ["studio"]+keywords = ["cors"]++[[errors]]+message = "Failed to Fetch"+---++Although Failed to Fetch can occur for a variety of reasons a common one in the dashboard or when using update code is related to a browser extension.++++https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf++This extension sets PATCH to be blocked by default for some reason...++<img+ width="704"+ alt="168501713-5f020510-4555-4cc3-84de-582efc1c62de"+ src="https://github.com/supabase/supabase/assets/54564956/c61b9292-2954-4c68-8129-995941f36210"+/>diff --git a/apps/docs/content/troubleshooting/jwt-expired-error-in-supabase-dashboard-F06k3x.mdx b/apps/docs/content/troubleshooting/jwt-expired-error-in-supabase-dashboard-F06k3x.mdxnew file mode 100644index 00000000000..d0797bd947e--- /dev/null+++ b/apps/docs/content/troubleshooting/jwt-expired-error-in-supabase-dashboard-F06k3x.mdx@@ -0,0 +1,14 @@+---+title = '"JWT Expired" Error in Supabase Dashboard'+github_url = "https://github.com/orgs/supabase/discussions/21135"+date_created = "2024-02-09T04:03:23+00:00"+topics = ["studio"]+keywords = ["JWT"]++[[errors]]+message = "JWT expired"+---++When the Dashboard issues JWT expired errors, it usually means your computer's time is not in sync with the actual time.++Go to https://time.is/ to compare your computer's clock with your local time. If your computer's time is inaccurate, sync it to resolve the issuediff --git a/apps/docs/content/troubleshooting/no-toast-messages-on-the-dashboard-BrvP8h.mdx b/apps/docs/content/troubleshooting/no-toast-messages-on-the-dashboard-BrvP8h.mdxnew file mode 100644index 00000000000..e1e1607b983--- /dev/null+++ b/apps/docs/content/troubleshooting/no-toast-messages-on-the-dashboard-BrvP8h.mdx@@ -0,0 +1,37 @@+---+title = "No toast messages on the Dashboard"+github_url = "https://github.com/orgs/supabase/discussions/27702"+date_created = "2024-07-01T19:45:53+00:00"+topics = ["studio"]+keywords = ["notifications", "toasts"]+---++This is a known issue that is on the roadmap to resolve. However, this discussion serves as a temporary workaround for affected users until then.++## What is the issue?++When executing operations in the Supabase dashboard, there are situations where you will not see a toast message in the top right corner to indicate the status of the operation. This leaves users confused about the operation's status and why it errored. They would then have to look in the browser console logs for further details.++Here is an example of a toast error message:++++Here is an example of a toast success message:++++## What causes it?++If you are not seeing these error messages, there are a couple of known scenarios that might be blocking them:++1. **Brave Browser**: By default, Brave has strict ad-blocking settings that can block these messages.++2. **Chrome Browser**: Specifically, the ARM64 build (tested on v125.0.6422.142) with the new v3 manifest version of uBlock Origin Lite ([https://ublockorigin.com/](https://ublockorigin.com/)). If the setting is changed from basic to optimal, it can block these messages.++There are likely other causes that are not known right now as well.++## How to fix this issue?++**Adjust Ad-blocking Settings**: Turn down the ad-blocking settings or turn it off for the Supabase dashboard.++**Use a different Browser**: If the above is not feasible, using a different browser is an alternative.diff --git a/apps/docs/content/troubleshooting/supabase-dashboard-not-loading-project-not-loading-on-dashboard-LfMq9F.mdx b/apps/docs/content/troubleshooting/supabase-dashboard-not-loading-project-not-loading-on-dashboard-LfMq9F.mdxnew file mode 100644index 00000000000..94a6b81a6f1--- /dev/null+++ b/apps/docs/content/troubleshooting/supabase-dashboard-not-loading-project-not-loading-on-dashboard-LfMq9F.mdx@@ -0,0 +1,12 @@+---+title = "Supabase dashboard not loading/ Project not loading on dashboard"+github_url = "https://github.com/orgs/supabase/discussions/14172"+date_created = "2023-05-06T10:01:16+00:00"+topics = ["studio"]+---++We suggest you try clearing your browser's cookies, cache and see if that helps.++To isolate whether this issue is specific to your browser, we recommend updating your browser to the latest version as it may help resolve the issue. Also, we recommend you try accessing the dashboard from a different browser or incognito mode/private browsing mode.++If you still see the same issue, please write to [[email protected]](mailto:[email protected]) using your email.diff --git a/apps/docs/content/troubleshooting/understanding-the-usage-summary-on-the-dashboard-D7Gnle.mdx b/apps/docs/content/troubleshooting/understanding-the-usage-summary-on-the-dashboard-D7Gnle.mdxnew file mode 100644index 00000000000..14165cf5fd7--- /dev/null+++ b/apps/docs/content/troubleshooting/understanding-the-usage-summary-on-the-dashboard-D7Gnle.mdx@@ -0,0 +1,51 @@+---+title = "Understanding the Usage Summary on the Dashboard"+github_url = "https://github.com/orgs/supabase/discussions/27479"+date_created = "2024-06-24T00:26:53+00:00"+topics = ["platform", "studio", "database", "functions"]+keywords = ["usage", "metrics", "projects"]+---++## Organization Usage Metrics++This discussion explains your organization's usage metrics, which can be found here: [https://supabase.com/dashboard/org/\_/usage](https://supabase.com/dashboard/org/_/usage).++++These metrics are calculated based on all the projects under the organization that meet these criteria:++- Currently active projects+- Inactive projects that were active for some period of time within the current billing cycle++This may be confusing for users looking at only what metrics are being used for currently active projects.++## Database Size Example++Using the database size as an example, suppose we have the following projects under the organization:++- Project A: 1 GB database size+- Project B: 0.5 GB database size+- Project C: 0.5 GB database size++If the user decides to delete Projects A and B during the current billing cycle, the average database usage will be 2 GB for the current billing cycle, even though only a 0.5 GB database is currently active.++As of now, even if your project was just active for a few days, we take the average database size for those active days, which may lead to high usage when creating and deleting many projects within a billing cycle. We're working on a better billing model to cover these cases.++## Edge Functions Example++Consider another example with edge functions. Suppose we have these projects under the organization:++- Project D: 5 Edge Functions+- Project E: 7 Edge Functions++If Project E with its 7 functions is deleted during the current billing cycle, the average Edge Function count for this billing cycle on the dashboard will still be 12 functions.++## Other Metrics++It is a little more tricky to understand metrics like realtime and egress due to being more complex to track usage compared to Database size or Function count. However, they will account for usage from all projects that are active or were active during your current billing cycle as well.++## Metrics still look weird or incorrect?++If the numbers from inactive projects carry over to the next billing cycle and no new usage has occurred, something might be wrong.++If this is the case, or if you are unsure why any usage appears the way it does for any reason, you should reach out to Support on the dashboard here: [https://supabase.com/dashboard/support/new](https://supabase.com/dashboard/support/new).diff --git a/apps/docs/public/img/troubleshooting/46f59019-6ff1-4bfb-9acd-d5b7bd282f89.png b/apps/docs/public/img/troubleshooting/46f59019-6ff1-4bfb-9acd-d5b7bd282f89.pngnew file mode 100644index 00000000000..66c1a0b5a53Binary files /dev/null and b/apps/docs/public/img/troubleshooting/46f59019-6ff1-4bfb-9acd-d5b7bd282f89.png differdiff --git a/apps/docs/public/img/troubleshooting/7fe991ac-40ea-4628-a5e3-181d706225ea.png b/apps/docs/public/img/troubleshooting/7fe991ac-40ea-4628-a5e3-181d706225ea.pngnew file mode 100644index 00000000000..8b04c2bf89aBinary files /dev/null and b/apps/docs/public/img/troubleshooting/7fe991ac-40ea-4628-a5e3-181d706225ea.png differdiff --git a/apps/docs/public/img/troubleshooting/8ba54441-2057-4dc0-8add-a8eaab9f2d93.png b/apps/docs/public/img/troubleshooting/8ba54441-2057-4dc0-8add-a8eaab9f2d93.pngnew file mode 100644index 00000000000..bcede723b46Binary files /dev/null and b/apps/docs/public/img/troubleshooting/8ba54441-2057-4dc0-8add-a8eaab9f2d93.png differdiff --git a/apps/docs/public/img/troubleshooting/c6e228b8-fa64-47a9-bdf6-f1f6405b9cf9.png b/apps/docs/public/img/troubleshooting/c6e228b8-fa64-47a9-bdf6-f1f6405b9cf9.pngnew file mode 100644index 00000000000..cd27655527aBinary files /dev/null and b/apps/docs/public/img/troubleshooting/c6e228b8-fa64-47a9-bdf6-f1f6405b9cf9.png differ