Asked by:
The underlying connection was closed: An unexpected error occurred on a receive

Question
-
I've implemented the MetaWebLog API for our bespoke CMS. Previously this was working nicely with LiveWriter. Since installing the latest beta, I get the following error when trying to 'Add Weblog Account'. I have tried using a different windows blog client and this works as expected.
I am currently running Vista Business SP1 x64, using WLW Beta (Build 14.0.5025.904).
Log file:
WindowsLiveWriter,1.4592,None,00035,05-Dec-2008 14:32:09.355,"XML-RPC request:
http://jonb-xos-01/miweb3/blogs/metablog.ashx
<?xml version=""1.0"" encoding=""utf-8""?>
<methodCall>
<methodName>blogger.getUsersBlogs</methodName>
<params>
<param>
<value>
<string>ffffffabffffffce6dffffff93ffffffac29ffffffc9fffffff826ffffffdeffffffc9ffffffe43c0b763036ffffffa0fffffff3ffffffa963377716</string>
</value>
</param>
<param>
<value>
<string>developer</string>
</value>
</param>
<param>
<value>[removed]</value>
</param>
</params>
</methodCall>",""
WindowsLiveWriter,1.4592,None,00036,05-Dec-2008 14:32:09.355,"== BEGIN WebException =====================",""
WindowsLiveWriter,1.4592,None,00037,05-Dec-2008 14:32:09.355,"Status: ReceiveFailure",""
WindowsLiveWriter,1.4592,None,00038,05-Dec-2008 14:32:09.356,"System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at WindowsLive.Writer.CoreServices.HttpRequestHelper.SendRequest(String requestUri, HttpRequestFilter filter)
at WindowsLive.Writer.CoreServices.XmlRpcClient.CallMethod(String methodName, XmlRpcValue[] parameters)
at WindowsLive.Writer.BlogClient.Clients.XmlRpcBlogClient.CallMethod(String methodName, XmlRpcValue[] parameters)",""
WindowsLiveWriter,1.4592,None,00039,05-Dec-2008 14:32:09.356,"== END WebException =======================",""
WindowsLiveWriter,1.4592,Fail,00040,05-Dec-2008 14:32:09.358,"WindowsLive.Writer.Extensibility.BlogClient.BlogClientConnectionErrorException: Network Connection Error - Error attempting to connect to weblog at:http://jonb-xos-01/miweb3/blogs/metablog.ashx
The underlying connection was closed: An unexpected error occurred on a receive.
at WindowsLive.Writer.BlogClient.BlogClientBase.CreateAuthenticatedCredential()
at WindowsLive.Writer.BlogClient.BlogClientBase.Login()
at WindowsLive.Writer.BlogClient.Clients.BloggerCompatibleClient.GetUsersBlogs()
at WindowsLive.Writer.BlogClient.Detection.BlogAccountDetector.ValidateService()"," at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at WindowsLive.Writer.CoreServices.Diagnostics.LogFileTraceListener.Fail(String message)
at System.Diagnostics.TraceInternal.Fail(String message)
at System.Diagnostics.Trace.Fail(String message)
at WindowsLive.Writer.BlogClient.Detection.BlogAccountDetector.ReportError(Exception ex, MessageId errorMessageType, Object[] errorMessageParams)
at WindowsLive.Writer.BlogClient.Detection.BlogAccountDetector.ValidateService()
at WindowsLive.Writer.PostEditor.Configuration.Wizard.WeblogConfigurationWizardPanelSelectProvider.ValidatePanel()
at WindowsLive.Writer.PostEditor.Configuration.Wizard.WeblogConfigurationWizardController.OnValidatePanel(Object panelControl)
at WindowsLive.Writer.Controls.Wizard.WizardStep.Verify()
at WindowsLive.Writer.Controls.Wizard.WizardController.next()
at WindowsLive.Writer.Controls.Wizard.WizardForm.buttonNext_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at WindowsLive.Writer.PostEditor.Configuration.Wizard.WeblogConfigurationWizardController.ShowDialog(IWin32Window owner, String title)
at WindowsLive.Writer.PostEditor.Configuration.Wizard.WeblogConfigurationWizardController.ShowBlogWizard(String caption, IWin32Window owner, Boolean& switchToWeblog)
at WindowsLive.Writer.PostEditor.Configuration.Wizard.WeblogConfigurationWizardController.AddWeblog(IWin32Window owner, String caption, Boolean permitSwitchingWeblogs, Boolean& switchToWeblog)
at WindowsLive.Writer.PostEditor.Configuration.Wizard.WeblogConfigurationWizardController.Add(IWin32Window owner, Boolean permitSwitchingWeblogs, Boolean& switchToWeblog)
at WindowsLive.Writer.PostEditor.PostEditorMainControl.WindowsLive.Writer.PostEditor.IBlogPostEditingSite.AddWeblog()
at WindowsLive.Writer.PostEditor.WeblogCommandManager.commandAddWeblog_Execute(Object sender, EventArgs e)
at WindowsLive.Writer.ApplicationFramework.Command.RaiseEvent(Object eventKey, EventArgs e)
at WindowsLive.Writer.ApplicationFramework.Command.OnExecute(EventArgs e)
at WindowsLive.Writer.ApplicationFramework.CommandOwnerDrawMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItem.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Command.DispatchID(Int32 id)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at WindowsLive.Writer.ApplicationFramework.ApplicationForm.WndProc(Message& m)
at WindowsLive.Writer.ApplicationFramework.SatelliteApplicationForm.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsLive.Writer.ApplicationFramework.SatelliteApplicationForm.Launcher.ThreadMain(Object[] parameters)
at WindowsLive.Writer.CoreServices.Threading.ThreadStartWithParams.Run()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()"Friday, December 5, 2008 2:47 PM
All replies
-
Do you have a proxy or firewall enabled? Can you view the traffic using Fiddler and see if there is anymore information? http://www.fiddlertool.com/fiddler/
-Brandon Turner [MSFT]Friday, December 5, 2008 5:49 PM -
Thanks Brandon, I'll give fiddler a go and let you know.
A bit more info, I do have the ISA Server proxy client installed and I am hosting the CMS on my localhost IIS.
Saturday, December 6, 2008 11:15 AM -
Hi, I hope this helps.
These were the 3 items which fiddler detected while I ran through the initial account creation steps in LiveWriter.
------------------------------------------------------------------
GET /miweb3/ HTTP/1.1
Accept: */*
Accept-Language: en-US, en, *
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Windows Live Writer 1.0)
Host: jonb-xos-01
Cache-Control: no-cache
Pragma: no-cache
Connection: Close
------------------------------------------------------------------GET /miweb3/ HTTP/1.1
Accept: */*
Accept-Language: en-US, en, *
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Windows Live Writer 1.0)
Cache-Control: no-cache
Pragma: no-cache
Host: jonb-xos-01
Connection: Close
------------------------------------------------------------------POST /miweb3/blogs/metablog.ashx HTTP/1.1
Accept: */*
Accept-Language: en-US, en, *
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Windows Live Writer 1.0)
Content-Type: text/xml
Host: jonb-xos-01
Content-Length: 490
Connection: Close<?xml version="1.0" encoding="utf-8"?>
<methodCall>
<methodName>blogger.getUsersBlogs</methodName>
<params>
<param>
<value>
<string>ffffffabffffffce6dffffff93ffffffac29ffffffc9fffffff826ffffffdeffffffc9ffffffe43c0b763036ffffffa0fffffff3ffffffa963377716</string>
</value>
</param>
<param>
<value>
<string>developer</string>
</value>
</param>
<param>
<value>
<string>XXXXXXXXXXXXXXXX</string>
</value>
</param>
</params>
</methodCall>
------------------------------------------------------------------Monday, December 8, 2008 11:36 AM -
And did that last request turn red inside fiddler showing that there was an error?
Also, this sounds like some kind of networking issue for sure, and less to do with the code on your server or inside Windows Live Writer. If you go into Internet Explorer, Tools > Internet Options > Connections > LAN Settings can you verify that your proxy is disabled for your LAN or, that the bypass for localhost setting is applied?
-Brandon Turner [MSFT]Monday, December 8, 2008 6:11 PM -
Yes, it went red.
Proxy client is disabled, Proxy in IE is disabled (or set to bypass for local, when not running fiddler).
I have tried using BlogJet (commerical app) and it works as expected.
This was sniffed in fiddler, while using BlogJet
POST /miweb3/blogs/metablog.ashx HTTP/1.0
Content-Type: text/xml
Content-Length: 384
Connection: keep-alive
Host: 192.168.0.111:80
Accept: */*
User-Agent: Mozilla/3.0 (compatible; BlogJet)
Authorization: Basic Og==<?xml version="1.0" encoding
"UTF-8"?>
<methodCall>
<methodName>blogger.getUsersBlogs</methodName>
<params>
<param>
<value><string>26EC5542CB1819581008530D2AD129B48BBA415BD9</string></value>
</param>
<param>
<value><string>developer</string></value>
</param>
<param>
<value><string>XXXXXXXXX</string></value>
</param>
</params>
</methodCall>
Response Headers:
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 918
Content-Type: text/xml
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
Set-Cookie: ASP.NET_SessionId=x5vkiwjdrxsrbv45gnlmcl55; path=/; HttpOnly
X-Powered-By: ASP.NET
Date: Tue, 09 Dec 2008 00:18:54 GMT
Connection: keep-aliveTuesday, December 9, 2008 12:28 AM -
The only difference I really see between the two is that WLW "Host: jonb-xos-01" and BlogJet does "Host: 192.168.0.111:80".
When you configure your blog inside WLW try doing http://192.168.0.111 instead of http://jonb-xos-01
-Brandon Turner [MSFT]- Proposed as answer by Ron Wessels Wednesday, September 16, 2009 9:52 PM
Tuesday, December 9, 2008 1:01 AM -
Hi Brandon,
Thanks, it works using my LAN IP address, but not using 'localhost'.
I'm happy with that solution, but it does seem a little strange.
Thanks for your help.Friday, December 12, 2008 9:47 AM -
Just curious, what happens if you use 127.0.0.1?Friday, December 12, 2008 6:19 PMModerator