question

Sergey Sosnovich avatar image
Sergey Sosnovich asked

PlayFab API request failure

Hi, sometimes when client executes CloudeScript function we get timeout error. This happens on diffrent cloude script functions. Example:

{
  "APIRequestsIssued": 1,
  "Error": {
    "Error": "InternalServerError",
    "Message": "InternalServerError",
    "StackTrace": "Error\n    at Object.server_request (Script:161:24)\n    at Object.server.GetTitleInternalData (Script:552:77)\n    at TitleData.requestData (5ACD2-main.js:5940:31)\n    at new TitleData (5ACD2-main.js:5907:18)\n    at Handler (5ACD2-main.js:10724:23)\n    at Object.invokeFunction (Script:116:33)"
  },
  "ExecutionTimeSeconds": 4.0043482,
  "FunctionName": "OnReturn",
  "FunctionResult": null,
  "FunctionResultTooLarge": null,
  "HttpRequestsIssued": 0,
  "Logs": [
    {
      "Data": {
        "api": "/Server/GetTitleInternalData",
        "request": {
          "Keys": [
            "ABConfig_1.7.0"
          ]
        },
        "error": "Timeout"
      },
      "Level": "Error",
      "Message": "PlayFab API request failure"
    }
  ],
  "LogsTooLarge": null,
  "MemoryConsumedBytes": 16920,
  "ProcessorTimeSeconds": 0,
  "Revision": 365,
  "Request": {
    "CustomTags": null,
    "FunctionName": "OnReturn",
    "FunctionParameter": {
      "Revision": 259,
      "SessionId": "2e63a63ca3b3cf0c70ee5d2eb8128e53",
      "Version": "1.7.0"
    },
    "GeneratePlayStreamEvent": false,
    "RevisionSelection": 0,
    "SpecificRevision": 0,
    "AuthenticationContext": null
  },
  "CustomData": null
}

How can we resolve this problem? Title id: 5ACD2.
Thanks!

CloudScriptTitle Data
10 |1200

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

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

As this section -- CloudScript timeout error said, CloudScript limits the execute time of API calls on CloudScript to 4 seconds. This “Timeout” error log would be raised when the response time of the single API exceeds 4 seconds. If you encounter this error, you can break your CloudScript function into smaller segments of code whose API calls can complete within 4 seconds.

10 |1200

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

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.