ERROR NServiceBus.Transports.Msmq.MsmqDequeueStrategy - Error in receiving messages - c#

Event Viewer on my workstation have the following error log:
ERROR NServiceBus.Transports.Msmq.MsmqDequeueStrategy [(null)] - Error in receiving messages.
System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The Transaction Manager is not available. (Exception from HRESULT: 0x8004D01B)
at System.Transactions.Oletx.IDtcProxyShimFactory.ConnectToProxy(String nodeName, Guid resourceManagerIdentifier, IntPtr managedIdentifier, Boolean& nodeNameMatches, UInt32& whereaboutsSize, CoTaskMemHandle& whereaboutsBuffer, IResourceManagerShim& resourceManagerShim)
at System.Transactions.Oletx.DtcTransactionManager.Initialize()
--- End of inner exception stack trace ---
at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException)
at System.Transactions.Oletx.DtcTransactionManager.Initialize()
at System.Transactions.Oletx.DtcTransactionManager.get_ProxyShimFactory()
at System.Transactions.Oletx.OletxTransactionManager.CreateTransaction(TransactionOptions properties)
at System.Transactions.TransactionStatePromoted.EnterState(InternalTransaction tx)
--- End of inner exception stack trace ---
at System.Transactions.TransactionStateAborted.CheckForFinishedTransaction(InternalTransaction tx)
at System.Transactions.Transaction.Promote()
at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction)
at System.Transactions.TransactionInterop.GetDtcTransaction(Transaction transaction)
at System.Messaging.MessageQueue.StaleSafeReceiveMessage(UInt32 timeout, Int32 action, MQPROPS properties, NativeOverlapped* overlapped, ReceiveCallback receiveCallback, CursorHandle cursorHandle, IntPtr transaction)
at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
at System.Messaging.MessageQueue.Receive(TimeSpan timeout, MessageQueueTransactionType transactionType)
at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.TryReceiveMessage(Func`1 receive, Message& message) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Transports\Msmq\MsmqDequeueStrategy.cs:line 332
Facts:
Distributed Transaction Coordinator (DTC) Component Service ==> DTC Enabled
Distributed Transaction Coordinator (DTC) Service ==> Running (referenced to Answered Stack Oveflow Question)
Realtek Audio Universal Service ==> Disabled (as per reference in Fix for 0x8004d01b)
Can anyone recommend a direction on how to check/troubleshoot the cause of the issue?

After long ardous hours, the issue I encountered boils down to permission issue. The services involved in DTC which uses credentials of LocalSystem do not have enough permission and blocked by company-imposed policy implemented on the server.
Unfortunately, I only managed to find an alternative or workaround by using account that have enough permissions to operate and manage the services involved (including custom services).
#gnud - Thanks a lot for your inputs giving me a direction for investigation and that help me continue move forward on my investigation. I appreciate the help. Thanks.

Related

How to avoid PopReceiptMismatch errors in Azure durable functions

For my Azure functions application, a fan-out architecture with (sub-)orchestrators and a lot of activities running in parallel is required. Additionally, all these activities have to interact with an Azure blob storage account. When dealing with this high degree of parallelization, I often run into runtime errors like these:
[2023-02-07T14:11:36.859Z] 4c6a215f040141aaaa995f9cfbf1a234:10: An error occurred while processing message [TaskScheduled#46]: DurableTask.AzureStorage.Storage.DurableTaskStorageException: The specified pop receipt did not match the pop receipt for a dequeued message.[2023-02-07T14:11:36.860Z] ---> Microsoft.WindowsAzure.Storage.StorageException: The specified pop receipt did not match the pop receipt for a dequeued message.
[2023-02-07T14:11:36.861Z] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteAsyncInternal[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext, CancellationToken token)[2023-02-07T14:11:36.874Z] at DurableTask.AzureStorage.Storage.AzureStorageClient.WrapFunctionWithReturnType(Func`3 storageRequest, OperationContext context, CancellationToken cancellationToken) in /_/src/DurableTask.AzureStorage/Storage/AzureStorageClient.cs:line 156[2023-02-07T14:11:36.875Z] at DurableTask.AzureStorage.TimeoutHandler.ExecuteWithTimeout[T](String operationName, String account, AzureStorageOrchestrationServiceSettings settings, Func`3 operation, AzureStorageOrchestrationServiceStats stats, String clientRequestId)[2023-02-07T14:11:36.876Z] at DurableTask.AzureStorage.Storage.AzureStorageClient.MakeStorageRequest[T](Func`3 storageRequest, String accountName, String operationName, String clientRequestId, Boolean force)
[2023-02-07T14:11:36.877Z] Request Information
[2023-02-07T14:11:36.879Z] RequestID:7db00ba3-1e70-42fc-84f5-f6dfb9ec630a
[2023-02-07T14:11:36.880Z] RequestDate:Tue, 07 Feb 2023 15:11:36 GMT
[2023-02-07T14:11:36.896Z] StatusMessage:The specified pop receipt did not match the pop receipt for a dequeued message.
[2023-02-07T14:11:36.897Z] ErrorCode:PopReceiptMismatch
[2023-02-07T14:11:36.898Z] ErrorMessage:The specified pop receipt did not match the pop receipt for a dequeued message.
RequestId:7db00ba3-1e70-42fc-84f5-f6dfb9ec630a
Time:2023-02-07T14:11:36.137Z
[2023-02-07T14:11:36.901Z] --- End of inner exception stack trace ---
These neither trigger try-catch breakpoints nor stop code execution, but are really annoying and cause the orchestrators to restart which leads to data corruption down the road. Is there a proper way of fixing this?
When function projects get created in Visual Studio, the AzureWebJobsStorage value in the local.settings.json file is set to true by default. Configuring Azure functions to use a real storage account for orchestrators can eliminate concurrency issues and faulty state management. Simply replace the value with the connection string of your own storage:
{
...
"Values": {
"AzureWebJobsStorage": "[YOUR CONNECTION STRING HERE]",
...
}
}

