question

Michael Schoell avatar image
Michael Schoell asked

Errors Deploying builds using PowerShell

Hello! My team has been setting up for our build machines to automatically upload builds to the PlayFab server using the Powershell API (https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/deploy-using-powershell-api). We have successfully uploaded a build, via Powershell, but have run into an error that we're unsure how to solve.

We often get the following error:

New-PfAsset : Exception calling "GetResult" with "0" argument(s): "Error while copying content to a stream."

+ New-PfAsset -FilePath $filePath -AssetName $fileName

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	+ CategoryInfo          : NotSpecified: (:) [New-PfAsset], MethodInvocationException

	+ FullyQualifiedErrorId : HttpRequestException,New-PfAsset

First we discovered consistently getting the error when uploading full sized builds (~1GB in size) versus test uploads (~200mb and smaller for iteration speed). We discovered that the Windows firewall is at least partially at fault for this error, disabling it made the error go away and uploads to be successful. Later in the evening, with the firewall still disabled, this was tested again and it failed with the same error which has had one of our engineers float the idea whether there is a daily upload quota because we tried again the next morning and uploaded two builds successfully. I'm more dubious of a quota being in place and have found no documentation suggesting there is one.

Judging by Task Manager's reporting of upload data and how long it takes before this error message appears I would judge that it uploads most of the file before the error is produced. In the game manager on the PlayFab site I can confirm the build was attempted to be uploaded, it lists the file as an asset, but the file is corrupt and unusable: PlayFab won't allow it to be assigned to a build.

Disabling the firewall is not a longterm solution but shows that there is probably something we need to be letting through it but cannot find details specifying what to let through. And since disabling the Windows firewall does not appear to fully solve our issues there's something deeper potentially at play. Any thoughts on why we are getting this error and how we might be able to solve it? Right now uploading via PowerShell is looking far too unreliable.

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

Ivan Cai avatar image Ivan Cai ♦ commented ·

I think this is not a firewall issue, but the size of the file you uploaded is too large. I will reproduce it and check for the source code. I will notify you as soon as the results are available.

0 Likes 0 ·
Michael Schoell avatar image Michael Schoell Ivan Cai ♦ commented ·

The size of the file being too large would seem like a major limitation here? ~1GB is a very small size and I expect the server to increase a lot further from here as its still early in development for this project. Uploading the files through the web portal sees no issue with the same file and Azure, which the documentation says the PowerShell uses under the hood, has no such file size (unrelated to PlayFab, I've uploaded a ~60GB file through AzCopy before).

I'd be interested in what your tests and inspection of the source turn up and what the expected workaround is here.

1 Like 1 ·
Seth Du avatar image Seth Du ♦ Michael Schoell commented ·

May I ask have you tried the new PowerShell tools on GitHub - PlayFab/MpsPowershell? If you have issues running the script, please try the latest PowerShell Core 6.0.

When using Game Manager to upload server build, it is preferred to open the developer panel and monitor the Network tab to confirm the upload progress. You may notice that the assert file is divided into several small-sized parts for uploading. (Some blob service version has 100MB block size limit via "put block" request). In the common scenario if the module doesn't support, you may need to write your own script and load the file into bytes then upload.

In terms of the upload quota, you may get confirmation from Azure team as the server build is uploaded to Azure blob storage.

0 Likes 0 ·

1 Answer

·
Jonathan Crowe avatar image
Jonathan Crowe answered

In the common scenario if the module doesn't support, you may need to write your own script and load the file into bytes then upload.

Any directions or docs on how you deal with muti part uploads via powershell?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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.