Attempting to "Get Data Store Entry" from the "global" datastore fails, even though shown in "List Data Store Entries"

Context

When working on automating data erasure requests on my external tool, I continued to run into issues with the “global” data store: My game is old, and I used to store data with the GetGlobalDataStore() API, which results in some very odd storage situations. Obviously this is fine for most cases, since we don’t use this actively in production anymore. BUT, we need to support data erasure requests.

What works

I was able to get https://apis.roblox.com/cloud/v2/universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries to return this:

{
    "dataStoreEntries": [{
        "path": "universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_1000066653",
        "id": "10_1000066653"
    }, {
        "path": "universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_1000126927",
        "id": "10_1000126927"
    }, {
        "path": "universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_1000181361",
        "id": "10_1000181361"
    }, {
        "path": "universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_1000254116",
        "id": "10_1000254116"
    }, {
        "path": "universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_1000363760",
        "id": "10_1000363760"
    }, {
        "path": "universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_100045080",
        "id": "10_100045080"
    }, {
        "path": "universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_1000499454",
        "id": "10_1000499454"
    }, {
        "path": "universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_1000519401",
        "id": "10_1000519401"
    }, {
        "path": "universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_1000540798",
        "id": "10_1000540798"
    }, {
        "path": "universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_1000546847",
        "id": "10_1000546847"
    }],
    "nextPageToken": "0#u/10_1000546847"
}

Which exactly matches what I expected, confirming that this is, in fact, the correct datastore I’m attempting to reference. Here’s an example using a studio plugin to do essentially the same thing, but of course with in-studio APIs:
image

Where the issues start

Now, if I try to do anything beyond just listing the entries, I start to run into issues:

Attempting to retrieve one of the entries

When calling https://apis.roblox.com/cloud/v2/universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries/10_1000066653 to retrieve information about the first entry, I get a 404:

{
    "code": 5,
    "message": "Entry not found."
}

Attempting to use a filter to find an entry

When calling https://apis.roblox.com/cloud/v2/universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries?filter=id.startsWith("1Ban1_18247660"), I get returned an empty table:

{}

which I know is incorrect, because my in-studio tooling is able to identify three keys that start with this string:
image
Even just trying to use a simple filter id that would match the results above doesn’t work - https://apis.roblox.com/cloud/v2/universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/entries?filter=id.startsWith("10_"):

{}

Conclusion

I think something is up with this datastore that may differ from other datastores. I’ve tested accessing entries of other datastores and haven’t run into any issues. Would love to coordinate and help provide any other additional information to help debug.

My end goal is to be able to call " Delete Data Store Entry" on entries in this global datastore so I can follow data erasure request procedures.

1 Like

I’ve been going through this issue too by the way, I guess roblox wont fix this…

1 Like

Hi there Dapale,

My name is chippskale, I’ll be working on this from the Roblox side.

I understand you’re having trouble interacting with some Data Stores created through the legacy GetGlobalDataStore() API for data erasure requests.

The main issue here is that you’re trying to access these keys without specifying a scope. Keys stored in legacy GlobalDataStores are always stored under the scope u.

Therefore, you should be able to access your keys via:
DELETE https://apis.roblox.com/cloud/v2/universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/scopes/u/entries/10_1000066653
and, for example,
GET https://apis.roblox.com/cloud/v2/universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/scopes/u/entries?filter=id.startsWith("1Ban1_18247660")

Notice the addition of scopes/u in the path which specifies the use of a non-default scope.

Now, zooming out for a bit, the main issue seems to be that the behavior of Open Cloud ListDataStoreEntries API is misleading since it doesn’t include scopes in the returned key by default. I understand how this can be confusing – however we decided to implement it this way to maintaining feature parity with the legacy behavior of the Studio API ListKeysAsync, which requires an AllScopes option to be set in order to return keys with scopes prepended.

If you’d like the Open Cloud API to return keys with the scope prepended, you can use the wildcard scope (-), as in:
GET https://apis.roblox.com/cloud/v2/universes/204387960/data-stores/__global__3a0c3317-5845-4d63-bd11-1acc26b8a6c3-1/scopes/-/entries
which will return keys with their scopes prepended to them.

Could you try to above requests on your end and let me know if the issue is resolved?

Also please let me know if I can clarify anything.

Sincerely,
chippskale

Thanks for the support here. The API calls work correctly when calling them with the u scope

I could be missing something, but I couldn’t find any documentation that mentioned this. I think that was the primary reason I was so confused/this seemed like a bug.

My assumption was that since the game was originally invoking GetGlobalDataStore(), which never had a scope, I was under the impression that either there was no scope or it was some secret scope but I didn’t know what it was.

We should definitely add it to the documentation. I’ll do that and then close this bug out.

Thanks for bringing this up, and sorry for the confusion.

1 Like

It is done: DataStoreService | Documentation - Roblox Creator Hub

Cheers Dapale!

2 Likes

Thanks for the quick turnaround on the documentation! Hopefully it helps others :slight_smile:

1 Like