Major Datastore Issue

Hello !

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

Roblox was down a day ago or so, maybe that’s why.

How did you save your data? Like did you save it everytime when the player updates the value, or saves it when the player leaves the game.

Uniquement lorsque le joueur quitte le jeu

Move this to #help-and-feedback:scripting-support.

I’d suggest you also try auto saving player data every x (you choose the interval) seconds for a better chance at preventing data loss

I think the problem come from GetAsync and not SetAsync (because player lose eveything on the connection)

1 Like

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

even when the Roblox data stores crash

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.

Me what I do to prevent this is this:

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
2 Likes

GetAsync should be used to retrieve the data; and UpdateAsync should be used to update the data. UpdateAsync should not be used for data retrieval.

UpdateAsync has some safety features that SetAsync does not. It can be used for things like data versioning to prevent old data being saved.

1 Like

i already have this system in my game…

So, what the best? Using Update or SetAsync?

I already have this system :

  • Player Connected
  • Try to load data
  • If there is an error, player kick without saving data

The error I get indicates a problem with GetAsync, without specifying anything…

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).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.