Unity Networking Issues - Console error from NetworkIdentity

Does anyone know why I might get this error in my console?

host id out of bound id {0} max id should be greater 0 and less than {0}

Very short and lacking a bit of information, but it’s what I have to work with… The odd thing that is that I don’t Use Unity’s NetworkIdentity component anywhere in my project.

Some background information: I am working on a networking system on Unity’s TransportLayer. I can open and close LAN servers all day with no issue. I use NetworkTransport.Init() and Transport.Shutdown() repeatedly without issue. In the LAN scenario, I open a socket on an unused port (NetworkTransport.AddHost()). I don’t restart the game or anything. I’ve built methods to host and close the server. No issues. Now, when I use NetworkTransport.Init() for the first time, no issue. I continue to open a socket (NetworkTransport.AddHost()), but this socket has been NAT Punchthrough’d via NetRak.DLL. I can also NetworkTransport.Shutdown() without issue. However, the issue arises when I NetworkTransport.Init() after closing a server on a socket that has been NAT Punchthrough’d. Calling Init() does not directly cause an errors. However, every frame I am spammed with the console output above. I believe it is logging the same messages 2 times per frame.

I do not believe the error is caused by the use of RakNet.dll, but I cannot be positive. It is also worth noting again that the issue seems to be coming from Unity’s “NetworkIdentity” which I do not utilize in my project.

Thank you for taking the time to read my post, I appreciate the help! I’ve had this problem for a few days now, and it’s driving me insane. Any help is appreciated!


I was using Unity’s MasterServers to allow game instances to find each other. When you host an internet server, it would create a listing on the MasterServer. I simply needed call NetworkManager.StopHost() once I stopped displaying that master server listing.