question

pixeljump avatar image
pixeljump asked

Automated task get request failing 50% of the time

I have a simple get request to my server running every 5 minutes, but it gives me a failed status 50% of the time. It's really not a big deal functionality wise, but just a bit confusing. I can run this get request over and over from postman and it never fails.

I'm guessing it's reaching some allocated runtime while waiting for the response or something?

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

·
brendan avatar image
brendan answered

Can you please clarify:

Title ID

What specific PlayFab feature you're using (it sounds like you're saying it's a scheduled task - if so, what is it triggering specifically)

The error message you're seeing

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.

pixeljump avatar image pixeljump commented ·

Title ID: 968D

It's a scheduled task triggering a cloudscript which simply performs a get request to my server. It says it's an internal error, but it never actually fails when calling it from postman/browser.

 "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 handlers.commitGlobalKills (968D-main.js:150:23)"
        }
0 Likes 0 ·
brendan avatar image brendan pixeljump commented ·

Can you please enclose the call to http.request in a try/catch, and log the output of the error?

0 Likes 0 ·
pixeljump avatar image pixeljump brendan commented ·

I added the try catch and it now works 100% of the time...

I have a suspicion it was already succeeding in making the request 100% of the time, but cloud script was reporting a failure.. It's going to one of life's great mysteries.

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.