question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

GetCatalogItems returned error

Hello everyone,

One of my players got error related to the PlayFab API (GetCatalogItems). The code was executed on the Cloudscript, so it's a server API.

This is the error:

        "Message": "The script called a PlayFab API, which returned an error. See the Error logs for details.",
        "StackTrace": "Error\n    at Object.server_request (Script:181:24)\n    at Object.server.GetCatalogItems (Script:523:72)\n  ..."

The game is live for months and this is the first time I see this issue.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image Rick Chen ♦ commented ·

From the error message I cannot tell what could be the cause. Could you please provide your title ID, the function name of that CloudScript and the PlayFab ID of that player for us to diagnose?

0 Likes 0 ·

1 Answer

·
Ozan Yilmaz avatar image
Ozan Yilmaz answered

@Rick Chen

Title ID is *****. The ID of the player who executed the code is 93B153CDAC6FAF86. The function name is **********.

The Cloudscript executed on 07/10/2021 7:05 AM. I also collect error reports by sending custom events. You can find the error report in the title as well. The event name is **********. The sent time is same (07/10/2021 7:05 AM).

This is the code showing how I collect the error reports from clients.

    public static void SendErrorReport(in string api, in string code, ScriptExecutionError error)
    {
        JsonObject payload = new JsonObject();
        payload.Add("Revision", Configurations.Revision);
        if (error != null)
        {
            if (error.Error != null)
            {
                payload.Add("ExeError", error.Error);
            }
            if (error.Message != null)
            {
                payload.Add("ExeMessage", error.Message);
            }
            if (error.StackTrace != null)
            {
                payload.Add("ExeStackTrace", error.StackTrace);
            }
        }
        else
        {
            payload.Add("ExeError", "-");
        }

        WriteEventsRequest request = new WriteEventsRequest()
        {
            Events = new List<EventContents>()
            {
                new EventContents()
                {
                    EventNamespace = "custom",
                    Name = api,
                    OriginalId = code,
                    OriginalTimestamp = DateTime.UtcNow,
                    PayloadJSON = payload.ToString()
                }
            }
        };

        PlayFabEventsAPI.WriteTelemetryEvents(request, (r) => { }, (e) => { });
    }
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image Rick Chen ♦ commented ·

The relevant event with the player 93B153CDAC6FAF86 shows that there was the “InternalServerError” in that CloudScript execution. I cannot reproduce this issue. Is this issue still happening to that player? Please understand that the API calls are not 100% guaranteed to be successful. For this type of error, you could implement theexponential retry strategy to retry the failed call.

0 Likes 0 ·
Ozan Yilmaz avatar image Ozan Yilmaz Rick Chen ♦ commented ·

No, the issue isn't happening. The game is live for months, but this is the first time I see this error.

I just wanted to share the error since it's internal. I thought, it could be a bug on PlayFab side.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.