WhiteCoreSim / WhiteCore-Dev

WhiteCoreSim - Software to create your own virtual world
BSD 3-Clause "New" or "Revised" License
26 stars 34 forks source link

Retrieving the external IP address fail #256

Closed johnfelipe closed 7 years ago

johnfelipe commented 7 years ago

May 12 04:50:41 - [Network]: Retrieving the external IP address May 12 04:50:51 - [Utilities]: Failed to get external IP, System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] in :0 at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] in :0 , please check your internet connection (if this applies), setting to internal...

how solved?

fly-man- commented 7 years ago

Sometime the external site is down, not much we can do to fix that.

emperorstarfinder commented 7 years ago

This error is not in reference to a website. This error means that it is simply having trouble obtaining the IP address of the machine your running the server on.

In most cases rebooting the machine will resolve this. This does happen every now and then on all operating systems. Usually it is caused by the machine being on for very long periods without a reboot, the cache created by the operating system getting to large i.e. memory dump, etc.

another trick to helping would be to unplug your network router/ modem for approximately 1 minute and if your using the Windows operating system open a command prompt (as administrator) and do the command

ipconfig/flushdns

four times and then reboot the machine. This will ensure the DNS cache is dumped which essentially clears it and will force propogation of new DNS records in the operating system DNS cache. After doing the command four times and resetting the network modem/ router you will want to reboot the machine in order for this to fully be cleared.

After doing this you should be good to go and your external IP on the machine should be detected by WhiteCore.

I have run into this issue myself in the past and this trick does work.

Hope that helps a bit.

fly-man- commented 7 years ago

@emperorstarfinder That error 404 comes from the site that we use to find the external IP address. And sometimes that error occurs at random when they are doing maintenance on their side.

emperorstarfinder commented 7 years ago

Then this would lead to the questions:

  1. Why is WhiteCore not in fact detecting it from the NIC card instead of going to some external site that WhiteCore does not own or control to detect the external IP on startup. If we can detect the internal IP locally without connecting to some external site surely this can be done for the external IP granted by the ISP. NIC cards would have this info as they use DHCP (if they have not been set to use a static IP on their internal network. Even then you potentially can get that via the NIC and the modem/ router.

and

  1. Which site exactly are we using to detect the external IP?

This could potentially create a loophole that we would want to close so as not to expose users to security threats i.e. unwanted hacking.