"The rate of publish requests exceeds the allowed limit."

Right now I am making a system that gets the total player count of four sub-places every 30 seconds. I am using MessagingService to accomplish this, and I have kept good note of MessagingService limits. The issue is that I keep getting the “The rate of publish requests exceeds the allowed limit.” Please retry after -2147483648 warning despite the fact I’m only making 8 publish requests per minute (4 every 30 seconds).

Here’s the warning I keep getting every 30 seconds:

What’s odd about this bug is, when I initially designed the system it worked perfectly fine. Just recently it’s started acting like this, not working like how it should + giving me warnings in the logs. I’ve looked all over the DevForum and it doesn’t look like other people have been getting this PublishAsync warning, so I don’t know whether it’s a Roblox bug or a problem in my scripting.

If this turns out to be a real Roblox bug, I’ll move this to Platform Feedback.

Code in each subplace:

game:GetService("MessagingService"):SubscribeAsync("Worlds",function(Info)
	local Data = Info.Data
	if Data.Command == "GetPlayers" and Data.PlaceId == game.PlaceId then
		game:GetService("MessagingService"):PublishAsync("PlayerCount",{PlaceId = game.PlaceId,JobId = game.JobId,PlayerCount = #game.Players:GetPlayers(),Time = Data.Time})
	end
end)

Code in the main menu:

function GetWorldPlayerCount(PlaceId)
	local Success,ErrorStatement = pcall(function()
		WorldPlayerCounts[tostring(PlaceId)] = {}
		GetPlayerCountTimes[tostring(PlaceId)] = tick()
		game:GetService("MessagingService"):PublishAsync("Worlds",{Command = "GetPlayers",PlaceId = PlaceId,Time = GetPlayerCountTimes[tostring(PlaceId)]})
		wait(2.5)
		local TotalCount = 0
		for _,Data in pairs(WorldPlayerCounts[tostring(PlaceId)]) do
			if Data[1] == GetPlayerCountTimes[tostring(PlaceId)] then
				TotalCount = TotalCount + Data[2]
			end
		end
		return TotalCount
	end)
	if not Success then
		warn(ErrorStatement)
		return 0
	end
end
4 Likes

Bumping this post as I also have this error. After a few hours of testing in roblox studios I will get the error. Restarting studios does nothing ether.

"The rate of publish requests exceeds the allowed limit." Please retry after -2147483648 seconds.

I can easily solve it by changing the key name or republishing the game but those are really just band-aid solutions.

1 Like

In case you’re unaware, there are Roblox api endpoints to retrieve the player count of specific games/places if you need a temporary workaround. That might be a better method overall since it was intended for that purpose.

I found this from a DevForum search which could be useful too: PublishAsync with MessagingService gone wrong! - #5 by IDKBlox

You could try to use the newer RequestAsync.
It might be fixed in that function.

Unfortunately I’ve found no API functions which retrieve the player count of a sub-place. They only work for the starter-place of a universe.

Oh, that’s annoying. You could try this and add up the player counts for each server if you have specific place IDs: https://games.roblox.com/docs#!/Games/get_v1_games_placeId_servers_serverType

Sorry to bump this again but this error is very annoying and is making my game suffer because of it. Can we get some confirmation that this is a roblox bug?

1 Like

I’m gonna bump this again
“The rate of publish requests exceeds the allowed limit.” MessagingService: Please retry after -2147483648 seconds.

print('Save success')
MessagingService:PublishAsync('Messages', {Message = FilteredMessage, Sending = player.Name, Recipient = sendingTo})
print('Message sent')

Only sent 3 PublishAsync. Never had this error before until now. I do have BETA access turned on for typed lua if that means anything?

bump

I encountered this error so I tried playing the game from the website (off studio) to publish in-game to see if the error still occurred and after joining the game the error went away in-game and in Studio. I believe the issue might be caused due to Studio not being considered a “server” in MessagingService so the rates might not refresh.

Hope this helps.

bump

I got this error today, but not in studio in the actual game itself and not once in studio so far. If anybody has the fix or knows why this happens please let me know. I’d like to curb this problem before making my game live.

bump

It’s happening now on my game and It’s an essential function which will cause bigger problems whenever more servers appear

1 Like