2

I am using IIS 7 on Windows 2008 Server for an ASP.NET 4 application using Bootstrap. The server has a private IP address to use at work, but is also accessible through a public IP address from outside. Our Internet access provider does the forwarding for us. The server is also running the F-Secure antivirus system.

When I browse the web site from the server itself, using either the private IP or the public one, it works fine. But when I use a remote client (using the public IP, obviously), it works randomly. A typical scenario goes like this:

  1. I type the web site URL on my browser. I get home page.
  2. I click on a link to navigate to another page. I get an INET_E_RESOURCE_NOT_FOUND error.
  3. I hit refresh on the browser. I get the page.
  4. I click on another link. I get the page.
  5. I click on another link. I get an INET_E_RESOURCE_NOT_FOUND error.

And so on and so forth. It is apparently random. Sometimes the server returns the page, sometimes I get the INET_E_RESOURCE_NOT_FOUND error. It happens from every client I have tried, from Edge on a Windows 10 machine to Safari on an iPhone.

Some other times, the server fails to deliver the home page when I first browse to it from a client computer. I retry a few times to no avail. And then, after perhaps 5 or 10 refreshes, I get the page. And from that point on, it works OK until, eventually, it fails again.

As far as I understand, INET_E_RESOURCE_NOT_FOUND does not mean that a page was not found (that would be a 404), but that the server could not be found. It is usually associated with a DNS or proxy error.

I have been looking at IIS log files. As far as I can see, sometimes logging gets interrupted with entries such as this one:

GET /fonts/glyphicons-halflings-regular.woff - 80 - 193.144.38.100 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/52.0.2743.116+Safari/537.36+Edge/15.15063 404 3 50 78

Apparently, the client is trying to get a fonts file and the server returns a 404 error. The font file is on the server in the right folder, so I am not sure why it's failing to find it.

EDIT. I have now fixed the issue with the font file (which was due to a missing MIME type entry on IIS), but the random INET_E_RESOURCE_NOT_FOUND errors remain. The 404 with the font file is likely to be a red herring.

EDIT. I have another issue with this same web site, which may be related. Please see here: https://stackoverflow.com/questions/43814006/smtpexception-in-asp-net-application-with-remote-browser

Any ideas? Thanks.

CesarGon
  • 440
  • 3
  • 14
  • 27
  • How many network interfaces are in your server? And is the public IP address assigned to a NIC on your server, or to one on the ISP's router? – Jens Ehrich May 09 '17 at 19:13
  • Only one NIC. The public IP address is not on the server, but on our Internet access provider's routers. They do the forwarding for us. – CesarGon May 10 '17 at 22:31

4 Answers4

2

Assuming you get this error directly in your browser, rather than it being returned by the proxy server, you can test whether it is caused by DNS issues by adding an entry in your hosts file (%windir%\System32\drivers\etc\hosts in Windows; you'll need to edit it as administrator) to associate the public IP address of your web site with its DNS entry). If you do this, and test the public web site, and you still get the same errors, it's not a DNS problem, and you can start looking at the proxy server configuration. (Remember to remove the entry after testing!)

Pak
  • 919
  • 5
  • 10
  • I am trying this. So far, I have had no errors. – CesarGon May 06 '17 at 23:58
  • 1
    That would suggest that the problem is with DNS resolution. That is quite unusual, given that you've indicated that you have tried accessing the web site from different network locations. You can run tests against them by using the `nslookup` command on Windows (or `dig` if you're using Linux). Run the query multiple times and see if you get any failures to return anything. If you do, I would suggest contacting your DNS provider about it. (If you're running your own DNS server for the web site, you'll need to look at why its intermittently not returning any data for the DNS entry). – Pak May 07 '17 at 00:27
  • Just got some errors. :-( They appear to be random as before. – CesarGon May 07 '17 at 01:12
  • If you had errors with the hosts file entry in place, then you have a very weird error not associated with DNS. When you get the errors, do they take a long time to return the error, or is the error returned immediately? Can you run Wireshark on the PC you're browsing from to capture the packets to and from the server (and any DNS packets), to see what the error might be? It sounds like perhaps something in the network path is randomly (and possibly deliberatly) dropping packets. (You can download Wireshark from https://www.wireshark.org/ if you haven't already got it installed.) – Pak May 07 '17 at 17:01
  • The errors take a longish time (10 seconds?). I will definitely try Wireshark and I'll get back to you. Thanks. – CesarGon May 07 '17 at 18:50
  • I have now installed Wireshark and I've been tinkering with it for a couple of hours. I can't find anything odd with it, other than the fact that the DNS queries from my PC have IPv6 addresses on both the Source and Destination fields when it fails. When it works, I find IPv4 addresses on DNS requests. In both cases, however, the response includes an IPv4 address for the web server. Do you think IPv6 may be "hiding" the server from my PC? – CesarGon May 07 '17 at 23:08
  • It sounds like there might be an IPv6 routing error somewhere (or the proxy firewall is blocking IPv6). Can you ping and/or run traceroute to the IPv6 address? – Pak May 07 '17 at 23:23
  • My web server does not have an IPv6 address. IPv6 is disabled at work. I don't understand why my PC insists to use IPv6 sometimes. – CesarGon May 07 '17 at 23:29
  • BTW I just found this https://support.microsoft.com/es-es/help/2549656/dns-server-service-randomly-cannot-resolve-external-names-and-returns-a-server-failure-error-if-ipv6-is-disabled-in-windows-server-2008-and-windows-server-2008-r2 and this https://serverfault.com/questions/541340/ipv6-on-server-2008r2-kills-dns-resolution-internet-slowdowns – CesarGon May 07 '17 at 23:36
  • I just fully disabled IPv6 on the web server. It seems to be responding nicely now. I will wait until tomorrow and we'll see. Thanks for your help. – CesarGon May 07 '17 at 23:58
  • Damn, I just had two errors now. I managed to capture some packets with Wireshark for one of them, and I found a DNS request for my web server with a refused response by the DNS server. Any idea what may be causing this? – CesarGon May 08 '17 at 08:30
  • That indicates that the DNS server that has the zone record for the web site's domain name isn't always responding to requests from other DNS servers (hence refused). That's probably due to excessive load on that DNS server. You can do an SOA lookup on DNS to see what the nameservers are for the domain name zone (e.g. `nslookup -type=all domain.name` - note that this is the domain name, not the hostname for the web site; e.g. "domain.name" rather than "www.domain.name"), and check each one individually to see if one isn't responding or if you get sporadic errors querying them. – Pak May 08 '17 at 13:02
  • Thanks. I am trying that. So far, all three nameservers for my domain are responding well and fast. I will keep monitoring them for a while. – CesarGon May 08 '17 at 14:14
