Hello, we are facing issue while creating a metabase collection. The error we are seeing
insert or update on table \"permissions\" violates foreign key constraint \"fk_permissions_group_id\"\n Detail: Key (group_id)=(3) is not present in table \"permissions_group\"
please help look into the issue.
The RCA we did:
Metabase is assigning permissions to the new collection — deciding who can view, curate, or manage it. These permissions are tied to permission groups, which are entries in the permissions_group
table. When we are creating a new collection, Metabase is attempting to-> Create permission rows in the permissions
table referencing multiple groups, including group_id=3.
Metabase expects group=3 to be present by default. It seems blind for missing groups.
We checked the permission groups table(postgres) and:
metabase_b2c=> SELECT * FROM permissions_group ORDER BY id;
id | name | entity_id
----+-----------------------------+-----------
1 | All Users |
2 | Administrators |
4 | View only access |
and in permission table we are also seeing
metabase_b2c=> SELECT * FROM permissions WHERE group_id IN (3, 9);
id | object | group_id | perm_value | perm_type | collection_id
-----+-----------------------+----------+----------------+-------------------------+---------------
35 | /collection/root/ | 3 | | |
422 | /collection/550/ | 3 | read-and-write | perms/collection-access | 550
428 | /collection/558/ | 3 | read-and-write | perms/collection-access | 558
which looks like few collection prev had the permission corresponding to group_id=3.
Please help resolve the issue.
Plus: Let me know whether manual insertion(of groupid=3 in permission group) can/should be done to fix the issue.