question

VerrDon Mason avatar image
VerrDon Mason asked

Error in cloudscript http request says "See the Error logs for details." What error log is it referring to?

In the response object in data->Logs->0 there is this:

"result": {
	"responseContent": null
	"httpStatus": null
	"httpStatusCode": 0
	"requestError": "InternalError"
},
"httpRequestError": "InternalError"

Is there anywhere to get a more specific error? I'm never seeing a request of any kind hit the target server.

Is there any better documentation for the http library than this: request doc?

There is a post from 11 months ago saying the doc was out of date and describing how to include headers here: previous question but looks like the doc is the same now as it was then.

More generally, is there a way I should be making external http calls from cloudscript other than that library?

Thanks!

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

·
brendan avatar image
brendan answered

The http.request call is indeed the way to make a call out to an external URI from Cloud Script. Apologies that the docs are still the old ones - our tools team has an open work item to update that, but I'm afraid other priorities have continued to push that down the stack. We'll re-evaluate the priority on that in our next planning meeting.

We will also be providing more debugging options in a future update to Cloud Script, but the best way to get all the info from the call right now would be to log the response to the request via log.info or log.error, so that you can review the specifics. But in cases where the response is "InternalError", it's entirely possible that the error itself doesn't contain enough information to go on, in which case you should reach out to us (like this).

If you can give us all the details on the error (Title ID, PlayFab ID, CloudScript revision and handler, as well as any inputs to the handler), we can have a look to see what the issue was. We also, in the case of InternalError responses, open bugs to get more specific error responses into the service, but being able to review the details directly would be helpful in that process as well.

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

VerrDon Mason avatar image VerrDon Mason commented ·

Thanks, Brendan

I found an example in the basic sample for using the http lib, so hopefully my usage is correct. I had a security group problem with too narrow a rule on port 80 that I fixed but didn't resolve the issue either. The most recent errors shouldn't be failing on that, at least if you see multiple different errors over time.

TitleId: EF1B
PlayFab Id: 83BDD250A4CE272B
Revision: 278
Handler: CreateChatAccount

0 Likes 0 ·
brendan avatar image brendan VerrDon Mason commented ·

The issue with the call was that the headers specified in the call to http.request (in Cloud Script) included a Content-Type header, which isn't valid, as the headers for http.request are the request message headers, and not the content headers. I'll open a bug to get a specific error message returned for this.

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.