Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by Deekshith · May 27, 2020 at 12:39 PM · CloudScriptapis

Timeout error for makeHttpRequest

I am making a http request to a azure function in a cloudscript function and there is this strange thing happening which is quite rare but it does happen. I will be getting a timeout error for this makeHttpRequest.

There is no timeout for the cloudscript as I did check execution time and it was around 2 seconds and it is getting called from client side not a playstream event. Why is this error happening and how to resolve it?

Following is a small part of the error caught in catch block

cloudScriptErrorCode:CloudScriptHTTPRequestError

\"contentType\":\"application/json\",\"headers\":{},\"result\":{\"responseContent\":null,\"httpStatus\":null,\"httpStatusCode\":0,\"requestError\":\"Timeout\"},\"httpRequestError\":\"Timeout\"}
Comment
Deekshith

People who like this

1 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Citrus Yan · May 28, 2020 at 05:46 AM

So this does not happen quite often, is that correct? And, as a matter of fact, there are many causes for the timeout issue: increase of traffics on the internet, Azure Function may be cold starting, etc. You may need to add some re-try mechanisms to handle this.

However, I think the main problem here is that why are you trying to call Azure Functions from CloudScript? The purpose of the new PlayFab CloudScript using Azure Functions feature is that you can have much longer-running, asynchronous and free from the API count limit calls. Calling Azure Function from legacy Cloud Script would be counterproductive, since the legacy engine may time out at times.

Comment

People who like this

0 Show 4 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Deekshith · May 28, 2020 at 06:33 AM 0
Share
  • Yes it does not happen quite often. It rarely happens.
  • I have tried a retry mechanism which will retry once but it took another 2 seconds and still got a timeout error.
  • Yes I am calling azure function using makeHttpRequest()
  • I am not clear on the link you provided and how to use it or test it. Can you please elaborate on this?
avatar image Citrus Yan Deekshith · May 29, 2020 at 09:40 AM 0
Share

The link is a tutorial of our new PlayFab CloudScript using Azure Functions feature where you can execute your server logic entirely on Azure Functions with PlayFab instead of using the legacy CloudScript. We recommend that you use the new feature since you already have a Azure Function Subscription and needs to call Azure Function from CloudScript.

avatar image Deekshith Citrus Yan · May 30, 2020 at 11:04 AM 0
Share

Ok Thanks,I will look into it. However just want to get a clear idea on why makeHttpRequest is getting timed out in such a short time?

Is there any time limit for that? Is it documented anywhere?

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    [SERVER or Cloud Script] Retrieving Server CustomData or Tags without Client.GetCurrentGames 1 Answer

    Cloud Script Entities. Get title objects of player 1 Answer

    Occasional error on API calls - A third-party downstream provider returned an error... 1 Answer

    Sending JSON data for executing Cloud Script 1 Answer

    executecloudscript unity Function Parameter 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges