Monday, March 5, 2012

eConnect 2010 / 2013 Error: There was an error writing to the pipe: The pipe is being closed

By Steve Endow

When you run an eConnect 2010 or 2013 integration, it may display this error when the code calls CreateTransactionEntity:

There was an error writing to the pipe: The pipe is being closed.

I recall seeing this a while ago in some testing, but I didn't think much of it at the time.  Well, it cropped up again, this time on both my development server and the client's workstation for a GL JE integration.

The quick fix to this is to close the integration and relaunch it, and it will then import fine.

Fortunately, there is a publicly accessible KB article available that describes the issue and the resolution.

http://support.microsoft.com/kb/2539263

I'm not a WCF expert, but it seems odd that this is happening since my code is re-instantiating the eConnect objects each time it is run, so it isn't as if my code is somehow hanging on to an idle instance of eConnect--at least not explicitly.  What is also odd is that I've developed dozens of integrations, but haven't had to deal with this error before.  I'm pretty sure this isn't the first customer that has left the integration open for more than 10 minutes, so it could be that the error does not occur for some integrations.

Fortunately, the fix described in the KB article is very simple, and should resolve the issue permanently. 

Locate the eConnect service config file in the eConnect service directory:

GP 2010:  C:\Program Files\Microsoft Dynamics\eConnect 11.0\Service

or

GP 2013:  C:\Program Files\Microsoft Dynamics\eConnect 12.0\Service


And then add the receiveTimeout="infinite" parameter to the config file, save the file, and then restart the eConnect service.

<binding name="eConnectNamedPipeConfig" closeTimeout="00:10:00" sendTimeout="00:02:00" receiveTimeout ="infinite" transferMode="Buffered" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">


That should resolve the "pipe is being closed" issue.


Steve Endow is a Dynamics GP Certified Trainer and Dynamics GP Certified IT Professional in Los Angeles.  He is also the owner of Precipio Services, which provides Dynamics GP integrations, customizations, and automation solutions.

You can also find him on Google+ and Twitter


No comments: