I am currently unable to access DataStores from Studio and am befuddled as to why.
This simple code produces that 502 error code consistently when playing in Studio:
local dataStoreService = game:GetService("DataStoreService")
local ds = dataStoreService:GetOrderedDataStore("dataStore")
ds:SetAsync("Key", 5)
Things to note:
I am not using Team Create. I am the owner of the place.
I have enabled studio access to apis via Game Settings(See photo):
OP is saying the DataStore only gives this error in studio. If you didn’t click the edit button, you need to run SetPlaceId() Have you followed this guide? Data Stores | Documentation - Roblox Creator Hub
What’s the full error? Is it just “Error 502?”
That wasn’t what I was addressing though. I was addressing the misconception that this error could be possible from a LocalScript, which it isn’t, because clients can’t use DataStores in the first place.
SetPlaceId is only required if you want to interact with the DataStores of an unpublished place, provided you have sufficient access credentials (only the owner of a game can access its DataStores). Otherwise, it’s not required - developers have been able to test DataStores in Studio without issue.
The full error is the title. There are other posts about this same issue as well. HTTP 403 is what the web server is returning, Error 502 is what Roblox API services are returning. As DynamoDB denied write access to the DataStore, DataStoreService could not process the request and thus returned its own error plus the web server’s error to the console.