GetRankInGroup Failed because HTTP 500 (Internal Server Error)

Hello. I have been having issues inside my Roblox game, IsInGroup, GetRankInGroup requests are being blocked.

Is this a Roblox issue? or is this on my end?

The HyperText Transfer Protocol (HTTP) 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

This error response is a generic “catch-all” response. Usually, this indicates the server cannot find a better 5xx error code to response. Sometimes, server administrators log error responses like the 500 status code with more details about the request to prevent the error from happening again in the future.
Source : 500 Internal Server Error - HTTP | MDN

Enable studio access to API services if you haven’t already.

Sorry for the bump, but this issue has been happening continuously with my own game after rebooting the servers when up to 80 players join at once. Does anyone have any idea how to fix this? It’s severely impacting the functionality of my scripts that use :GetRankInGroup() as an essential function as to whether they go ahead and execute the code or not. If this function fails, it will cause players with certain ranks to be unable to do things that they should be able to and it is quite troublesome.

2 Likes

I will bump this as well because its giving me ALL sorts of headaches.

So far these are the best solutions I found

local GetRoleInGroup: (Who:Player, GroupId:number) -> string
local GetRankInGroup: (Who:Player, GroupId:number) -> number
do --Safe GetRole/GetRank
	local RoleCache = {}
	local RankCache = {}

	function GetRoleInGroup(Who:Player, GroupId:number): string
		local Role = RoleCache[GroupId]
		Role = Role and Role[Who]
		if not Role then
			repeat
				local Succ, Why = pcall(Who.GetRoleInGroup, Who, GroupId)
				Role = Why
				task.wait(.3)
			until Succ
			
			local Cache = RoleCache[GroupId]
			if Cache then
				Cache[Who] = Role
			else
				Cache = {
					[Who] = Role
				}
				RoleCache[GroupId] = Cache
			end
		end

		return Role
	end

	function GetRankInGroup(Who:Player, GroupId:number): number
		local Rank = RankCache[GroupId]
		Rank = Rank and Rank[Who]
		if not Rank then
			repeat
				local Succ, Why = pcall(Who.GetRankInGroup, Who, GroupId)
				Rank = Why
				task.wait(.3)
			until Succ

			local Cache = RankCache[GroupId]
			if Cache then
				Cache[Who] = Rank
			else
				Cache = {
					[Who] = Rank
				}
				RankCache[GroupId] = Cache
			end
		end

		return Rank
	end
	
	local function ClearCache(Who:Player)
		for i, v in next, RoleCache do
			v[Who] = nil
		end
		for i, v in next, RankCache do
			v[Who] = nil
		end
	end
	Players.PlayerRemoving:Connect(ClearCache)
end

Edit: Added cache just incase roblox doesn’t cache for whatever reason.

4 Likes

Seems to happen quite often every few days at random times and when it happens because my game relies on group ranks it damages the spawning process, Roblox should do something to minimize these API fails, don’t think im the only one who suffers from this

1 Like