Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

API Services rejected request with error? HTTP 500 (Internal Server Error) [SOLVED BY ME]

So in my game I have a couple savefiles which a player can save their data to and wipe the data. Whenever the press the reset button to reset a savefile this pops up:

18:25:55.953 - 502: API Services rejected request with error. HTTP 500 (Internal Server Error) 18:25:55.954 - Stack Begin 18:25:55.955 - Script 'ServerScriptService.DataHandler', Line 135 18:25:55.956 - Stack End

This is the script btw

RS.DataController.RemoveData.OnServerEvent:Connect(function(player,desiredSaveFile)
	if not savingData then
		savingData = true
		if desiredSaveFile == "SaveFile1" then
			saveFileToRemove = saveFile1
			print("Resetting Save1")
		elseif desiredSaveFile == "SaveFile2" then
			saveFileToRemove = saveFile2
			print("Resetting Save2")
		else
			saveFileToRemove = saveFile3
			print("Resetting Save3")
		end
		for dataIndex, data in pairs(saveFileToRemove) do
			data:RemoveAsync(player.UserId)
			if dataIndex == "Name" then
				local success, newData = pcall(function()
					return data:GetAsync(player.UserId)
				end)
				if success and savingData then
		RS.DataController.LoadData:FireClient(player,newData,desiredSaveFile,"Reset")
					savingData = false
					break
				end
			end
		end
	end
end)

This line to be precise is line 135

data:RemoveAsync(player.UserId)

Yesterday this code worked normally, but when I tried again today the error message suddenly popped up. Also this error pops up both when I play test in studio and when I enter the game from the roblox website. I can't find any error in my script but there may be. If it is a bug caused by roblox itself then I suppose there is nothing I can do about it.

2 answers

✓ Accepted answer

Glad you got it working again. For everyone else that is wondering why this happened, adopt me has struck again with their website breaking update, causing the whole website to break. This shut down the API Services.

2 comments

0

You pretty much just explained everything! + 1 to you

0

Everything are good now

This discussion is preserved as it was. New answers, comments, and votes are closed.