31

I'm getting this error on my web service:

An error occurred while communicating with the remote host. The error code is 0x80070001

The weird thing is that the CPU and memory usage on the server is not high.

The detailed error message:

Error Message:

An error occurred while communicating with the remote host. The error code is 0x80070001.

Stack Trace:

at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)<br />
at System.Web.Hosting.IIS7WorkerRequest.ReadEntityCoreSync(Byte[] buffer, Int32 offset, Int32 size)<br />
at System.Web.Hosting.IIS7WorkerRequest.ReadEntityBody(Byte[] buffer, Int32 size) <br />
at System.Web.HttpRequest.GetEntireRawContent()<br />
at System.Web.HttpRequest.get_InputStream()<br />
at Service.Upload() in c:\inetpub\path\Service.aspx.cs:line 213

After Google Search:

Thread on Microsoft Forums and I disable the offloading of network card and nothing change :(

Question on Stack OverFlow No answers :(

How can I fix this problem?

More information

Inner Exception Message: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))

Very Important

This is only happened with a web application, but if I used a web site, nothing happened (no error).

And after a lot of research I think this error is caused by the web.config file.

Community
  • 1
  • 1
Hiyasat
  • 8,601
  • 7
  • 33
  • 59
  • 2
    There is no doubt a deeper reason, but it looks like the client disconnects before the request has been completely read by the server. Did you check that the clients aren't crashing when you get this error? – Joachim Isaksson Aug 25 '12 at 11:17
  • Thanks Joachim Isaksson, client is not getting any response because the server is state that is not responding to any request even from the web console – Hiyasat Aug 25 '12 at 11:22
  • Could you check the solution provided in this thread and see if it works for you? http://stackoverflow.com/questions/7825127/system-runtime-interopservices-comexception-incorrect-function-exception-from this link take you directly to the (potential) solution cribbed off the previous link http://social.technet.microsoft.com/Forums/en/winserverhyperv/thread/698e2b2b-af59-4848-b041-4fbb11c5bb6b – Luke Baughan Aug 31 '12 at 16:01
  • thanks bUKaneer, but as i say and provide this link in Microsoft support and i disable the offloading of network card and nothing change :( – Hiyasat Sep 03 '12 at 06:36
  • It's likely to be a permissions issue with an interop library. Do you have the rest of the detail for the Inner Exception, it'll probably say which library and therefore what you need additional permissions for. – joocer Sep 03 '12 at 11:21
  • Thanks joocer, what other data you want from the inner exception, because i am using logger to write the exception, so please tell me what data you want? – Hiyasat Sep 03 '12 at 13:00
  • Which class threw the inner exception would be a good start to working out which class needs additional permissions. – joocer Sep 03 '12 at 20:31
  • Maybe this : http://social.msdn.microsoft.com/Forums/en/wcf/thread/8703945e-6c76-49a3-9999-7045b6645486 and http://forums.asp.net/t/1526444.aspx/1. – JoeBilly Sep 04 '12 at 08:49
  • Which version of .NET are you runing (including service packs)? Which version of Windows are you using? Does the description in this hotfix http://support.microsoft.com/kb/977453 apply to your problem? – Martin Odhelius Sep 04 '12 at 14:53
  • A bit more of context is required here. As @joocer says it has all the looks of an interop issue. On the other hand the failure to read the inputstream could mean a broken connection. What's the basic architecture here? web client->IIS->Your service? Is there an ISAPI or HttpModule in between? – Carlos Grappa Sep 04 '12 at 18:03
  • Can you post some of your code? This isn't enough to go on to help figure out whats going on. Perhaps a sample app demonstrating the issue? – devshorts Sep 04 '12 at 21:21
  • Definitely need more information on your hosting setup. Is this a debug environment? i.e. Are you running your application under the Visual Studio Hosting Process? If so, the FIRST thing I would try is running it properly under IIS (the deployment scenario). – Adam Sep 04 '12 at 22:38
  • Thanks All for you comments, my environment is .net 4, IIS 7, Windows server 2008 R2, Hosting in Amazon, but i use load balancer from amazon too, and no there is no debug environment, @Martin Odhelius i'm not having the problem in this hot fix :( – Hiyasat Sep 05 '12 at 06:20
  • which version of IIS are you using – Elham Kohestani Feb 06 '18 at 17:30

3 Answers3

1

I receive this error on my site also. I've determined the agent that generally causes this problem and it is a webcrawler like the one used by Google to index pages.

Anyway, I believe the answer is either Cause 1 or Cause 2:

Cause 1

This problem occurs because the client makes an HTTP request by using an HTTP method that does not comply with the HTTP specifications.

Cause 2

This problem occurs because a client makes an HTTP request by sending the POST method to a page that is configured to be handled by the StaticFile handler. For example, a client sends the POST method to a static HTML page. However, pages that are configured for the StaticFile handler do not support the POST method.

Check out the microsoft link for more explanation and possible resolution: http://support.microsoft.com/kb/942051

raddevus
  • 8,142
  • 7
  • 66
  • 87
0

Close any object which is not in use (close when you are done using an object and initialize everything to null until you NEED to use it.)

-1

This is because of an internal memory leakage in your code. As a result, it is not able to create a new object in memory.

nbrooks
  • 18,126
  • 5
  • 54
  • 66
Pushpendra
  • 548
  • 3
  • 10
  • Thanks Pushpendra for your answer, but if i have memory leak as you say the it will reflect on server memory and there is nothing with the memory on the server, so i'am sure this is not the problem, -1 – Hiyasat Sep 11 '12 at 07:52
  • Could you please check two thing.1. when this error come then it is connected mode. 2. The request is trying to read then it is readable. – Pushpendra Sep 16 '12 at 18:23