Group is being deleted and I don't know why


I have a game that uses groups for Alliances (groups of players with a shared chat that participate in shared game activities). The feature has been working well but recently we have been seeing a rare but still occurring issue where the group seemingly just disappears from Nakama database. The players report they are no longer in a group and sure enough Nakama no longer has any record of that group in the groups table or groups_edge table. I need help figuring out how that could possibly happen and why.

I have looked into the logs and there are no records of people leaving the group or the group being removed by an operation. This does seem to occur when players are experiencing a slow down due to our server load or perhaps their own connectivity issues.

Here are the only relevant logs to the group (in this case it had 2 members) I could find:

2021-04-20T09:14:01.198-07:00	{"level":"info","ts":"2021-04-20T16:14:01.198Z","caller":"server/core_group.go:366","msg":"Added join request to group.","group_id":"d87a500f-3b2c-47f6-b8d0-651808668ef0","user_id":"c61a8995-2238-4e72-8936-d487f9990e0f"}

2021-06-03T11:09:59.208-07:00 {“level”:“info”,“ts”:“2021-06-03T18:09:59.208Z”,“caller”:“server/core_group.go:366”,“msg”:“Added join request to group.”,“group_id”:“d87a500f-3b2c-47f6-b8d0-651808668ef0”,“user_id”:“cd88503d-b9c2-4bcd-944f-f927314857ca”}

2021-08-23T17:58:28.012-07:00 {“level”:“info”,“ts”:“2021-08-24T00:58:28.011Z”,“caller”:“server/core_group.go:296”,“msg”:“Group does not exist.”,“group_id”:“d87a500f-3b2c-47f6-b8d0-651808668ef0”}

2021-08-24T04:02:25.517-07:00 {“level”:“info”,“ts”:“2021-08-24T11:02:25.517Z”,“caller”:“server/core_group.go:296”,“msg”:“Group does not exist.”,“group_id”:“d87a500f-3b2c-47f6-b8d0-651808668ef0”}

For more info:
Nakama Server Version: 3.1.0+36805731

.NETCore Game Server: 2.7.0
Unity C#: 2.7.0

Any help at all would be appreciated! Perhaps there is another log I could search for? I just don’t understand how a group could get deleted without any record or user action causing it. Is there anything that may happen due to slow connectivity such as an authentication failure or slow response leading to this behavior?

@newatlanta19006 There’s no place in Nakama which would automatically delete a group. Do you have some kind of GDPR compliance job which does a recorded delete for the player with Nakama?

I don’t have anything that I know of that should autodelete. Are there any log messages that are logged when a group is deleted in Nakama? I can’t seem to find any. I assume the issue is in my code somewhere. I’ll keep looking. But if there is a log message for groups being removed that would be helpful. Thanks!

@newatlanta19006 The server doesn’t currently log a message when a group is deleted, but we’ll add this for the next release - it’ll appear at info level just like the other group-related informational logs.

It’s extremely likely that one of the group superadmins has simply deleted the group, which to group members would appear like they just have no group.

Also worth noting you should not necessarily rely on log messages for a 100% reliable audit trail. If this is something you need then look into creating one using before/after hooks in the runtime, perhaps writing to a storage record as a ledger of group operations.