After installing this package, my I can no longer get to the Umbraco admin. I get this error:
The requested name is valid, but no data of the requested type was found
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SocketException (0x2afc): The requested name is valid, but no data of the requested type was found]
System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) +7894363
System.Net.Dns.GetHostEntry(String hostNameOrAddress) +474
Cultiv.EnvironmentIndicator.IndicatorAdapter.OnLoad(EventArgs e) +331
System.Web.UI.Control.LoadRecursive() +11250815
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048
I see, that's quite odd. Apparently it can't succesfully deduce the hostname, you could indeed try to add a hostname to your site in umbraco. Either way, I need to fix this and put this code in a try catch block at least. Will keep you posted about the progress!
Hey Connie, I have a new version for you to test, could you try this one out?
It should say in your logfile what was wrong, in tblLog search for a log entry starting with "Couldn't get the IP address of the current HTTP_HOST". Would be interested to see what error you get.
I reinstalled the package and applied the updated DLL. No error, but also no appearance of the line. I have <add key="environment" value="dev" /> in my web.config.
Any thoughts on why this still does not work? I get the following in my error log:
Couldn't get the IP address of the current HTTP_HOST (www.azbar.dev), exception: The requested name is valid, but no data of the requested type was found
I think you may be in a network that doesn't support getting the IP address of your host through the method I'm using. When I get a chance, I'll do the IP detection in a try-catch block so that this error is not thrown.
I got the same error (the site was only accessible via ip address) and I wouldn't be suprised if dns queries were restricted on the network. The patch you provided in this post solves the problem. Think you can package it up into a new release just to keep current?
Unfortunately, I get the same exception in our environment, and the patch provided is now a 404... If there is a working patch, it would be best to push a new version of the package to the 'app store'
Hey Michiel, I've "misplaced" the original source code unfortunately, but the idea was that it would be integrated into the PageNotifications package but that one seems not to be maintained any more either.
And through some decompilation I think I have the code back now, which could be used to update Indicator.cs in aforementioned package (i think you can just change the line that starts with var serverIsLocalIp with this):
var serverIsLocalIp = false;
try
{
serverIsLocalIp = Dns.GetHostEntry(HttpContext.Current.Request.ServerVariables["HTTP_HOST"].Substring(0, HttpContext.Current.Request.ServerVariables["HTTP_HOST"].IndexOf(':'))).AddressList.Any(ip => ip.ToString() == "127.0.0.1");
}
catch (Exception ex)
{
Log.Add((LogTypes.Error, new User(0), -1, string.Format("Couldn't get the IP address of the current HTTP_HOST ({0}), exception: {1}", HttpContext.Current.Request.ServerVariables["HTTP_HOST"], ex.Message));
}
Site Fails After Install
After installing this package, my I can no longer get to the Umbraco admin. I get this error:
The requested name is valid, but no data of the requested type was found
Exception Details: System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Interesting, this seems to be a problem with the hostname of your current site. Can you tell me what the hostname is?
I don't have a hostname set in Umbraco. Should I?
I don't believe you'd need it, but can you tell me what the address in your browser's addres bar is?
http://www.azbar.org (for production) however I was first trying to test on dev and staging:
http://www.azbar.dev and http://www.azbar.stg
I see, that's quite odd. Apparently it can't succesfully deduce the hostname, you could indeed try to add a hostname to your site in umbraco. Either way, I need to fix this and put this code in a try catch block at least. Will keep you posted about the progress!
Hey Connie, I have a new version for you to test, could you try this one out?
It should say in your logfile what was wrong, in tblLog search for a log entry starting with "Couldn't get the IP address of the current HTTP_HOST". Would be interested to see what error you get.
Download it here. Just unzip the dll into your bin folder.
Sebastiaan,
I reinstalled the package and applied the updated DLL. No error, but also no appearance of the line. I have <add key="environment" value="dev" /> in my web.config.
Any thoughts on why this still does not work? I get the following in my error log:
I think you may be in a network that doesn't support getting the IP address of your host through the method I'm using. When I get a chance, I'll do the IP detection in a try-catch block so that this error is not thrown.
Hi Sebastiaan,
Love the package :)
I got the same error (the site was only accessible via ip address) and I wouldn't be suprised if dns queries were restricted on the network. The patch you provided in this post solves the problem. Think you can package it up into a new release just to keep current?
Cheers,
Patrick
Unfortunately, I get the same exception in our environment, and the patch provided is now a 404... If there is a working patch, it would be best to push a new version of the package to the 'app store'
Hey Michiel, I've "misplaced" the original source code unfortunately, but the idea was that it would be integrated into the PageNotifications package but that one seems not to be maintained any more either.
Here's the 404 dll again: https://dl.dropbox.com/u/3006713/Cultiv.EnvironmentIndicator.dll.zip
And through some decompilation I think I have the code back now, which could be used to update Indicator.cs in aforementioned package (i think you can just change the line that starts with var serverIsLocalIp with this):
is working on a reply...