Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.

Cannot start agent a second time with containers. #5

Closed
asusralis opened this issue Sep 18, 2019 · 7 comments
Closed

Cannot start agent a second time with containers. #5

asusralis opened this issue Sep 18, 2019 · 7 comments

Comments

@asusralis
Copy link

asusralis commented Sep 18, 2019

The first time I ran the agent with a container it worked correctly and went through the motions. I uploaded to PlayFab but it said my build was unhealthy, so I went back to try it again. Now this shows up:

info: MockPlayFabVmAgent[0]
Event: ContainerStats. Properties: NULL, Metrics: {"containerCreationTimeMs":101.0}
info: MockPlayFabVmAgent[0]
Created a container with session host id: d21d16cca1a0a886c41473ef4466d7e18fc29faf0d409814ea8cacc4770767b9

Unhandled Exception: System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate)
at Microsoft.Azure.Gaming.VmAgent.ContainerEngines.DockerContainerEngine.GetVmAgentIpAddress() in D:\t2\src\VmAgent\VmAgent.Common\Interfaces\DockerContainerEngine.cs:line 108
at Microsoft.Azure.Gaming.VmAgent.ContainerEngines.DockerContainerEngine.CreateAndStart(Int32 instanceNumber, GameResourceDetails gameResourceDetails, ISessionHostManager sessionHostManager) in D:\t2\src\VmAgent\VmAgent.Common\Interfaces\DockerContainerEngine.cs:line 351
at Microsoft.Azure.Gaming.MockVmAgent.MultiplayerServerManager.CreateAndStartContainerWaitForExit(SessionHostsStartInfo startParameters) in D:\t2\src\VmAgent\MockVmAgent\MultiplayerServerManager.cs:line 49
at Microsoft.Azure.Gaming.MockVmAgent.Program.Main(String[] args) in D:\t2\src\VmAgent\MockVmAgent\Program.cs:line 69

I made sure to run the two commands at the end of the guide to end all containers.

@dgkanatsios
Copy link
Contributor

hey @asusralis, which guide did you follow? As mentioned here, the LocalMultiPlayerAgent is meant to be used for local development, not to be uploaded onto PlayFab service (unless I misunderstood something).

@asusralis
Copy link
Author

asusralis commented Sep 30, 2019

So, I tested the game on my computer and it worked. I then uploaded the build (what was tested on my computer, NOT the agent) to PlayFab and it did not work. I then went back to my computer to test it again to see if I could figure out why it was working on my computer but not on the PlayFab server and I wasn't able to get the agent to run again. I did not upload the agent to PlayFab.

That is the guide I used. I was able to run my game in a container and it went through the motions. I tried it again the next day and it gave me those errors.

@dgkanatsios
Copy link
Contributor

Maybe Docker networks on your local installation have an issue? You might want to restart the Docker daemon. Maybe try deleting docker networks and retrying (here's the CLI reference -> https://docs.docker.com/engine/reference/commandline/network/). Sometimes deleting the "DockerNAT" virtual switch from Hyper-V Manager helps, you can restart Docker from system tray to recreate.
After that, you can run setup.ps1 to re-create the networks.

@starburst997
Copy link

I had the exact same issue, running setup.ps1 again fixed that

@dgkanatsios
Copy link
Contributor

Thanks for reporting that @starburst997!

@dgkanatsios
Copy link
Contributor

hey @asusralis is this issue still relevant? Thanks!

@dgkanatsios
Copy link
Contributor

Closing, feel free to open a new issue if the problem exists.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants