Open aarmandas opened 3 weeks ago
Hey there, @aarmandas! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this issue together while we wait for a human maintainer.
To address the issues you're encountering with the managed Supabase service, you can follow these steps:
Foreign Tables Errors:
wrappers_fdw_stats
. You need to grant the appropriate permissions to the roles accessing these tables.GRANT SELECT, INSERT, UPDATE, DELETE ON FOREIGN TABLE public.customers TO anon;
GRANT SELECT, INSERT, UPDATE, DELETE ON FOREIGN TABLE public.customers TO authenticated;
GRANT SELECT, INSERT, UPDATE, DELETE ON FOREIGN TABLE public.customers TO service_role;
GRANT SELECT, INSERT, UPDATE, DELETE ON FOREIGN TABLE public.products TO anon;
GRANT SELECT, INSERT, UPDATE, DELETE ON FOREIGN TABLE public.products TO authenticated;
GRANT SELECT, INSERT, UPDATE, DELETE ON FOREIGN TABLE public.products TO service_role;
GRANT SELECT, INSERT, UPDATE, DELETE ON FOREIGN TABLE public.subscriptions TO anon;
GRANT SELECT, INSERT, UPDATE, DELETE ON FOREIGN TABLE public.subscriptions TO authenticated;
GRANT SELECT, INSERT, UPDATE, DELETE ON FOREIGN TABLE public.subscriptions TO service_role;
Permission Issues on the Home Page:
The 401 Unauthorized
errors suggest that the authentication tokens or API keys are either missing or invalid. Ensure that the tokens are correctly passed in the requests and that they are valid.
The AuthBearer
class in the backend-core
service handles authentication. It checks the token scheme and verifies the token or API key. Make sure the tokens are correctly formatted as "Bearer" tokens and are valid.
def check_scheme(self, credentials):
if credentials and credentials.scheme != "Bearer":
raise HTTPException(status_code=401, detail="Token must be Bearer")
elif not credentials:
raise HTTPException(
status_code=403, detail="Authentication credentials missing"
)
async def authenticate(
self,
token: str,
) -> UserIdentity:
if os.environ.get("AUTHENTICATE") == "false":
return self.get_test_user()
elif verify_token(token):
return decode_access_token(token)
elif await api_key_service.verify_api_key(
token,
):
return await api_key_service.get_user_from_api_key(
token,
)
else:
raise HTTPException(status_code=401, detail="Invalid token or api key.")
Specific Missing Permissions:
permission denied for foreign table subscriptions
indicates that the necessary permissions are not granted for the subscriptions
table. Ensure that the permissions are correctly set as shown in the first step.By validating the foreign key constraints and ensuring the correct permissions are granted, you should be able to resolve the issues with managed Supabase [1][2].
To continue talking to Dosu, mention @dosu.
What happened?
The local Supabase Docker works well. However, after pushing all the migrations and seeding the Supabase managed service, I have noticed three issues.
Firstly, all the foreign tables—customers, products, and subscriptions—throw the same error.
Secondly, I can log in, but upon landing on the home page, I encounter some permission issues, all originating from the backend core.
Thirdly, I identified a specific missing permission.
Is there something I can do to fix these?
Relevant log output
Twitter / LinkedIn details
No response