question

FENG LI avatar image
FENG LI asked

/File/InitiateFileUploads PlayfabError(ServiceUnavailable, Unknown Error, 400 BadRequest)

I got this error occasionally while uploading small size file(5~15k), sometime successful, sometime get this error -- maybe once per 5 times, very strange.

My network is stable. Any clue?

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

·
Andy avatar image
Andy answered

Can you grab the full response payload? I'm curious what precise error code is being returned. With small files, it might be that you're not waiting for previous file operations to complete.

Are you calling the API for one file at a time, or all at once?

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

FENG LI avatar image FENG LI commented ·

How to grab the full response payload?

I calling the API for one file at a time, followed the tutorials https://docs.microsoft.com/en-us/gaming/playfab/features/data/playerdata/entity-files

I got the PlayfabError.ToString logged, it contains the error code "ServiceUnavailable":

/File/InitiateFileUploads PlayfabError(ServiceUnavailable, Unknown Error, 400 BadRequest)

0 Likes 0 ·
Andy avatar image Andy ♦♦ FENG LI commented ·

I did a little more digging. That error occurs when the underlying http transport returns "Unknown Error" instead of an actual response payload. This could happen for any number of reasons, but I think it's generally related to disruptions in the local network. You might be able to just handle the error and retry.

If that's not sufficient, could you share what game engine you're working in and what http transport is being used? For Unity, that would be UnityWebRequest, WWW, or HttpWebRequest.

0 Likes 0 ·
FENG LI avatar image FENG LI commented ·

I'm using Unity with UnityWebRequest.

The WWW is obsolete and HttpWebRequest seems need more settings, so i just use UnityWebRequest.

0 Likes 0 ·
Andy avatar image Andy ♦♦ FENG LI commented ·

In that case, I would suggest handling the error and retrying, it should be transient and subject to local network conditions.

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.