MarketplaceService:getProductInfo() failed because HTTP 504 (Gateway Timeout)

This line…

local ProductInfo = MarketplaceService:GetProductInfo(Recibo.ProductId, Enum.InfoType.Product)

… aborted the script with this error…


… but this happened only one time, and inside Studio.

As in the official documentation there is no mention of the need for a pcall for this command, I ask here if I really need to do a special treatment here, in case this error occurs again in a production environment.

Just use a pcall, it does not matter if the Roblox Documentation website does not use it. pcalls can be used for about everything.

1 Like

Also, i havent researched on the error but it just may also be an internal error or something, just wait it out and try as well as with the pcall to suppress errors

1 Like

Here’s a lesson: Use pcalls for any external web calls or things that may fail.


Yes, yes, pcalls are surely cool and useful. But technically speaking here, apart from the fact that it could be a Roblox internal error and it may be fixed as I’m typing this, is your internet connection stable?

1 Like

I created a function to replace the direct call:

function GetProductInfo(ProductId)
	local ProductInfo

	for i = 1, 7 do -- 7 attempts/ 7 seconds
		local Success, Error = pcall(function()
			ProductInfo = MarketplaceService:GetProductInfo(ProductId, Enum.InfoType.Product)
		if Success then return ProductInfo end

	warn('Error GetProductInfo(' .. ProductId .. '): ' .. Error)
1 Like

I am getting this issue currently for MarketPlaceService and TeleportService at the moment

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.