Solved

WCF error, “An existing connection was forcibly closed by the remote host.”

Posted on 2010-09-20
13
2,260 Views
Last Modified: 2012-05-10
I have a air of applications, both developed in house, that communicate using WCF tcp binding.  I am receiving the following errors, but I cannot determine why.  Can anyone suggest a reaosn why I might get this problem?

I have attached a zip file that contains a svclog. To open please rename the extension from log back to svclog. (Cannot upload svclog files, even in a zipped file).

Thanks

Server-App-tracelog.svclog.zip
0
Comment
Question by:townsma
  • 7
  • 5
13 Comments
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 33714725
this can happen if there is an exception in your piece of code. can you post the server side code ?
0
 
LVL 6

Author Comment

by:townsma
ID: 33714859
Which particular piece of code do you want to see?  The code is split amonst many classes and interfaces.
0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 33714894
when are you getting this error ? if you are trying to invoke some method when you encounter this error then please post that...
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
LVL 6

Author Comment

by:townsma
ID: 33714994
That is the problem, the error message is too generic, so I cannot pin down an individual method.  I am currently setting up two computers with VS2008 on the them so I can debug both apps at the same time to see where the first exception is thrown..  

Currently the only indication of an error is the WCF trace, and the fact the database is not updated.  There ar eno .Net exceptions being thrown that I can find, and nothing is being written to the Event Log.
0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 33715263
another possible error the data you  are sending/receving is going above the limits mentioned in the behaviour. Try setting it to max and see. See sample config below

<basicHttpBinding>
				<binding name="myBindingConfiguration" maxBufferSize="2147483647"
          maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
					<security mode="TransportCredentialOnly">
						<transport clientCredentialType="Ntlm" />
					</security>
					<readerQuotas
             maxArrayLength="2147483647"
             maxBytesPerRead="2147483647"
             maxDepth="2147483647"
             maxNameTableCharCount="2147483647"
             maxStringContentLength="2147483647" />
				</binding>
</basicHttpBinding>

Open in new window

0
 
LVL 6

Author Comment

by:townsma
ID: 33715343
We currently have the limits set to max, in the client and server, and have the security set to none.
0
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 250 total points
ID: 33715372
The in that case your service is throwing an unhandled exception.. Run your service under a debugger and break on exceptions...which would tell you where the exception is or add a service behaviour to send the exception to the client

[ServiceBehavior(
        IncludeExceptionDetailInFaults = true    

  )]
0
 
LVL 6

Author Comment

by:townsma
ID: 33715665
I added the behaviour two days ago, but made no difference to the reports I received.

I have also been running the server and client in a debug session, but as I mentioned earleir, no exceptions are being thrown that I can find.

0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 33731908
I'm being a bit silly here and you may know this already - The fault details will be in the inner exceptions and may not be necessarily in the first level.. Have you verified this ??
0
 
LVL 6

Author Comment

by:townsma
ID: 33731947
The error message in the title is from the inner exception.

Thanks for the thought though.
0
 
LVL 9

Assisted Solution

by:Orcbighter
Orcbighter earned 250 total points
ID: 33777659
The 'connection was forcibly closed' error message is telling you the server-side shut down the connection.
On viewing your log file, the exception states that the connection was closed because of either a problem with the message you sent, a timeout occurred on the remote host.
If you examine the log you will see that E2ETraceEvent ID=131075 logs the error. It occurred just after the ResortManager executed a 'listen'. The exception was thrown because...
"The TransportManager failed to listen on the supplied URI using  the NetTcpPortSharing service: failed to start the service because it is  disabled."

This is where you need to look. Check this service is running.

0
 
LVL 6

Author Comment

by:townsma
ID: 33795560
Hi Everyone,

Many thanks for all you assistance.  After much work, I have finally pinned down the failure.  In reality it had nothing to do with WCF, which makes it very strange that WCF was the only part of the program throwing any errors.  

The problem turned out the be OR/M database update command that was failing.  The update was being called remotely, so WCF was throwing the error.  But it is strange that that the SQL and ORM etc. did not throw any errors.

So to every, again thanks for your help.

I will share the points between all the contributors, as all of you advice ultimately led me in the right direction.
0
 
LVL 6

Author Closing Comment

by:townsma
ID: 33795576
Hi Everyone,

Many thanks for all you assistance.  After much work, I have finally pinned down the failure.  In reality it had nothing to do with WCF, which makes it very strange that WCF was the only part of the program throwing any errors.  

The problem turned out the be OR/M database update command that was failing.  The update was being called remotely, so WCF was throwing the error.  But it is strange that that the SQL and ORM etc. did not throw any errors.

So to every, again thanks for your help.

I will share the points between all the contributors, as all of you advice ultimately led me in the right direction.
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question