question

Sung Joon Kim avatar image
Sung Joon Kim asked

Running Multiplayer with LocalMultiplayerAgent in Docker failed

In the past, I have successfully ran Multiplayer Server MPS in Docker and localserver and Azure Playfab multiplayer server.

I got problem with my Windows, so I restored it and tried to setup Docker settings, but I got error this time.

Creating the configuration file at C:\Users\joon\Documents\MpsSamples\UnityMirror\UnityServer\PlayFabLogs\PlayFabVmAgentOutput\2021-08-11T08-09-16\Config\SH0\gsdkConfig.json fail: PlayFabLocalMultiplayerAgent[0] Failed to start container based host with instance number 0. Exception: Docker.DotNet.DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"failed to create endpoint competent_gould on network playfab: failed during hnsCallRawResponse: hnsCall failed in Win32: The process cannot access the file because it is being used by another process. (0x20)"} at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response, IEnumerable`1 handlers) at Docker.DotNet.DockerClient.MakeRequestAsync(IEnumerable`1 errorHandlers, HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, TimeSpan timeout, CancellationToken token) at Docker.DotNet.ContainerOperations.StartContainerAsync(String id, ContainerStartParameters parameters, CancellationToken cancellationToken) at Microsoft.Azure.Gaming.VmAgent.ContainerEngines.DockerContainerEngine.<>c__DisplayClass16_0.<<StartContainer>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Azure.Gaming.VmAgent.TaskUtil.TimedExecute[T](Func`1 action, MuUnhandled exception. ltiLogger logger, String eventName, String metricName, Int64 elapsedThreshold) at Microsoft.Azure.Gaming.VmAgent.ContainerEngines.DockerContainerEngine.StartContainer(String containerId) at Microsoft.Azure.Gaming.VmAgent.ContainerEngines.DockerContainerEngine.CreateAndStart(Int32 instanceNumber, GameResourceDetails gameResourceDetails, ISessionHostManager sessionHostManager) System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Azure.Gaming.LocalMultiplayerAgent.MultiplayerServerManager.CreateAndStartContainerWaitForExit(SessionHostsStartInfo startParameters) at Microsoft.Azure.Gaming.LocalMultiplayerAgent.Program.Main(String[] args) at Microsoft.Azure.Gaming.LocalMultiplayerAgent.Program.<Main>(String[] args)

After running LocalMultiplayerAgent.exe and Docker Container generated and immediately dies.

I get gsdkConfig.json file created.

{ "heartbeatEndpoint": "172.20.0.11:56001", "sessionHostId": "5130de6b975a5666b2ee9570c65359928833c9ca3804aa22f973eb287be8d15a", "vmId": "xcloudwusu4uyz5daouzl:WestUs:492e9846-d93b-4155-9447-3faacc3110eb:tvmps_4179d24bfd214dc499573c9a9745750d0885d73096db49bb8389ad9d8e5ddd81_d", "logFolder": "C:\\GameLogs\\", "certificateFolder": "C:\\GameCertificates", "sharedContentFolder": "C:\\GameSharedContent", "gamePorts": { "game_port": "7777" }, "publicIpV4Address": "127.0.0.1", "gameServerConnectionInfo": { "publicIpV4Adress": "127.0.0.1", "gamePortsConfiguration": [ { "name": "game_port", "serverListeningPort": 7777, "clientConnectionPort": 56100 } ] }, "fullyQualifiedDomainName": "localhost" }

My Windows Version

Edition: Windows 10 Pro

Version: 21H1

OS Build: 19043.1110

Experience: Windows Feature Experience Pack 120.2212.3530.0

multiplayer
10 |1200

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

Sarah Zhang avatar image
Sarah Zhang answered

As our documentation – Locally debugging game servers and integration with PlayFab - PlayFab | Microsoft Docs, especially this section – Troubleshootingsaid, if you get an error similar to: “Docker API responded with status code=InternalServerError, response={"message":"failed to create endpoint <container_name> on network playfab: hnsCall failed in Win32: The specified port already exists". It is likely there is already a container running on the specified port. This can happen if LocalMultiplayerAgent exits prematurely. You can use the command docker PS to find the container that is running, and then kill it using docker kill <container_name>. Or you can follow the PS command sample in the section Known Limitations, stop and remove all containers, then try it again.

10 |1200

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

Dimitris-Ilias Gkanatsios avatar image
Dimitris-Ilias Gkanatsios answered

Did you run the setup.ps1 file before starting LocalMultiplayerAgent? Do you see a network "playfab" with "docker network ls"? Have you switched Docker to Windows Containers? Can you run other containers on the machine e.g. "docker run hello-world"?

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.