question

Cliff Cawley avatar image
Cliff Cawley asked

Error logs are always empty

Whenever I get an error, be it an error returned by a PlayFab API or an external service, the Logs have a lot of empty arrays but nothing else.

For example, occasionally an api call to an external service fails with the following and I can't figure out what's wrong. If I run the request again it will work just fine.

In the cases that this request fails, I noticed that the "ExecutionTimeSeconds": 2.5602234 is just over 2.5 seconds. Is the query being terminated because the script has taken 2.5 seconds (instead of the max 4.5?)

How do I see the full log details? (I'm running the CloudScript from the Dashboard).

My server instance id is 9E588

{
    "FunctionResult": null,
    "Logs": [
        {
            "Level": "Error",
            "Message": "HTTP request error",
            "Data": [
                [
                    []
                ],
                [
                    []
                ],
                [
                    []
                ],
                [
                    []
                ],
                [
                    []
                ],
                [
                    [
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ]
                    ]
                ],
                [
                    []
                ]
            ]
        }
    ],
    "ExecutionTimeSeconds": 2.5602234,
    "MemoryConsumedBytes": 78848,
    "APIRequestsIssued": 2,
    "HttpRequestsIssued": 1,
    "Error": {
        "Error": "CloudScriptHTTPRequestError",
        "Message": "The script made an external HTTP request, which returned an error. See the Error logs for details.",
        "StackTrace": "Error\n    at destroyCharacter (9E588-main.js:200:27)\n    at handlers.ExitDungeon (9E588-main.js:171:5)"
    }
}
3 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.

Seth Du avatar image Seth Du ♦ commented ·

Hi, how do you receive the callback result? Are you using the CloudScript tab at [Game Manger] -> [Players] -> select a player -> [Cloud Script]?

In addition, does the log.debug() function contains a JSON object at data field like

log.debug("helloWorld:", { key: value });
0 Likes 0 ·
Cliff Cawley avatar image Cliff Cawley Seth Du ♦ commented ·

Yeah I was just running it from [Game Manger] -> [Players] -> select a player -> [Cloud Script] to test the script every now and then. Most times it worked, when it failed it had blank.

And yes, if I use my own log.debug calls, they appear just fine. But they'll appear fine and I still get those blank entries you see above

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Cliff Cawley commented ·

We recently noticed a display issue on the game manager that empty arrays show up when data field of log.debug contains JSON object. We have filed a bug for it and hopefully this can be fixed soon.

0 Likes 0 ·

1 Answer

·
Marcus Nixon avatar image
Marcus Nixon answered

The issue is that the http.request call timeout is 2.5 seconds. If your service does not return within that period, the call will timeout, causing the script to fail. If you need a longer timeout, please contact our sales team (sales@playfab.com) to discuss an Enterprise tier agreement, in which we can provide you with a custom timeout (basically, we run extra servers exclusively for your title, and pass on those costs).

Any logging information would be returned in the response. You could enclose the call to http.request in a try/catch, and log the output of the error.

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.

Cliff Cawley avatar image Cliff Cawley commented ·

Ah right I see. For some reason I thought the tier I was on had 4.5 seconds. It's fine, I've moved my logic away from cloudscript now, but thank you!

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.