System.IO.IOException: Connection timed out In Mailkit

I used MailKit.Net.Imap to read email in my mail box.
Sometimes I get an exception like that I shared below
System.IO.IOException: Connection timed out ---> System.Net.Sockets.SocketException (110): Connection timed out at MailKit.Net.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count) --- End of inner exception stack trace ---
Is there any suggistion to solve this problem?
ImapClient client;
client = new ImapClient();
client.Timeout= (int)TimeSpan.FromMinutes(1).TotalMilliseconds;
Also, I can use timeout property of Imap, this can help me to solve this problem?
You have 2 options:
Increase the timeout using the ImapClient.Timeout property. (That said, 1 minute is less than the default timeout which is 2 minutes)
As Max points out in the comments below, properly handle exceptions and retry (which often will require reconnecting the ImapClient).

How can I fix this timeout exception in Azure redis cache?

We have a web application which uses Microsoft.Web.Redis.RedisSessionStateProvider as the session state provider. We've had no problems with this until recently when suddenly the application is reporting a large number of exceptions as detailed below.
The message suggests some kind of timeout. But I've no idea how to resolve this. The application is an instance of Kentico CMS and we haven't customised its session caching mechanism in any way.
Main exception:
Message:
Exception of type 'System.Web.HttpException' was thrown.
Stack Trace:
at System.Web.HttpAsyncResult.End()
at System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar)
Inner exception:
Message:
Timeout performing EVAL, inst: 1, mgr: Inactive, err: never, queue: 0, qu: 0, qs: 0, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=3,Free=32764,Min=2,Max=32767), clientName: KSCOMAZUATWEB2
Stack Trace:
at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line 1927
at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\RedisBase.cs:line 80
at StackExchange.Redis.RedisDatabase.ScriptEvaluate(String script, RedisKey[] keys, RedisValue[] values, CommandFlags flags) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\RedisDatabase.cs:line 866
at Microsoft.Web.Redis.StackExchangeClientConnection.<>c__DisplayClass4.<Eval>b__3() in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\Shared\StackExchangeClientConnection.cs:line 113
at Microsoft.Web.Redis.StackExchangeClientConnection.RetryForScriptNotFound(Func`1 redisOperation) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\Shared\StackExchangeClientConnection.cs:line 129
at Microsoft.Web.Redis.StackExchangeClientConnection.RetryLogic(Func`1 redisOperation) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\Shared\StackExchangeClientConnection.cs:line 155
at Microsoft.Web.Redis.StackExchangeClientConnection.Eval(String script, String[] keyArgs, Object[] valueArgs) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\Shared\StackExchangeClientConnection.cs:line 113
at Microsoft.Web.Redis.RedisConnectionWrapper.TryTakeWriteLockAndGetData(DateTime lockTime, Int32 lockTimeout, Object& lockId, ISessionStateItemCollection& data, Int32& sessionTimeout) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\RedisSessionStateProvider\RedisConnectionWrapper.cs:line 182
at Microsoft.Web.Redis.RedisSessionStateProvider.GetItemFromSessionStore(Boolean isWriteLockRequired, HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\RedisSessionStateProvider\RedisSessionStateProvider.cs:line 272
at Microsoft.Web.Redis.RedisSessionStateProvider.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\RedisSessionStateProvider\RedisSessionStateProvider.cs:line 190
at System.Web.SessionState.SessionStateModule.GetSessionStateItem()
at System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object state)
After experiencing the same issue and having read various posts on setting min & max thread values etc, it transpired that the issue was with the subscription tier.
C1 basic (£35/GBP mth) boasts a 1gb cache, 1000 concurrent connections which are exactly the same headline figures as the C1 Standard tier (£95GBP/Mth).
It's a natural assumption that when you only require a few MB of cache and have only 50 concurrent sessions active at any point, that the C! basic would be adequate, if not overkill.
The difference seems to be that C1 Basic works, if you have 10 or less concurrent users on your website.
In fairness, it is mentioned in the fine print that the basic is only suitable for development and testing environments.
I was just working through this on a client site and what helped me was to add this to the connection string of your provider:
throwOnError="true" retryTimeoutInMilliseconds="500"
What I learned is sometimes there is a latency issue and if it doesn't resolve fast enough the default is to just "quit". So adding this allows it to continue to retry.
Your string might look like this
<add name="MySessionStateStore" throwOnError="true" retryTimeoutInMilliseconds="500" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="mysite-prod.redis.cache.windows.net" accessKey="mykey" ssl="true" />

