question

shpytagleb avatar image
shpytagleb asked

Periodic occurrence of the CloudScriptHTTPRequestError

My game uses firebase real time database as an additional players data storage accessed via the cloud script. For an unknown reason recently some cloud script handlers which contain firebase requests started returning "CloudScriptHTTPRequestError". This doesn't happen each time, most time requests are working completely fine, I wasn't able to determine any consistent patterns for this issue.

My requests don't have any extra Content-Type headers and I didn't receive any error logs even though error message says that I should have them.

Only certain http requests generate errors but I fail to see how they're different from those which don't. Please tell me which information should I supply.

Thank you and kind regards.

CloudScript
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

Does the execution of Cloud Script generate PlayStream Event? (set "GeneratePlayStreamEvent": true in the request)

If so, have you use Data Explorer to query all the failed events?

6 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.

shpytagleb avatar image shpytagleb commented ·

Thank you for your advice. I added a PlayStream event and will inform you after I collect any new information.

Kind regards.

1 Like 1 ·
Seth Du avatar image Seth Du ♦ shpytagleb commented ·

I will mark this thread as closed. Please feel free to reply this thread or open a new one when you have any other questions. Thanks for your understanding.

0 Likes 0 ·
shpytagleb avatar image shpytagleb Seth Du ♦ commented ·

Sorry for making you wait. I finally was able to detect this issue again and have plenty of cases now on my hands. Requests generated playstream events and I can now see them in the data explorer. Similar to the response I got on a client, each shows 1 http request issued and has zero logs. What information should I provide to you?

0 Likes 0 ·
Show more comments
Seth Du avatar image Seth Du ♦ shpytagleb commented ·

>>"Internal Server Error" / "ServiceUnavailable" / "Third party returned an error"

Is the error returned by PlayFab or firebase?

Because Cloud Script is based on Google V8 JavaScript engine, it doesn't support import external libraries or modules. Advanced debugging is not supported. Though HTTP call in Cloud Script is feasible, there is no additional mechanism that natively supported by PlayFab to ensure the reliability.

Azure function support for PlayFab has been officially launched for a while, I suggest migrating Cloud Script functions gradually to Azure function for more flexibility and capability. It also supports advanced error handling and retry mechanism -- Azure Functions error handling and retry guidance | Microsoft Docs

0 Likes 0 ·
shpytagleb avatar image shpytagleb Seth Du ♦ commented ·

Those errors were returned by a cloud script to a client in the error callback. This was happening for requests which attempted to access our firebase database. Usually I expect cloud script to return ExecuteCloudScriptResult with an error (that was the case for CloudScriptHTTPRequestError) but yesterday PlayFabError callback was being invoked for all users. Is this information useful for you in any way?
Ok, I will try to migrate most problematic functions to Azure.

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.