Player IsInGroup/GetRoleInGroup/GetRankInGroup erroring with "Shutting down"

Yesterday, @loleris posted in the Discord chat that he was getting the following error:


I noticed one of the places I have console access to was receiving the same error:


Code: player:GetRoleInGroup(groupId)

This does not happen 100% of the time, and I haven’t found a common factor. Because it’s happened in two different places now, it doesn’t seem game-specific. Not sure why this error has just now cropped up, but it’d be great if:

  • The cause of the error could be resolved
  • The error message could be less cryptic in the event this happens in the future
4 Likes

Can confirm this is happening in my game too. Just had no idea where it came from.

Is this happening really early while the user is logged in or after they are logged out?

I think one of my changes made the error message less helpful, which I’ll fix. Previously the error would have been “Player is not in DataModel”.

Somehow this is being called while the Player object isn’t parented to the Players service?

Not sure about loleris, but the script using GetRoleInGroup in mine could possibly run after the player has left (and is no longer parented to Players), so that could be the reason.

Out of curiosity, why is it a requirement that the player object has to be a member of DataModel?

If the player isn’t in a DataModel it can’t get a reference to the per-DataModel web service singleton that it uses to make a web request.

It’s a bit unfortunate, but it’s always been this way. I just made the error message more obscure. New error message will be “Player must be a child of Players”.

4 Likes