1

I would suspect that your mime types are not set correctly. I would suggest you add it explicitly as part of your server config.

Others have had this issue before: https://stackoverflow.com/questions/4015816/why-is-font-face-throwing-a-404-error-on-woff-files

DarkSheep
  • 1,036
  • 1
  • 13
  • 23
  • This has removed the 404 error for the font file, but the random errors remain. – CesarGon May 05 '17 at 13:17
  • Are the same transition pages offering the same error or does it happen on the same transition each time? If so, check if the fonts are being accessed consistently in the code. Check your relative links traversing from the wrong start point. As a secondary check host the file somewhere else and try that. – DarkSheep May 05 '17 at 15:47
  • The font file is not causing an error anymore. I think it was a red herring. – CesarGon May 05 '17 at 21:25
  • Also, when I try to browse to the server and I get an error, IIS registers no log entry at all. This is consistent with the fact that INET_E_RESOURCE_NOT_FOUND refers to a DNS or proxy problem. But why the randomness? – CesarGon May 05 '17 at 21:48
  • If it is working on some pages then you might have some caching issues causing the randomness. Check with a private window in your browser and then close it for the next test. Alternatively check your browser for 304s being successful. Things are going to work if they are already in your session Edit to add link https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching – DarkSheep May 06 '17 at 22:19
1

You said that the ISP is doing the forwarding for you, which suggests that they are proxying/port-forwarding to an internal IP and that your server only has one IP address (likely a private one).

If this is true, then it sounds like their proxy server is having issues connecting to your IIS server (for any number of reasons) and is the one returning the error. I would ask the provider to check the logs on their router/firewall to see whether this is the case.

Jens Ehrich
  • 398
  • 2
  • 7
  • After much investigation, we have found the root problem. Our Internet access provider found a configuration error in the NAT tables that mapped the public IP address to our server's internal IP address. This caused some requests to be dropped. They have fixed the configuration and things work well now. Thanks to all who helped with this. – CesarGon May 11 '17 at 13:38
0

1st thing. is the server updates up to date?. Check the version of .net in the server and get it up to date.

Make sure that all the ports that the app uses are being forwarded for your isp

Also, check your Server Logs with this https://gallery.technet.microsoft.com/scriptcenter/Get-event-logs-errors-and-6871f163

Check for the most frequent errors and check if it's related.

Jose Ortega
  • 544
  • 2
  • 9
  • Thanks. The server is up to date, and the only port in use is the standard 80 for HTTP. I'll have a look at the server logs ASAP. – CesarGon Apr 22 '17 at 11:56
  • Make sure that you have all the necessary .net version available for the server (the ones that your web app needs) – Jose Ortega Apr 22 '17 at 18:14
  • I have them. If I didn't, the web site would fail all the time, rather than randomly. ;-) – CesarGon Apr 23 '17 at 18:57