XMS - how to restore connection to WebSphere SIBus after network outage

I'm connecting to a JMS queue. The queue is hosted by WebSphere Application Server (version 8.0.0.5), using SIBus.
I have a simple program to reproduce some problematic behavior, it is written in C# and uses XMS (IBM's .NET API) to connect to the queue. Note: I obtained the IBM.XMS dlls from here: MQC71: WebSphere MQ V7.1 Clients
The scenario is this:
run the program (use an empty queue, so it sits waiting on a blocking Receive call)
disconnect network (unplug ethernet)
after a few minutes, the Receive call throws an exception
the program attempts to connect anew
this fails due to the network being down
...let it loop a bit to verify this error keeps occurring
restore the network (plug in ethernet)
the same error continues to occur (verified with WireShark that no network traffic occurs during the connectionFactory.CreateConnection() call)
So, the question is: why does the CreateConnection() call do nothing (does not send any packets) but fail?
using IBM.XMS;
using System;
namespace SimpleTest
{
class Program
{
static void Main(string[] args)
{
while (true)
{
try
{
string queueURI = "queue://your.details.GoHereDearReader";
string providerEndpoint = "1.2.3.4:1234";
string targetTransportChain = "InboundBasicMessaging";
string busName = "some_bus_name";
XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WPM);
IConnectionFactory connectionFactory = factoryFactory.CreateConnectionFactory();
connectionFactory.SetStringProperty(XMSC.WPM_PROVIDER_ENDPOINTS, providerEndpoint);
connectionFactory.SetStringProperty(XMSC.WPM_TARGET_TRANSPORT_CHAIN, targetTransportChain);
connectionFactory.SetStringProperty(XMSC.WPM_BUS_NAME, busName);
Log("Connecting...");
using (var connection = connectionFactory.CreateConnection())
{
using (var session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge))
{
using (var destination = session.CreateQueue(queueURI))
{
destination.SetIntProperty(XMSC.DELIVERY_MODE, XMSC.DELIVERY_NOT_PERSISTENT);
connection.Start();
using (IMessageConsumer consumer = session.CreateConsumer(destination))
{
Log("Receiving...");
IMessage recvMsg = consumer.Receive();
Log("recvMsg:" + recvMsg);
}
}
}
}
}
catch (Exception e)
{
Log(e.ToString());
}
Log("Sleeping some before consuming more...");
System.Threading.Thread.Sleep(10 * 1000);
}//while
}//Main
static void Log(string text)
{
Console.WriteLine(DateTime.UtcNow.ToString("HH:mm:ss.fff") + "-------------------------- " + text);
}
}
}
And some output:
16:38:19.483-------------------------- Connecting...
16:38:19.936-------------------------- Receiving...
16:43:31.952-------------------------- IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0022
EXCEPTION_RECEIVED_CWSIA0022.explanation
EXCEPTION_RECEIVED_CWSIA0022.useraction
at IBM.XMS.Impl.Connection.Dispose(Boolean disposing)
at IBM.XMS.Impl.Connection.Dispose()
at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 43
Linked Exception : IBM.XMS.SIB.JFAP.JFapConversationClosedException: Exception of type 'IBM.XMS.SIB.JFAP.JFapConversationClosedException' was thrown.
at IBM.XMS.SIB.JFAP.ConversationImpl.Send(IByteBuffer[] data, JFAPSegmentType segmentType, UInt16 requestNumber, IoPriority priority, Boolean pooledBufferHint, IReceiveListener recvListener, ISendListener sendListener, Object state)
at IBM.XMS.SIB.JFAP.ConversationImpl.RequestReplyExchange(IByteBuffer[] data, JFAPSegmentType segmentType, UInt16 requestNumber, IoPriority priority, Boolean pooledBufferHint)
at IBM.XMS.SIB.JFAP.ConversationImpl.RequestReplyExchange(IByteBuffer data, JFAPSegmentType segmentType, UInt16 requestNumber, IoPriority priority, Boolean pooledBufferHint)
at IBM.XMS.SIB.Comms.Client.JFAPCommunicator.RequestReplyExchange(IByteBuffer data, JFAPSegmentType sendSegType, MessagePriority priority, Boolean canPoolOnReceive)
at IBM.XMS.SIB.Comms.Client.ConnectionProxy.Close()
at IBM.XMS.Impl.Connection.Dispose(Boolean disposing)
16:43:31.952-------------------------- Sleeping some before consuming more...
16:43:41.967-------------------------- Connecting...
Exception : System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
FFDC to xmsffdc8416_2013.03.08T10.43.41.967444.txt
Exception : IBM.XMS.Formats.MFP.MessageEncodeFailedException: Exception of type 'IBM.XMS.Formats.MFP.MessageEncodeFailedException' was thrown. ---> System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
--- End of inner exception stack trace ---
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
at IBM.XMS.Formats.MFP.SIB.TrmFirstContactMessageImpl.Encode(Object connection)
at IBM.XMS.SIB.Trm.ClientBootstrapHandler.Connect(IClientConnection clientConnection)
FFDC to xmsffdc8416_2013.03.08T10.43.41.983044.txt
16:43:41.983-------------------------- IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0241
EXCEPTION_RECEIVED_CWSIA0241.explanation
EXCEPTION_RECEIVED_CWSIA0241.useraction
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection()
at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 26
Linked Exception : IBM.XMS.Core.SIResourceException: CWSIT0006E: It is not possible to connect to bus your_bus_name_here because the following bootstrap servers could not be contacted 1.2.3.4:1234:BootstrapBasicMessaging and the following bootstrap servers returned an error condition . See previous messages for the reason for each bootstrap server failure.
The client cannot connect to the bus. This situation may be due to configuration problems, network problems or it may be that none of the required bootstrap servers or messaging engines are currently available.
Ensure that the network is working correctly and that the required bootstrap servers and messaging engines are available. ---> IBM.XMS.Core.SIConnectionLostException: Exception of type 'IBM.XMS.Core.SIConnectionLostException' was thrown.
at IBM.XMS.SIB.Comms.Client.ClientSideConnection.Connect(ConnectionProperties cp, IClientComponentHandshake cch, SICoreConnectionProperties siProps)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
--- End of inner exception stack trace ---
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.CreateConnection(Credentials credentials, SICoreConnectionProperties connectionProperties)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactory.CreateConnection(String username, String password, SICoreConnectionProperties connectionProperties)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
16:43:41.983-------------------------- Sleeping some before consuming more...
16:43:51.998-------------------------- Connecting...
Exception : System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
FFDC to xmsffdc8416_2013.03.08T10.43.51.998262.txt
Exception : IBM.XMS.Formats.MFP.MessageEncodeFailedException: Exception of type 'IBM.XMS.Formats.MFP.MessageEncodeFailedException' was thrown. ---> System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
--- End of inner exception stack trace ---
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
at IBM.XMS.Formats.MFP.SIB.TrmFirstContactMessageImpl.Encode(Object connection)
at IBM.XMS.SIB.Trm.ClientBootstrapHandler.Connect(IClientConnection clientConnection)
FFDC to xmsffdc8416_2013.03.08T10.43.51.998262.txt
16:43:51.998-------------------------- IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0241
EXCEPTION_RECEIVED_CWSIA0241.explanation
EXCEPTION_RECEIVED_CWSIA0241.useraction
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection()
at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 26
Linked Exception : IBM.XMS.Core.SIResourceException: CWSIT0006E: It is not possible to connect to bus your_bus_name_here because the following bootstrap servers could not be contacted 1.2.3.4:1234:BootstrapBasicMessaging and the following bootstrap servers returned an error condition . See previous messages for the reason for each bootstrap server failure.
The client cannot connect to the bus. This situation may be due to configuration problems, network problems or it may be that none of the required bootstrap servers or messaging engines are currently available.
Ensure that the network is working correctly and that the required bootstrap servers and messaging engines are available. ---> IBM.XMS.Core.SIConnectionLostException: Exception of type 'IBM.XMS.Core.SIConnectionLostException' was thrown.
at IBM.XMS.SIB.Comms.Client.ClientSideConnection.Connect(ConnectionProperties cp, IClientComponentHandshake cch, SICoreConnectionProperties siProps)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
--- End of inner exception stack trace ---
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.CreateConnection(Credentials credentials, SICoreConnectionProperties connectionProperties)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactory.CreateConnection(String username, String password, SICoreConnectionProperties connectionProperties)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
16:43:51.998-------------------------- Sleeping some before consuming more...
16:44:02.013-------------------------- Connecting...
Exception : System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
FFDC to xmsffdc8416_2013.03.08T10.44.02.013479.txt
Exception : IBM.XMS.Formats.MFP.MessageEncodeFailedException: Exception of type 'IBM.XMS.Formats.MFP.MessageEncodeFailedException' was thrown. ---> System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
--- End of inner exception stack trace ---
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
at IBM.XMS.Formats.MFP.SIB.TrmFirstContactMessageImpl.Encode(Object connection)
at IBM.XMS.SIB.Trm.ClientBootstrapHandler.Connect(IClientConnection clientConnection)
FFDC to xmsffdc8416_2013.03.08T10.44.02.013479.txt
16:44:02.013-------------------------- IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0241
EXCEPTION_RECEIVED_CWSIA0241.explanation
EXCEPTION_RECEIVED_CWSIA0241.useraction
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection()
at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 26
Linked Exception : IBM.XMS.Core.SIResourceException: CWSIT0006E: It is not possible to connect to bus your_bus_name_here because the following bootstrap servers could not be contacted 1.2.3.4:1234:BootstrapBasicMessaging and the following bootstrap servers returned an error condition . See previous messages for the reason for each bootstrap server failure.
The client cannot connect to the bus. This situation may be due to configuration problems, network problems or it may be that none of the required bootstrap servers or messaging engines are currently available.
Ensure that the network is working correctly and that the required bootstrap servers and messaging engines are available. ---> IBM.XMS.Core.SIConnectionLostException: Exception of type 'IBM.XMS.Core.SIConnectionLostException' was thrown.
at IBM.XMS.SIB.Comms.Client.ClientSideConnection.Connect(ConnectionProperties cp, IClientComponentHandshake cch, SICoreConnectionProperties siProps)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
--- End of inner exception stack trace ---
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.CreateConnection(Credentials credentials, SICoreConnectionProperties connectionProperties)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactory.CreateConnection(String username, String password, SICoreConnectionProperties connectionProperties)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
16:44:02.013-------------------------- Sleeping some before consuming more...
Note that in the above output I unplugged the network shortly after "Receiving..." and plugged it in again at 16:43:52, but the errors continued after that until I killed the program.
It reads like the ConnectionFactory does not reset it's state properly when the network becomes available again.
I have scoured the reference manual for any hint of a reset function on the factory - but havn't found one.
I would try this however: Move the GetInstance(...) and createConnectionFactory() out of the loop, as well as the SetStringProperty() lines.
If that doesn't work I cannot see why your client would not work.
Have you considered if this is a problem with the server? Which ethernet cable did you unplug? the one connected to the client or the server? If it was the server, does the same problem occur when you unplug the client cable?
If you restart the program, will it work then?
I know this is an old post, but maybe it will be still helpful.
You receive this error after you created 65.535 connections. It doesn't matter if you close the connection / dispose the object.
I see the following solutions:
1.) You can either create a connection once and reuse the connection for all your operations on the queue, until the connection breaks. Then you have to do a reconnect. (yes that's bad and against the common patterns. I wouldn't advice to do this)
2.) There is a bugfix for the version 8.0.0.6 available. EDIT: APAR #(IJ01244)
I don't know yet when it will included into future releases.
I guess you can contact the IBM support and refer to this PMR ID to receive an updated version of the IBM.XMS.SIB.dll
Hope this helps.

