question

AnthonyKim avatar image
AnthonyKim asked

GrantItemsToUsers API error with timeout.

{
  "PlayFabEnvironment": {
    "Application": "logicserver",
    "Vertical": "master",
    "Commit": "41925c5",
    "Cloud": "main"
  },
  "EventNamespace": "com.playfab",
  "EntityType": "player",
  "SourceType": "BackEnd",
  "EventName": "player_executed_cloudscript",
  "Timestamp": "2019-09-18T09:34:32.4795088Z",
  "EntityId": "30CD6C289AF9DA35",
  "EventId": "f4ed6e62412f4b13a235fab6a1d05c7a",
  "TitleId": "E211",
  "Source": "CloudScript",
  "CloudScriptExecutionResult": {
    "FunctionName": "defaultPlayerSetting",
    "ExecutionTimeSeconds": 4.0933953999999995,
    "ProcessorTimeSeconds": 0.0,
    "MemoryConsumedBytes": 87680,
    "HttpRequestsIssued": 0,
    "APIRequestsIssued": 4,
    "Revision": 84,
    "Error": {
      "Message": "InternalServerError",
      "Error": "InternalServerError",
      "StackTrace": "Error\n    at AddItem (E211-main.js:202:41)\n    at DefaultPlayerSetting (E211-main.js:263:13)"
    },
    "Logs": [
      {
        "Message": "30CD6C289AF9DA35's newly added item: character_001",
        "Level": "Info"
      },
      {
        "Message": "PlayFab API request failure",
        "Level": "Error",
        "Data": {
          "request": {
            "PlayFabId": "30CD6C289AF9DA35",
            "ItemIds": [
              "bundle_default_supply"
            ]
          },
          "error": "Timeout",
          "api": "/Server/GrantItemsToUser"
        }
      }
    ]
  },
  "FunctionName": "defaultPlayerSetting" 

}

I just try to add bundle item (it is include two kind of consumables item ex: A item with 50 count, B item with 50 count so total item's count is 100) to new user for my game. but always that api return to error(timeout). even already all times are added in user's inventory. So i want to know what is limit of this api. how many items i can grant in one time ?

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

·
Seth Du avatar image
Seth Du answered

It seems the ExecutionTimeSeconds of Cloud Script function has exceeded the limits, which normally should be shorter than 3.5s, the processing time depends on the total data size of items, which cannot be quantified easily. You may consider breaking the process into 2 API calls. As long as you didn’t frequently execute Cloud Script functions, continuous 2 API calls should work fine.

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.