by Njål

Fixing HttpException 0x80004005 / COMException 0x80070001

When getting HttpContext.Current.Request.Params in a C# .NET IIS website – we got this error several times a day:

System.Web.HttpException (0x80004005): An error occurred while communicating with the remote host. The error code is 0x80070001. —> System.Runtime.InteropServices.COMException (0x80070001): Incorrect function. (Exception from HRESULT: 0x80070001)
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ReadEntityCoreSync(Byte[] buffer, Int32 offset, Int32 size)
at System.Web.HttpRequest.GetEntireRawContent()
at System.Web.HttpRequest.GetMultipartContent()
at System.Web.HttpRequest.FillInFormCollection()
at System.Web.HttpRequest.EnsureForm()
at System.Web.HttpRequest.get_Form()
at System.Web.HttpRequest.FillInParamsCollection()
at System.Web.HttpRequest.GetParams()

 

Turns out that this is related to various offloading done by the Network Card (NIC) – meaning that the NIC is doing stuff on its own which the OS/IIS doesn’t always like. Go to the network card properties – and disable these features:

  • Flow Control
  • Ipv4 Checksum Offload
  • Large Send Offload V2 (IPv4)
  • Large Send Offload V2 (IPv6)
  • TCP Checksum Offload (IPv4)
  • TCP Checksum Offload (IPv6)
  • UDP Checksum Offload (IPv4)
  • UDP Checksum Offload (IPv6)

 

image

 

Also – make sure you disable Power Management for the NIC.

image

 

 

by Njål

“Insufficient storage available” when updating Android Apps

A few days ago I started to get the error “Insufficient storage available” when updating Apps on my Samsung S4 – running Cyanogenmod 11. I Googled it – and was recommended me to install various “cleaning” Apps – and also make sure I wasn’t out of storage space – which I wasn’t.

image

 

What actually fixed the problem was to open File Manager (which comes with Cyanogenmod) – and deleting folders inside /data/app-lib/ for the Apps that refused to be updated. Often the Apps had several folders – indicating that an Update had beenattempted – but failed. Delete all folders related to the App.

 

image

 

The folder names might not correspond 100% with the name of the App. If you are unable to find the folder for an App – then simply go to Settings > Apps > XXXXX and look at the namespace (marked in red below). The folder will have this name as well.

image

 

by Njål

Intelligencia UrlRewriter – Ashx Sessions getting lost

image

When debugging a Windows Azure website I kept getting null Sessions for my ashx pages. They worked perfectly on  IISExpress, so I thought this was a Azure flaw. It turned out that it was IIS 7.5 + Url Rewriting (I’m using the Intelligencia module) that caused the problem.

 

 

After adding this to my Web.config everything worked like expected again – also in IIS 7.5

<configuration>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" >
     ...
     ...
  </system.Webserver>
</configuration>

Also – make sure your ashx code implements IRequiresSessionState

public class ApiHandler : IHttpHandler, IRequiresSessionState
{
}