InstanceOwnerException when running Workflow Foundation 4

I am running Workflow 4 activities, and using SQL Durable Instancing to persist the Workflow when it's suspended. I am intermittently getting an InstanceOwnerException, which is remedied by recreating the instance store. Is there any way of avoiding this exception in the first place?
System.OperationCanceledException: An error processing the current work item has caused the workflow to abort. See the inner exception for details. ---> System.Runtime.DurableInstancing.InstanceOwnerException: The execution of an InstancePersistenceCommand was interrupted because the instance owner registration for owner ID '55413a1f-0e3f-4a0f-b2b0-54c121aa0c52' has become invalid. This error indicates that the in-memory copy of all instances locked by this owner have become stale and should be discarded, along with the InstanceHandles. Typically, this error is best handled by restarting the host.
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.Runtime.DurableInstancing.InstanceStore.EndExecute(IAsyncResult result)
at System.Activities.WorkflowApplication.UnloadOrPersistAsyncResult.OnPersisted(IAsyncResult result)
at System.Runtime.AsyncResult.SyncContinue(IAsyncResult result)
at System.Activities.WorkflowApplication.UnloadOrPersistAsyncResult.Persist()
at System.Activities.WorkflowApplication.UnloadOrPersistAsyncResult.CollectAndMap()
at System.Activities.WorkflowApplication.UnloadOrPersistAsyncResult.Track()
at System.Activities.WorkflowApplication.UnloadOrPersistAsyncResult.InitializeProvider()
at System.Activities.WorkflowApplication.UnloadOrPersistAsyncResult..ctor(WorkflowApplication instance, TimeSpan timeout, PersistenceOperation operation, Boolean isWorkflowThread, Boolean isInternalPersist, AsyncCallback callback, Object state)
at System.Activities.WorkflowApplication.BeginInternalPersist(PersistenceOperation operation, TimeSpan timeout, Boolean isInternalPersist, AsyncCallback callback, Object state)
at System.Activities.WorkflowApplication.OnBeginPersist(AsyncCallback callback, Object state)
at System.Activities.Runtime.ActivityExecutor.PersistenceWaiter.PersistWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
--- End of inner exception stack trace ---
The code is running on Azure, using SQL Azure to persist the Workflows. There are roles that are accessing the same instance store.
This actually turned out to be down to attempting to resume a workflow after it had already finished.

Categories

Resources