DataStore problem - HTTP 500-Internal error servor

Hello, my data save was working perfectly for several weeks when all of a sudden I received this message in the output while leaving the game on roblox studio: “HTTP 500-Internal error servor” in red. After this message all of my datasave is now erase. Has anyone ever had this problem and been able to solve it? I can send my script if it helps. I really need help especially since I was close to publishing my game. Thank you

This probably has nothing to do with your code or anything. It could either be a bug on Roblox or your computer’s internet.

Thank you, I’m afraid this will happen to me when I publish the server, is there a way to save a data to come back if I have this bug? I tried to come back to an older version of my game but the data did not restore

I’m thinking you could maybe use a protected call when you are saving your data. It will protect the data if any error like that happens again.

Code Example:

local DataStoreService = game:GetService("DataStoreService")
local "your name" = DataStoreService:GetDataStore("Your data store")

game.Players.PlayerAdded:Connect(function(player)
     local success,errormsg = pcall(function()
            "your name":GetAsync(player.UserID)
  end)

      if success then
  else
       warn(errormsg)
end

end)

I already had these lines of code. I’ve seen games lose their datasave completely and then by some means find it again after a few days. Do you know how they did it to make an external backup? I use BindToClose in my script, maybe it’s related to this but I don’t understand what it’s for

local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("Datasavewolf")

game.Players.PlayerAdded:Connect(function(plr)

	local folder = Instance.new("Folder")
	folder.Name = "Creatures"
	folder.Parent = plr

	local data

	local success, errorMsg = pcall(function()
		data = DataStore:GetAsync("CreatureData-"..plr.UserId)
	end)

	if success and data then
		for _, cName in pairs(data) do
			if workspace.Creatures:FindFirstChild(cName) then 
				local newval = Instance.new("BoolValue")
				newval.Name = cName
				newval.Parent = folder
			end
		end
	end
end)

game.Players.PlayerRemoving:Connect(function(plr)
	local cTable = {}

	for _, creature in pairs(plr:WaitForChild("Creatures"):GetChildren()) do
		table.insert(cTable,creature.Name)
	end

	local success, errorMsg = pcall(function()
		DataStore:SetAsync("CreatureData-"..plr.UserId,cTable)
	end)
end)

game:BindToClose(function()
	for _, plr in pairs(game.Players:GetPlayers()) do
		local cTable = {}

		for _, creature in pairs(plr:WaitForChild("Creatures"):GetChildren()) do
			table.insert(cTable,creature.Name)
		end

		local success, errorMsg = pcall(function()
			DataStore:SetAsync("CreatureData-"..plr.UserId,cTable)
		end)
	end
end)

HTTP 500-Internal error server means that something has gone wrong on the server, but the server doesn’t know why or where. You can get this error if it’s a Roblox bug or a bug with your internet.

1 Like

Is there a way to prevent this ? maybe by saving folder ? Or something else ?

I think you can publish the game just fine. If you get any more errors from the output, let me know.

Since this error I have lost all the data permanently and now I have to restart the game (but the save is done correctly, I am especially afraid that this incident will happen again when I have already published the game). I thought maybe: Create a file before launching a game on roblox studio, if I get the internal error 500 and I lose the memory then I open the previous file without publishing the game and maybe the memory will come back? Or maybe not? Very stressful situation

Try using this useful module, it’s very effective in preventing data loss How to use DataStore2 - Data Store caching and data loss prevention
The module DataStore2 - Data Loss Prevention and Caching - Roblox

1 Like

Unfortunately DataStore2 is of little use to my game, as it does not restore everything that needs to be restored. Does anyone know how I can prevent this type of error please? I must not be the only one who has it

Roblox DataStore2 Tutorial - ADVANCED DEVELOPERS ONLY (NOT NORMAL DATASTORE) - YouTube Watch this video to learn how to use the module properly. This method of saving data is very powerful and there will always be backups available for the data.