question

David A Kimball JR avatar image
David A Kimball JR asked

New-PFMultiplayerBuild "'Name' does not match expected pattern,New-PFMultiplayerBuild error occurred while calling the api

I am not sure what the issue is here, took me a while to get the command because the documentation is out of date? Does anyone have any idea what 'Name' the script is refering to or what might be the issue?

## Remove Previous Build Remove-PFMultiplayerAsset -FileName FeudalLandsGameServer.zip ## Add an asset and get the list of assets Add-PFMultiplayerAsset -FilePath "$(System.ArtifactsDirectory)\_Game-.NET Desktop-CI\drop\FeudalLandsGameServer.zip" Get-PFMultiplayerAsset $AssetReference = New-Object Playfab.MultiplayerModels.AssetReferenceParams $AssetReference.FileName = "FeudalLandsGameServer.zip" $AssetReference.MountPath = "C:\Assets\" ## Add a certificate and get the list of certificates #Add-PFMultiplayerCertificate -Name "feudallandswebcert" -FilePath #"C:\certs\feudallandswebcert.pfx" Get-PFMultiplayerCertificate ## Create a build $VMSelection = [PlayFab.MultiplayerModels.AzureVMSize]::Standard_D2_v2 $Ports = New-object PlayFab.MultiplayerModels.Port $Ports.Name = "server" $Ports.Num = 8080 $Ports.Protocol = [PlayFab.MultiplayerModels.ProtocolType]::TCP $BuildCert = New-Object System.Collections.Generic.List[PlayFab.MultiplayerModels.GameCertificateReferenceParams] $BuildCertParams = New-Object PlayFab.MultiplayerModels.GameCertificateReferenceParams $BuildCertParams.Name = "feudallandswebcert" $BuildCertParams.GsdkAlias = "feudallandswebcert" $BuildCert.Add($BuildCertParams) $RegionConfiguration = New-Object PlayFab.MultiplayerModels.BuildRegionParams $RegionConfiguration.Region = "WestEurope" $RegionConfiguration.MaxServers = 1

New-PFMultiplayerBuild -BuildName "FeudalLands" -AssetReferences $AssetReference -RegionConfiguration $RegionConfiguration -StartMultiplayerServerCommand "C:\Assets\FeudalLands.exe" -Ports $Ports -VMSize $VMSelection -CertificateReferences $BuildCert -MultiplayerServerCountPerVm 1 New-PFMultiplayerBuild : Error occurred while calling the api. {"HttpCode":400,"HttpStatus":"BadRequest","Error":1382,"ErrorMessage":"'Name' does not match expected pattern '^[0-9a-zA-Z-]+ At line:1 char:1 + New-PFMultiplayerBuild -BuildName "FeudalLands" -AssetReferences $Ass ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-PFMultiplayerBuild], Exception + FullyQualifiedErrorId : System.Exception,PFMultiplayerCmdlets.NewPFMultiplayerBuild.","ErrorDetails":null}. {replace4} {replace5} {replace6} {replace7} {replace8}

,

I am not sure what's missing here, it took me a while to craft the command because the documentation is out of date. Does anyone know what could be causing this?

## Remove Previous Build Remove-PFMultiplayerAsset -FileName FeudalLandsGameServer.zip ## Add an asset and get the list of assets Add-PFMultiplayerAsset -FilePath "$(System.ArtifactsDirectory)\_Game-.NET Desktop-CI\drop\FeudalLandsGameServer.zip" Get-PFMultiplayerAsset $AssetReference = New-Object Playfab.MultiplayerModels.AssetReferenceParams $AssetReference.FileName = "FeudalLandsGameServer.zip" $AssetReference.MountPath = "C:\Assets\" ## Add a certificate and get the list of certificates #Add-PFMultiplayerCertificate -Name "feudallandswebcert" -FilePath #"C:\certs\feudallandswebcert.pfx" Get-PFMultiplayerCertificate ## Create a build $VMSelection = [PlayFab.MultiplayerModels.AzureVMSize]::Standard_D2_v2 $Ports = New-object PlayFab.MultiplayerModels.Port $Ports.Name = "server" $Ports.Num = 8080 $Ports.Protocol = [PlayFab.MultiplayerModels.ProtocolType]::TCP $BuildCert = New-Object System.Collections.Generic.List[PlayFab.MultiplayerModels.GameCertificateReferenceParams] $BuildCertParams = New-Object PlayFab.MultiplayerModels.GameCertificateReferenceParams $BuildCertParams.Name = "feudallandswebcert" $BuildCertParams.GsdkAlias = "feudallandswebcert" $BuildCert.Add($BuildCertParams) $RegionConfiguration = New-Object PlayFab.MultiplayerModels.BuildRegionParams $RegionConfiguration.Region = "WestEurope" $RegionConfiguration.MaxServers = 1

New-PFMultiplayerBuild -BuildName "FeudalLands" -AssetReferences $AssetReference -RegionConfiguration $RegionConfiguration -StartMultiplayerServerCommand "C:\Assets\FeudalLands.exe" -Ports $Ports -VMSize $VMSelection -CertificateReferences $BuildCert -MultiplayerServerCountPerVm 1 New-PFMultiplayerBuild : Error occurred while calling the api. {"HttpCode":400,"HttpStatus":"BadRequest","Error":1382,"ErrorMessage":"'Name' does not match expected pattern '^[0-9a-zA-Z-]+ At line:1 char:1 + New-PFMultiplayerBuild -BuildName "FeudalLands" -AssetReferences $Ass ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-PFMultiplayerBuild], Exception + FullyQualifiedErrorId : System.Exception,PFMultiplayerCmdlets.NewPFMultiplayerBuild.","ErrorDetails":null}. {replace4} {replace5} {replace6} {replace7} {replace8}

1 comment
10 |1200

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

David A Kimball JR avatar image David A Kimball JR commented ·

I dont see a pipe anywhere in the config?

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

Sorry, I though "l" was a pipe. For now, I don't see any issues on the web, "FeudalLands" looks fine in this thread. Would you try all those names with Game Manager?

The error is quite straightforward:

{
    "HttpCode": 400,
    "HttpStatus": "BadRequest",
    "Error": 1382,
    "ErrorMessage": "'Name' does not match expected pattern '^[0-9a-zA-Z-]+ At line:1 char:1 + New-PFMultiplayerBuild -BuildName "FeudalLands" -AssetReferences $Ass ... +"
}

This error indicates the request cannot be recognized by the server, it seems the Name doesn't match a pattern. I will also try to reproduce this issue by using your defined name.

In addition, you need to make sure there are no empty characters or blank Unicode characters in any names, and sometimes it is hard to tell the existence because some of them don't take a place like blank space.

10 |1200

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

Seth Du avatar image
Seth Du answered

According to the error message, the build name is "FeudalLands", and there is a vertical bar inside -- "|", which is not supported. Also as the error message indicates, the name should match "^[0-9a-zA-Z-]", which means it only allows English alphabet and number.

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.

David A Kimball JR avatar image David A Kimball JR commented ·

I do not see a pipe character anywhere in the script, where are you looking?

0 Likes 0 ·
David A Kimball JR avatar image David A Kimball JR commented ·

Where is there a vertical bar?

This is the command being run also in the original post, im not seeing any changes to the build name.

I will change the build name to "$(Build.BuildID)" and kick off the pipeline again to see if that helps. Thanks for the feedback!

0 Likes 0 ·
David A Kimball JR avatar image David A Kimball JR David A Kimball JR commented ·

Anyone have an idea what Name the error is refering to is?

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.