Supabase GitHub Integration fails with "ERROR: must be owner of relation users (SQLSTATE 42501)"
Describe the bug Hi Supabase Team 👋 ,
The Supabase GitHub integration is failing due to this error from a migration we successfully pushed a few months ago. We've never ran into this issue until yesterday. Here is a snippet of the cli error:
ERROR: must be owner of relation users (SQLSTATE 42501)
At statement 7:
COMMENT ON TRIGGER trg_insert_update_phone_auth_users ON auth.users IS 'Trigger to update user_info when phone number changes in auth.users'
This behavior doesn't seem to be consistent since PRs that have been opened before we experienced this issue is still fine. And subsequent commits to those PRs doesn't trigger the error.
Expected behavior Opening PR or a preview branch should not cause this error as this migration has not been a cause of failure for months now.
Additional Context
Not sure if this even helps, but postgres has a value of FALSE for rolsuper when running SELECT * FROM pg_roles.
Build Logs
I am getting a very similar error. This is very new and only happening when I run my migration on a fresh DB in CI:
15.8.1.085: Pulling from supabase/postgres
Status: Downloaded newer image for ghcr.io/supabase/realtime:v2.34.47
v1.22.15: Pulling from supabase/storage-api
Status: Downloaded newer image for ghcr.io/supabase/storage-api:v1.22.15
v2.172.1: Pulling from supabase/gotrue
Status: Downloaded newer image for ghcr.io/supabase/gotrue:v2.172.1
Seeding globals from roles.sql...
Applying migration 20250404200456_migrate-from-timescale.sql...
Stopping containers...
ERROR: must be owner of table users (SQLSTATE 42501)
At statement 1:
-- Enable RLS
ALTER TABLE auth.users ENABLE ROW LEVEL SECURITY
Try rerunning the command with --debug to troubleshoot the error.
I made no changes to my DB schema and this error started today. Last run that succeeded was 2 days ago.
This is due to a change by Supabase, you can find a solution here to fix this issue https://github.com/orgs/supabase/discussions/34270#discussioncomment-13210788, it's not something the CLI has control over, its a Postgres database permission change by Supabase.