Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feature: docs troubleshooting section (#29119)

Charis99e3ec5c2922
diff --git a/apps/docs/content/troubleshooting/_template.mdx b/apps/docs/content/troubleshooting/_template.mdx
new file mode 100644
index 00000000000..392fe48e347
--- /dev/null
+++ b/apps/docs/content/troubleshooting/_template.mdx
@@ -0,0 +1,48 @@
+---
+title = "Troubleshoot slow queries"
+topics = [
+ "ai",
+ "auth",
+ "branching",
+ "cli",
+ "database",
+ "functions",
+ "platform",
+ "realtime",
+ "self-hosting",
+ "storage",
+ "studio",
+ "supavisor",
+ "terraform",
+]
+keywords = [] # any strings (topics are automatically added so no need to duplicate)
+
+# Optionally, list the endpoints/commands/methods that are affected by this issue.
+#
+# Use the ID, which you can get from the API reference on supabase.com/docs by
+# navigating to the API and copying the last segment of the URL.
+#
+# Delete any sections that are not applicable.
+[api]
+sdk = ["auth-mfa-enroll", "auth-mfa-verify"]
+management_api = ["v1-get-postgres-config"]
+cli = ["supabase-migration-repair"]
+
+# Optionally, list the error messages associated with this issue.
+[[errors]]
+httpStatusCode = 404
+code = "not_found"
+message = "The resource was not found"
+
+[[errors]]
+httpStatusCode = 403
+code = "forbidden"
+message = "Not allowed to access this resource"
+---
+
+Freeform Markdown here. Some suggestions on what to include:
+
+- Why the issue occurs
+- How to diagnose it
+- How to fix it
+- How to prevent it
diff --git a/apps/docs/features/docs/Troubleshooting.utils.ts b/apps/docs/features/docs/Troubleshooting.utils.ts
new file mode 100644
index 00000000000..e7cdcf90275
--- /dev/null
+++ b/apps/docs/features/docs/Troubleshooting.utils.ts
@@ -0,0 +1,45 @@
+import { z } from 'zod'
+
+const TroubleshootingSchema = z.object({
+ title: z.string(),
+ topics: z.array(
+ z.enum([
+ 'ai',
+ 'auth',
+ 'branching',
+ 'cli',
+ 'database',
+ 'functions',
+ 'platform',
+ 'realtime',
+ 'self-hosting',
+ 'storage',
+ 'studio',
+ 'supavisor',
+ 'terraform',
+ ])
+ ),
+ keywords: z.array(z.string()).optional(),
+ api: z
+ .object({
+ sdk: z.array(z.string()).optional(),
+ management_api: z.array(z.string()).optional(),
+ cli: z.array(z.string()).optional(),
+ })
+ .optional(),
+ errors: z
+ .array(
+ z.object({
+ httpStatusCode: z.number().optional(),
+ code: z.string().optional(),
+ message: z.string().optional(),
+ })
+ )
+ .optional(),
+})
+
+export type ITroubleshootingMetadata = z.infer<typeof TroubleshootingSchema>
+
+export const validateTroubleshootingMetadata = (troubleshootingMetadata: unknown) => {
+ return TroubleshootingSchema.safeParse(troubleshootingMetadata)
+}