Can't fix error "MarketplaceService:GetProductInfo() failed bacause Http 429

Hi there!
I ran into a problem, and I’ve been trying to solve it for two hours now. I’ve looked around for answer but I can’t find any. For others, this seem to work, but for me, it doesn’t.
Here’s the function containing the problem.

function createButton(songId, i: number)
    
    local id = "rbxassetid://"..songId

    local asset = MarketplaceService:GetProductInfo(songId, Enum.InfoType.Asset)
    local name = asset.Name

    local clone = template:Clone()
    clone.Name = "SearchResult" .. tostring(i)
    clone.SongName.Value = name
    clone.SongId.Value = id
    clone.Play.Text = name
    clone.Parent = guiList
    
end

And I can’t solve it. I just keep getting this error. No matter what i do.
General developing - Roblox Studio 2022-01-18 11_16_28

I would really appreciate help. I need to have this plugin done today.

Is the access to http enabled under game settings?

1 Like

yes it is. But it still wont work!

1 Like

Can you please provide your entire script

Edit:
According to this site, the error is caused by you sending too many requests. Try only doing :GetProductInfo once and then storing it in a table (you could use a module script for this)

1 Like

It’s a plugin, and I don’t want the source to be leaked.

1 Like

Can you at least provide the code that is sending the GetProductInfo things?

If not, try to reduce the amount of requests you make to the api

1 Like

It’s in a for-loop. But it gives the error at the very first one too.

I have tried only making ONE. But the error still shows up! AND IT’S SO ANNOYING!

Try to just add some prints and see how the code behaves

I’ve tried literally everything!

Did you try to print the id variable in the createButton funciton? (I want to see what it outputs)

Yes, the only problem is Roblox’s limit with requests.

1 Like

There’s not enough information here. If you don’t provide any context or code or do any significant debugging yourself then we aren’t going to be able to help you well.

@GRADE_1000 The HTTP permission is only for HttpService to request to external servers. Any Roblox API that makes a web call does so with an internal service that does not require HttpEnabled and may access site endpoints without a proxy. That permission is irrelevant here.

1 Like

Try using a numerical Id, like

local id = 1233596658 --the asset id or replace with SongId variable
1 Like

Use a pcall function instead on local asset = MarketplaceService:GetProductInfo(songId, Enum.InfoType.Asset). Because pcall will collect the error instead of printing it on the output. That things commonly happens when a id placed was incorrect or it gave up finding it on the internet.

1 Like

Do it without ‘rbxassetid://’ 30char

1 Like

I have also encountered this problem. I was helped by pcall. In your case, you can try this:

function createButton(songId, i: number)

	local id = "rbxassetid://"..songId
	local asset
	local success, err = pcall(function()
		asset = MarketplaceService:GetProductInfo(songId, Enum.InfoType.Asset)
	end)
	
	if success and asset then
		local name = asset.Name
		local clone = template:Clone()
		clone.Name = "SearchResult" .. tostring(i)
		clone.SongName.Value = name
		clone.SongId.Value = id
		clone.Play.Text = name
		clone.Parent = guiList
	else
		print("not found")
	end
end
2 Likes