SetPlaceId arbitrarily failing to set the universe id properly resulting in Studio being unable to access data stores

Reproduction Steps
Run game:SetPlaceId(placeId) in the command bar from a local file, then use the DataStore API. Chances are you’ll be hit with this error from e.g. GetAsync:

502: API Services rejected request with error. Error code: 30 Reason: The provided universe is not valid.

There’s also a chance it’ll work properly with no error being generated.

It seems PlaceId specific. Using another place id may allow you to access that game its data stores. After a while the error may be resolved arbitrarily too.

This started to happen during the last month.

Expected Behavior
DataStore to be able to access data at all times.

Actual Behavior
DataStore APIs yielding this error sometimes: 502: API Services rejected request with error. Error code: 30 Reason: The provided universe is not valid.

Workaround
Starting a server after SetPlaceId still seems to work and it gets assigned the PlaceId properly.

It’s terribly inefficient compared to Play Solo, though. It also doesn’t allow for accessing the data within the command bar without first starting an entire server.

Additionally, I use scripts to wipe player data from all games in case of data removal requests, which relies on SetPlaceId to go through all games. This requires me to go through all games manually, starting a server to wipe their data one by one.

(edit) Calling SetUniverseId in addition to SetPlaceId will also allow accessing data stores reliably again. This workaround reduces the impact significantly.

Issue Area: Studio
Issue Type: Other
Impact: Low
Frequency: Sometimes
Date First Experienced: 2021-09-20 00:09:00 (+02:00)

4 Likes

Can confirm, this has been happening to me for a while, and it came out of nowhere as I changed no settings nor habits.

I used to be able to just use SetPlaceId and run datastore scripts in studio. Run(F8) still doesnt fix this, so if I ever want to run something with datastores I must start a Server

1 Like

Apparently calling SetPlaceId as well as SetUniverseId will reliably allow accessing data stores again, so this workaround reduces the impact significantly for me.

2 Likes

Thanks, that basically solves the frustration for me actually, just tossed that line into a plugin that was setting the place Id for me for the past few years

1 Like

I was having the same issue and setting both UniverseId and PlaceId fixed it, thanks for the post. Somebody should really update the documentation about that.

Sorry for being late to this. We’ll take a look at this now.

Sorry about the delay. The posters are correct that both UniverseId and PlaceId need to set for Data Stores to work. I am working with the Documentation team to update the website.