API Services rejected request with error? HTTP 500 (Internal Server Error) [SOLVED BY ME]
Asked by
4 years ago Edited 4 years ago
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
01 | RS.DataController.RemoveData.OnServerEvent:Connect( function (player,desiredSaveFile) |
02 | if not savingData then |
04 | if desiredSaveFile = = "SaveFile1" then |
05 | saveFileToRemove = saveFile 1 |
06 | print ( "Resetting Save1" ) |
07 | elseif desiredSaveFile = = "SaveFile2" then |
08 | saveFileToRemove = saveFile 2 |
09 | print ( "Resetting Save2" ) |
11 | saveFileToRemove = saveFile 3 |
12 | print ( "Resetting Save3" ) |
14 | for dataIndex, data in pairs (saveFileToRemove) do |
15 | data:RemoveAsync(player.UserId) |
16 | if dataIndex = = "Name" then |
17 | local success, newData = pcall ( function () |
18 | return data:GetAsync(player.UserId) |
20 | if success and savingData then |
21 | RS.DataController.LoadData:FireClient(player,newData,desiredSaveFile, "Reset" ) |
This line to be precise is line 135
1 | 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.