S
Supabase13h ago
JTB

PGRST301 - Docker Compose

Hey I need help. I want to take a closer look at Supabase and have started it via Docker Compose Supabase. https://github.com/supabase/supabase/blob/master/docker/docker-compose.yml To do this, I adjusted the .env file in advance and used the following tool for the JWT keys: https://supabase.com/docs/guides/self-hosting/docker#generate-api-keys I entered the server page, set the NGINX entries and started everything. I now also have access to Supabase via the URL. The anon key and the URL I have are listed under Connection. So everything should be working. Creating databases and such works without any problems. Now I've written a small tool with VITE/React and want to connect to Supabase (VITE_SUPABASE_ANON_KEY=AnonKeyFromENV-File-DockerCompose), VITE_SUPABASE_URL=https://supabase.mydomain.com).
import { createClient } from '@supabase/supabase-js';

const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;

export const supabase = createClient(supabaseUrl, supabaseAnonKey);
import { createClient } from '@supabase/supabase-js';

const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;

export const supabase = createClient(supabaseUrl, supabaseAnonKey);
But unfortunately, I always get: AdventCalendar.tsx:33 Error loading doors: {code: “PGRST301”, details: “None of the keys was able to decode the JWT”, hint: null, message: “No suitable key or wrong key type”} I used the same key as Anon. When I use a different key, it just says ‘Invalid Credentials’. So I assume that this is working. In the database table, I have not enabled the Enable Row Level Security (RLS) option. What am I doing wrong?
GitHub
supabase/docker/docker-compose.yml at master · supabase/supabase
The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications. - supabase/supabase
Self-Hosting with Docker | Supabase Docs
Learn how to configure and deploy Supabase with Docker.
1 Reply
JTB
JTBOP12h ago
It's sorted. I updated all JWT and ANON/service keys again, docker down and up, and hey presto, now I'm getting data.

Did you find this page helpful?