104: Cannot store Dictionary in data store. Data stores can only accept valid UTF-8 characters. - Potentially reporting a wrong error?

Hey!

We’ve been tracking the following DataStore error which has in the last week become more frequent:
104: Cannot store Dictionary in data store. Data stores can only accept valid UTF-8 characters.

We have a few places where we allow for user input, but in all of those cases validate the string before it gets set in the session cache with utf8.len.

To ensure that there arent actually any invalid UTF8 characters, immediately before the data store gets written to, I am recursively going every values in the players datastore, and looking for non utf8 characters using utf8.len and reporting it as a custom google analytics event. I have not seen any errors though. I am beginning to think its reporting an invalid error. Does anyone have any insight? Or has anyone experienced this same issue?

1 Like

Do you have any examples of dictionaries that are being rejected? There may potentially be unaccounted UTF8 characters making it into the key or value of your dictionary which aren’t appropriately accounted for. I can only speculate though because I don’t know your implementation.

1 Like

Unfortunately no - we are tracking the errors through HttpService to a remote server - and currently our database table itself doesn’t support non utf8 characters, which I could certainly change, however I’m not sure it’s even possible to send non utf-8 characters with HttpService in a POST request.

We are also running a function prior to any writing to the datastores ensuring that the values are non userdata. Attempting to save userdata values like CFrame or Vector3s will result in that error, so if the error Is reporting correctly it has to be from a non utf-8 character that was potentially inputted by the user - but I am running utf8.len to track that and haven’t seen anything. :confused:

1 Like

Different question then; what keys and values are you including in the dictionary before sending it over? Even just a format and how the entries are inputted is fine. Are you sure that the user-inputted text is the only possible way in which a potential non-UTF8 character may have gotten into your dictionary?

2 Likes