For the past few days, many of my players have been losing data on my game. This affects almost all of my datastores. I used to have certain spikes, but over the last few days it has become real hell.
I haven’t changed anything in the game. What’s the reason for this increase? Roblox datastores outage?
I ran a security update this morning to try to combat data loss, but I’m afraid this will continue.
I mainly receive these two errors:
DataStoreService: InternalServerError: An internal server error occurred. API: GetAsync, Data Store: CashService(x134)
DataStoreService: InternalServerError: An internal server error occurred. API: SetAsync, Data Store: CashService(x42)
Thanks in advance !
I don’t have access to the bug category. So I put this post in development discussions
You should try using UpdateAsync cause I’m pretty sure it’s better than Get or Set Async. UpdateAsync will fetch the old value that was saved for that player btw
Does the player completely lose their data? you need some way to check whether the player’s data loaded correctly, and then not save their data if it failed. Then, just kick the player if it failed to load to prevent data loss.
local DSS = game:GetService("DataStoreService")
local Data = DSS:GetDataStore("Data")
local function GetData(plr)
local plrData
local success,msg = pcall(function()
plrData = Data:GetAsync(plr.UserId)
end)
if success then -- if the data is succesfully there then returns it
return plrData
else -- kicks the player out of the game
plr:Kick("Could not get data, try again later")
end
end
Use UpdateAsync - but you will need yo modify your code to use it.
Do you save data when the player leaves the game? If yes, you need a way the server can tell whether data loading was successful for the player or not - otherwise their data will be lost after the server saves the basic values to the store (because no data was ever loaded).