postgres lacks ADMIN OPTION on custom NOLOGIN roles in hosted Supabase #48783
Replies: 4 comments 5 replies
|
Based on the error, PostgreSQL appears to be enforcing its normal role administration rules: only a role that already has the ADMIN OPTION (or a sufficiently privileged administrative role) can grant membership or the ADMIN OPTION on another role. Since the temporary role that originally created these NOLOGIN roles has been dropped, it seems there is no remaining role in the project that has the required administrative privileges to manage them. Given that, I’m wondering if this is one of those cases where there simply isn’t a SQL-only recovery path from within a hosted project. If that’s correct, it sounds like a Supabase-managed administrative role would need to restore the required memberships or ADMIN OPTION. Since you’ve already opened support ticket SU-439959, I think that’s the right next step. Hopefully a Supabase team member can confirm whether there’s any supported self-service recovery method for hosted projects, or whether staff intervention is required in this scenario. |
|
The mechanism here is documented, and it makes the outcome unavoidable once that migration ran — worth knowing because it lets you rule out a self-service fix immediately instead of hunting for one. Two behaviours combine. 1. The creator got ADMIN OPTION automatically. From Role Attributes → Role creation: "Such a grant occurs automatically when a 2. So the only That also settles the self-service question rather than leaving it a guess. For the rebuild — and for anyone scripting this pattern later — grant admin to a role that will outlive the migration before dropping the creator, in the same transaction: GRANT compass_migrator, compass_enrollware_ingest, compass_ramp_sync,
compass_app_runtime, compass_sandbox_writer, compass_issue_approver,
compass_mapping_reviewer
TO postgres WITH ADMIN OPTION;
DROP ROLE compass_temp_creator;The order is the whole thing: after the |
|
Glad it's unblocked — moving to a fresh schema/migration path is the pragmatic call. And +1 on keeping the ticket open for the orphaned NOLOGIN roles: even though they can't log in, they linger as grantees on objects and still show up in audits and dumps, so having support drop them keeps the role list clean. Good luck with the rest of the migration. |
|
From the PostgreSQL side, the error looks consistent with the fact that Since the original role that created the Given that this is a hosted Supabase project and you've already confirmed there is no remaining role with Your support ticket ( One additional thing I'd verify before support takes action is whether the dropped creator role is still referenced anywhere in the catalog: SELECT
r.rolname,
r.rolcanlogin,
r.rolcreaterole,
r.rolsuper
FROM pg_roles r
WHERE r.rolname LIKE 'compass_%'
OR r.rolname = 'postgres';If none of the remaining roles has the required administration privilege, I would avoid attempting to recreate the roles with the same names, since that could make the migration/grants state even harder to reason about. |
Uh oh!
There was an error while loading. Please reload this page.
Problem
We are using a hosted Supabase project.
A migration created seven custom
NOLOGINgroup roles through a temporary role that hadCREATEROLE:The temporary creator role was dropped at the end of the migration.
The custom roles still exist, but the
postgresrole is not a member of them and does not haveADMIN OPTION. We therefore cannot manage their memberships or grants through the Dashboard SQL Editor.Command that fails
GRANT compass_migrator, compass_enrollware_ingest, compass_ramp_sync, compass_app_runtime, compass_sandbox_writer, compass_issue_approver, compass_mapping_reviewer TO postgres WITH ADMIN OPTION;Exact error:
The operation fails because the hosted Supabase
postgresrole does not have sufficient administrative privileges over these custom roles.Diagnostic query
There is no usable role available to us with
ADMIN OPTIONon these roles.Desired result
We need a sufficiently privileged role to execute the equivalent of:
GRANT compass_migrator, compass_enrollware_ingest, compass_ramp_sync, compass_app_runtime, compass_sandbox_writer, compass_issue_approver, compass_mapping_reviewer TO postgres WITH ADMIN OPTION;We do not need
postgresto automatically inherit or assume these roles.Questions
Support ticket already submitted:
SU-439959.The project is currently on the Free plan.
All reactions