Solved

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

Posted on 2010-09-20
13
2,216 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

3 Use Cases for Connected Systems

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need a starter for ETL protocol? 4 57
Write to file when application closes (by logoff) - VB.NET 1 32
SSRS troubles 4 51
How come this regular expression allows "e"? 14 38
While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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