locked
TransactionScope error: Communication with the underlying transaction manager has failed, works fine when reboot RRS feed

  • Question

  • This has been bothering us for a long time, every now and then it starts acting up and when we reboot the machine it works fine for a while. Checked the DTC Logs it just says "transaction being aborted" nothing else.

    Any idea what should we check ? here is the full stack trace and error message.

    System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The MSDTC transaction manager was unable to pull the transaction from the source transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02B) at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionShim& transactionShim) at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken) --- End of inner exception stack trace --- at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken) at System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTransaction tx) at System.Transactions.TransactionStateDelegatedBase.EnterState(InternalTransaction tx) at System.Transactions.EnlistableStates.Promote(InternalTransaction tx) at System.Transactions.Transaction.Promote() at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction) at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts) at System.Data.SqlClient.SqlInternalConnection.GetTransactionCookie(Transaction transaction, Byte[] whereAbouts) at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx) at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx) at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction) at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) at System.Data.Linq.Table`1.GetEnumerator() at System.Data.Linq.Table`1.System.Collections.Generic.IEnumerable<TEntity>.GetEnumerator() at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)


    Fahad

    Friday, July 27, 2012 7:13 PM

All replies

  • Hi Fahad,

    Looks like you have communication poblems between the two machines participating in the transaction.

    Have a look to the following article. 

    http://msdn.microsoft.com/en-us/library/aa561924(v=bts.20).aspx

    The first thing I would do is to check you have enabled the Allow Network transactions setting in both DTCs, also check that you can ping from one machinge to the other using the machine name not the IP.

    Let us know if you still don't manage to make ti work.


    Juan Casanova http://jawsofdotnet.blogspot.com - My .Net babling blog

    Monday, July 30, 2012 12:01 PM
  • Thanks for the reply. Outbound and Inbound Network DTC is allowed with no authentication required. Both machines can see each other by name.

    Please note that this issue is intermittent, happening between my dev machine and database server and when start happening, the only solution is to reboot my machine.


    Fahad

    Tuesday, July 31, 2012 1:37 PM
  • Have you checked if when the DTC start failing the DTC service is running? Maybe it has crashed and stopped, and so when you restart the machine it start working again.

    I would also check the DTC logs to see if you can see anything odd there. Have you checked the Event Log to see if the DTC service is logging something?


    Juan Casanova http://jawsofdotnet.blogspot.com - My .Net babling blog

    Wednesday, August 1, 2012 11:12 AM
  • I did not notice if DTC Service crashed. Next time this happens I will do that. I did check the Windows Event Log, nothing recorded.

    Fahad

    Wednesday, August 1, 2012 12:53 PM
  • Ok it failed today with same error. Event Log reported nothing. Service status says Running.

    Fahad

    Wednesday, August 15, 2012 7:57 PM
  • Hey Fahad,

    Is the MSDTC log saying something? You can find how to check it looking at the link I suggested before.


    Juan Casanova http://jawsofdotnet.blogspot.com - My .Net babling blog

    Friday, August 17, 2012 12:37 PM
  • Here is the output of DTCTester

    Executed: dtctester
    DSN:  DEVDB
    User Name: user
    Password: pass
    tablename= #dtc4043
    Creating Temp Table for Testing: #dtc4043
    Warning: No Columns in Result Set From Executing: 'create table #dtc4043 (ival i
    nt)'
    Initializing DTC
    Beginning DTC Transaction
    Enlisting Connection in Transaction
    Error:
    SQLSTATE=25S12,Native error=-2147168242,msg='[Microsoft][ODBC SQL Server Driver]
    Distributed transaction error'
    Error:
    SQLSTATE=24000,Native error=0,msg=[Microsoft][ODBC SQL Server Driver]Invalid cur
    sor state
    Typical Errors in DTC Output When
    a.  Firewall Has Ports Closed
    -OR-
    b.  Bad WINS/DNS entries
    -OR-
    c.  Misconfigured network
    -OR-
    d.  Misconfigured SQL Server machine that has multiple netcards.
    Aborting DTC Transaction
    Releasing DTC Interface Pointers
    Successfully Released pTransaction Pointer.


    Fahad

    Friday, August 31, 2012 12:12 AM
  • Here is DTCPing log

    DTCping log file: C:\temp\crap\2\JAXL17965W74024.log
    RPC server is ready
    Please Start Partner DTCping before pinging
    ++++++++++++Validating Remote Computer Name++++++++++++
    Please refer to following log file for details:
    	C:\temp\crap\2\JAXL17965W74024.log
    Invoking RPC method on SWJAX1D195
    Problem:fail to invoke remote RPC method
    Error(0x6D9) at dtcping.cpp @303
    -->RPC pinging exception
    -->1753(There are no more endpoints available from the endpoint mapper.)
    RPC test failed


    Fahad

    Friday, August 31, 2012 12:30 AM
  • Looks you are having problems with the RPC Endopoint Mapper. Can you have a look at the following link and see if it fixes your problem?

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

    Which version(s) of windows are you using?

    Also seems like a similar thread has been covered in the forums before:

    http://social.msdn.microsoft.com/Forums/en-GB/windowstransactionsprogramming/thread/4150f998-7071-4810-b3bf-4e8766c04ded

    Which also points to this other kb:

    http://support.microsoft.com/kb/250367/en-us

    Let me know if it works!


    Juan Casanova http://jawsofdotnet.blogspot.com - My .Net babling blog

    Friday, August 31, 2012 8:19 AM
  • I am using Windows 7 Pro. I will look at those links now.

    Thanks much


    Fahad

    Friday, August 31, 2012 4:36 PM