S
Supabase2w ago
amar

Can't delete a db role from the dashboard or SQL

Something has gone wrong and we're stuck with a database role. It can't be deleted from the dashboard or using SQL. Here's the error message:
Failed to delete database role: Failed to run sql query: {"error":"ERROR: 42501: permission denied to drop role\nDETAIL: Only roles with the CREATEROLE attribute and the ADMIN option on role \"metabase_app\" may drop this role.\nCONTEXT: SQL statement \"drop role metabase_app;\"\nPL/pgSQL function inline_code_block line 56 at EXECUTE\n","length":285,"name":"error","severity":"ERROR","code":"42501","detail":"Only roles with the CREATEROLE attribute and the ADMIN option on role \"metabase_app\" may drop this role.","where":"SQL statement \"drop role metabase_app;\"\nPL/pgSQL function inline_code_block line 56 at EXECUTE","file":"user.c","line":"1175","routine":"DropRole","message":"permission denied to drop role","formattedError":"ERROR: 42501: permission denied to drop role\nDETAIL: Only roles with the CREATEROLE attribute and the ADMIN option on role \"metabase_app\" may drop this role.\nCONTEXT: SQL statement \"drop role metabase_app;\"\nPL/pgSQL function inline_code_block line 56 at EXECUTE\n"}
Failed to delete database role: Failed to run sql query: {"error":"ERROR: 42501: permission denied to drop role\nDETAIL: Only roles with the CREATEROLE attribute and the ADMIN option on role \"metabase_app\" may drop this role.\nCONTEXT: SQL statement \"drop role metabase_app;\"\nPL/pgSQL function inline_code_block line 56 at EXECUTE\n","length":285,"name":"error","severity":"ERROR","code":"42501","detail":"Only roles with the CREATEROLE attribute and the ADMIN option on role \"metabase_app\" may drop this role.","where":"SQL statement \"drop role metabase_app;\"\nPL/pgSQL function inline_code_block line 56 at EXECUTE","file":"user.c","line":"1175","routine":"DropRole","message":"permission denied to drop role","formattedError":"ERROR: 42501: permission denied to drop role\nDETAIL: Only roles with the CREATEROLE attribute and the ADMIN option on role \"metabase_app\" may drop this role.\nCONTEXT: SQL statement \"drop role metabase_app;\"\nPL/pgSQL function inline_code_block line 56 at EXECUTE\n"}
This is preventing us from setting up supabase locally as well, as we get errors saying the metabase_app user couldn't be found. I've tried many different things, logging in with different users, trying to transfer objects owned or transfer ownership to another user, but nothing works. Looks like a bug causing a permission denied endless loop. Would appreciate some help.
5 Replies
garyaustin
garyaustin2w ago
Not a dashboard or setup issue in general. Where are you dropping from and what user?
garyaustin
garyaustin2w ago
No description
amar
amarOP2w ago
I've tried deleting the user from the dashboard UI in Database > Roles, using the SQL editor, and logging in through psql with different users. The user is metabase_app.
garyaustin
garyaustin2w ago
I assume you created that user as that is a 3rd party app. But if the dashboard role UI can't delete it and the SQL editor (with postgres as the impersonation role) then support is likely the only solution.
amar
amarOP2w ago
Yes we've created that user. Okay I've already opened a ticket let's see if they have a solution. Thanks.

Did you find this page helpful?