During setup, I am getting a permission denied error on a table in the 'public' schema.
I have tried the following:
GRANT SELECT ON TABLE public.awsdms_ddl_audit TO hasura_role;
GRANT USAGE ON SCHEMA public TO hasura_role;
even though I do not want hasura to access public at all, just to see if that works.
and
REVOKE USAGE ON SCHEMA public FROM hasura_role;
Here is some context from the logs
CREATE TABLE hdb_catalog.hdb_query_collection\n(\n collection_name TEXT PRIMARY KEY,\n collection_defn JSONB NOT NULL,\n comment TEXT NULL,\n is_system_defined boolean default false\n);
CREATE TABLE hdb_catalog.hdb_allowlist\n(\n collection_name TEXT UNIQUE\n REFERENCES hdb_catalog.hdb_query_collection(collection_name)\n);
\n","prepared":false,"error":{"exec_status":"FatalError","hint":null,"message":"permission denied for relation awsdms_ddl_audit","status_code":"42501","description":null},"arguments":[]},"path":"$","error":"postgres query error","code":"unexpected"}
Why is hasura trying to access this relation at all? Please note that this is happening on Kubernetes, every time I start a new pod. hdb_catalog and hdb_views are completely empty.
This can happen when you are using AWS DMS replication on your database. Adding some permissions will fix the problem:
GRANT SELECT, DELETE, INSERT ON TABLE public.awsdms_ddl_audit TO hasura_role;
GRANT USAGE, SELECT ON SEQUENCE awsdms_ddl_audit_c_key_seq TO hasura_role;
Most helpful comment
This can happen when you are using AWS DMS replication on your database. Adding some permissions will fix the problem: