Solved

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

Posted on 2010-09-20
13
2,150 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now