question

drew avatar image
drew asked

PlayStream Monitor reports "200 OK" from azure queue function that fails

hi,

I have a very simple Azure Queue function which gives the player a welcome gift when they sign up. I have a rule setup to trigger on account creation. I had a bug in my code where the function failed, and so the player never gets their welcome gift. I figured that out through the ApplicationInsights logs I use within my queue function, so I know for sure the queue function fails. However, PlayStream/Playfab reports "status OK" and "code: 200" in the playstream. There's no indication of any errors at all in the playstream for some reason.

This is a big problem obviously because if something goes wrong in the code, the player never gets their starting items. Why would PlayStream report a 200 OK when the queue function clearly failed?

Here's the full playstream event text:

 {
     "EventName": "player_action_executed",
     "ActionName": "Execute Cloud Script Azure Function",
     "TriggeringSegmentMembershipChange": null,
     "TriggeringEventRuleMatch": {
         "RuleId": "1F65BEEAA5D11D47",
         "EventId": "522411ba77c74155b04a60f79b90c256"
     },
     "TriggeredTimestamp": "2024-01-09T17:17:03.0684582Z",
     "ScheduledTimestamp": "2024-01-09T17:17:04.4037316Z",
     "ExecutionResult": {
         "ExecutionResult": {
             "Result": {
                 "code": 200,
                 "status": "OK",
                 "data": {
                     "ExecutionTimeMilliseconds": 172,
                     "FunctionName": "WelcomeGiftQueue",
                     "FunctionResult": {
                         "StatusCode": "Accepted",
                         "QueueName": "queue-welcomegift"
                     }
                 }
             },
             "Status": 200
         }
     },
     "Error": null,
     "ExecutionDuration": 255.8428,
     "EventNamespace": "com.playfab",
     "EntityType": "player",
     "Source": "PlayFab",
     "TitleId": "188A",
     "EntityId": "436AB05157FCDF88",
     "EventId": "77f5f102c56245b98594d7eac2436102",
     "SourceType": "BackEnd",
     "Timestamp": "2024-01-09T17:17:04.4316426Z",
     "History": [
         {
             "ParentTriggerId": "15471849465444541165",
             "ParentEventId": "522411ba77c74155b04a60f79b90c256",
             "TriggeredEvents": true
         }
     ],
     "CustomTags": null,
     "Reserved": null,
     "PlayFabEnvironment": {
         "Vertical": "main",
         "Cloud": "main",
         "Application": "actionprocessor",
         "Commit": "fd86c61"
     }
 }
PlayStream
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

·
Neils Shi avatar image
Neils Shi answered

The “200 OK” status code you mentioned in the PlayStream indicates that the Azure Function was successfully triggered and does not mean that it was executed successfully. In your case, the Azure Function “WelcomeGiftQueue” was triggered successfully and accepted for execution (as indicated by the "StatusCode": "Accepted" in the "FunctionResult"), it indicates that the Azure function has accepted execution, but it does not mean that the function will be executed successfully. You may refer to Debugging CloudScript using Azure Functions in the Azure portal - PlayFab | Microsoft Learn to check the Log Stream in Azure portal and see if the function execute successfully.

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.