question

Matthew Anderson avatar image
Matthew Anderson asked

GameServer (GSDK) Not Connecting to MockVmAgent When In Container

I have created a Multiplayer GameServer and I am having trouble running with the MockVMAgent when it is in a container.

It runs locally fine, but when I run it in the container, the GSDK output contains an exeception every time it tries to run a Heartbeat.

Not knowing if it was because of my server, I created a simple Console app and added only the boilerplate GSDK code. I have the same issue.

It appears that the GSDK is configured correctly, same with MockVMAgent.

GSDK Log is below.

I am using the 0.96 release of the MockVMAgent.

Container is : mcr.microsoft.com/playfab/multiplayer:wsc-10.0.17763.973.1.

GSDKLog:

2021-01-03T20:30:20.4470625Z VM Agent Endpoint: 172.19.0.11:56001

2021-01-03T20:30:20.4481861Z Instance Id: 2e0c50f96786918292c1372bf67a85c9dba6dd2ffcb0564114600d21beac8fd7

2021-01-03T20:30:20.4953504Z Here is a sample log

2021-01-03T20:30:41.7600115Z Cannot send heartbeat: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) --- End of inner exception stack trace ---

at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)

at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)

at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)

at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)

at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)

at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)

at Microsoft.Playfab.Gaming.GSDK.CSharp.HttpClientWrapper.SendHeartbeatAsync(HeartbeatRequest request) at Microsoft.Playfab.Gaming.GSDK.CSharp.InternalSdk.SendHeartbeatAsync()

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

·
Matthew Anderson avatar image
Matthew Anderson answered

After I posted I thought of one more thing... Windows Firewall... Disabled it and it works fine.

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.

Matthew Anderson avatar image Matthew Anderson commented ·

To finally fix...

  • Go to Hyper-V Manager -> Virtual Switch Manager -> WSL-> Connection Type: change from internal to private, apply, change back to internal, apply
  • Restart Docker
  • Set Docker network profile to 'Private'. Run command in PowerShell as admin
    Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private
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.