question

Phil Woods avatar image
Phil Woods asked

Powershell New-PFMultiplayerBuild error "The GameAssetReferences field is required.",

We've been trying to create a server build using the Powershell module PlayFabMultiplayer but when we try and call New-PFMultiplayerBuild we get the following error:

New-PFMultiplayerBuild : Error occurred while calling the api. New-PFMultiplayerBuild : Error occurred while calling the api. {"HttpCode":400,"HttpStatus":"BadRequest","Error":1000,"ErrorMessage":"Invalid input parameters","ErrorDetails":{"StartMultiplayerServerCommand":["The StartMultiplayerServerCommand field is required."],"GameAssetReferences":["The GameAssetReferences field is required."],"BuildName":["The BuildName field is required."],"MultiplayerServerCountPerVm":["The field MultiplayerServerCountPerVm must be between 1 and 2147483647."],"Ports":["The Ports field is required."],"RegionConfigurations":["The RegionConfigurations field is required."]}}.

The help for New-PFMultiplayerBuild gives:

NAME

New-PFMultiplayerBuild

SYNTAX

New-PFMultiplayerBuild -BuildName <string> -StartMultiplayerServerCommand <string>

-Ports <List[Port]> -MultiplayerServerCountPerVm <int> -VmSize {Standard_D1_v2 |

Standard_D2_v2 | Standard_D3_v2 | Standard_D4_v2 | Standard_D5_v2 | Standard_A1_v2 |

Standard_A2_v2 | Standard_A4_v2 | Standard_A8_v2 | Standard_F1 | Standard_F2 |

Standard_F4 | Standard_F8 | Standard_F16 | Standard_F2s_v2 | Standard_F4s_v2 |

Standard_F8s_v2 | Standard_F16s_v2 | Standard_A1 | Standard_A2 | Standard_A3 |

Standard_A4} -RegionConfiguration <List[BuildRegionParams]> -AssetReferences

<List[AssetReferenceParams]> [-ContainerFlavor {ManagedWindowsServerCore | CustomLinux |

ManagedWindowsServerCorePreview | Invalid}] [-Metadata <Dictionary[string,string]>]

[-CertificateReferences <List[GameCertificateReferenceParams]>]

[-ProductionEnvironmentUrl <string>] [<CommonParameters>]

Which doesn't contain a field for GameAssetReferences.

We tried changing our field for AssetReferences to that of GameAssetReferences and tried the Powershell again to get the following error:

New-PFMultiplayerBuild : A parameter cannot be found that matches parameter name 'GameAssetReferences'.

Anyone know what we may be doing wrong, or is the Powershell bugged?

Thanks,

Phil.

,
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

·
Sarah Zhang avatar image
Sarah Zhang answered

The “GameAssetReference” field in the error message pointed to the “AssetReferences” field. The spelling of the field in the PowerShell command is right. According to this error message, it seems that for some reasons, all the fields in this API request are not correctly identified. We tried the sample command that in this section – Create a build. It can work fine. Could you please further check the command you wrote?

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.

Phil Woods avatar image Phil Woods commented ·

If the spelling in the error messages and/or help is incorrect then it might be that the error is something else. Here is some example Powershell that we've been using, can you see what might be wrong the following please:

New-PFMultiplayerBuild -BuildName "Example" -VMSize Standard_D1_v2 -MultiplayerServerCountPerVm 1 -ContainerFlavor ManagedWindowsServerCore -AssetReferences $Assets -StartMultiplayerServerCommand "C:\Assets\Example.exe" -Ports $Ports -RegionConfiguration $Regions

0 Likes 0 ·
Phil Woods avatar image Phil Woods commented ·

Okay, the error messages from Powershell are a bit misleading.

With a bit of trial and error we've figured out what's wrong. We were using the string "East US" in the regions, which throws up the error message about needing to use GameAssetReferences instead of AssetReferences.

So for anyone hitting the same error, you'll need to remove any spaces in the region names.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Phil Woods commented ·

Thanks for the feedback.

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.