Weird DataStore error that is resulting in people losing their saves

NEVER got this error before the new update. This is resulting in people losing their saves.

Line doesn’t matter; I’ve seen this error occur on lines when I call UpdateAsync().

Can we get a model that this issue is happening or something?

Edit: Just realized, the maintenance might be an issue with server access.

Are you wrapping your datastore calls with pcall? Because you should :slight_smile:

That wouldn’t solve the error, it would just make him unable to find out what part of it is erroring. The problem isn’t the error showing up in the output, it’s the datastore rejecting a request and causing players to lose data.

I went to play Apoc and my Credits were 2.21015, this also happened after the Updates, so I also believe DataStore is messed up.

I suddenly got a wave of messages saying their saves weren’t loading. I had to shut down 366 people (8 pages of 12-player servers) making everyone lose their building progress, before things got worse. I’m sure the admins are aware of it.

I DON’T know why they didn’t warn us about saves first. Like, a huge banner on the site maybe?? (Right now the banner is only talking about purchases.) We can only hope everyone’s saves will be fine at the end of the day.

Btw I didn’t get that parse error, I got the error code “HTTP 503 (Service Unavailable)” and also just plainly “Request rejected”

For the devs who created games experiencing issues, a few questions:

  • Are you using GetGlobalDataStore, GetDataStore or GetOrderedDataStore ?
  • Can you post an example key that is failing (feel free to use confidential tags if you are concerned about hacking/exploiting)

[quote] For the devs who created games experiencing issues, a few questions:

  • Are you using GetGlobalDataStore, GetDataStore or GetOrderedDataStore ?
  • Can you post an example key that is failing (feel free to use confidential tags if you are concerned about hacking/exploiting) [/quote]

Using GetOrderedDataStore which seems to work fine, however some not as much:

To answer OP’s question, the Can’t parse response error is due to data being saved in a key that exceeds the 64k bytes limit.

To test if this is the case, do the following in the Dev Console on a live server.

local ds = game:GetService("DataStoreService"):GetDataStore("DahStore")
local data = ds:GetAsync("KeyCausingTheError")
local stringdata = game:GetService("HttpService"):JSONEncode(data)
print(#stringdata)

If the number printed is close to 64k then you can assume that the UpdateAsync() call was adding data to the Key that caused it to exceed the limit thereby getting the Can’t parse response error.

If it not close to 64k then I guess it was due to the maintenance.

Also are they actually losing data? or is it just not saving anything new?

The highest amount of characters in a table in my game is 20k characters. If I had a table with 64k characters in it, the save/load would break, and people would inform me of it.

The error you would get is “Value is too large” if you had a table with 64k characters in it.

local t = {}
for i = 1, 64000 do
	table.insert(t,i)
end
local ds = game:GetService("DataStoreService"):GetDataStore("DataStoreName")
ds:UpdateAsync("Test",function(oldvalue) return t end)
local tab = ds:GetAsync("Test")
print(#tab)

[quote]
Also are they actually losing data? or is it just not saving anything new?[/quote]
No idea .It was pretty inconsistent. Some people saved fine while others couldn’t save at all. I wonder what happens if you use :UpdateAsync and it breaks: does it retain the same value, or does it replace it with nil?

The problem is that some people DID lose their data (or a part of it) and I can’t really be bothered to restore hundreds of people’s data. This is a nightmare.

It should be fixed now, however.

I can confirm that Can’t parse response is the error given.

And when this happens it doesn’t override the data there, it just doesn’t update, However your bug sounds like it could be unrelated.

I use datastores in my game, and haven’t gotten informed of anyone losing their data recently, and my users would whine to high heavens if one lost their data, because they spend months at a time getting their points, I’ll let you know if I get a PM about this.

Oh, and I use GetDataStore as my DataStore

Strangely, the PlayerDataStore module has been running 100% fine. Saving an loading is working.

It was only broken for a few hours, during the time I posted my message here. You’re late to the party lol

We are investigating this issue. We have a promising lead, and parsing error should stop reproducing within the next day or so. The 503s should also start going away in the same timeframe.

I thought the JSON couldn’t exceed 64000 characters. Wouldn’t you need to convert that table to JSON, then check the length of the string?

[quote]
I thought the JSON couldn’t exceed 64000 characters. Wouldn’t you need to convert that table to JSON, then check the length of the string? [/quote]

Oops, should have been more clear. I messed up on the code I posted as well

It errors on line 6 – it tries to UpdateAsync on a table with more than 64k characters. It will error with “Value is too high” when you try to SetAsync/UpdateAsync on a table with more than 64k characters

[quote]
I thought the JSON couldn’t exceed 64000 characters. Wouldn’t you need to convert that table to JSON, then check the length of the string? [/quote]

Oops, should have been more clear. I messed up on the code I posted as well

It errors on line 6 – it tries to UpdateAsync on a table with more than 64k characters. It will error with “Value is too high” when you try to SetAsync/UpdateAsync on a table with more than 64k characters[/quote]

No what I’m saying is, I thought that ROBLOX converted the table to JSON, then saved that string. And the resultant string couldn’t be more than 2^16 characters. I’m just trying to say that the JSON string is larger than the length of the lua table. In this case, I don’t think by much though.

But to add to this discussion, I’ve been receiving many reports of data loss recently which rarely happens with my datastore games.

[quote]
But to add to this discussion, I’ve been receiving many reports of data loss recently which rarely happens with my datastore games. [/quote]

Maybe some users are reaching the limit, although they wouldn’t lose all their data if that happened.

Also wish wrote the code snippet not me :stuck_out_tongue: