Windows 2016 WebSphere MQ Issues - c#

We have a WCF .Net installation that has been working for years connecting to WebSphere MQ. When we switched to Windows 2016, we have been encountering some connectivity issues. The threads from the WCF application will connect and stay connected for about 5min and then they die. We can see the connections via the MQ browser, but consistently around 5-6min they all die. Was working fine on Windows 2012. If it was permissions I wouldn't expect any connections.
Client: 8.0.0.10 (latest version doesn't seem to help)
Lots of communication exceptions.
Errors from WCF log:
WCFCH0306E: An error occurred while attempting to receive data from endpoint 'jms:/queue?destination=**Redacted server etc here**&persistent=2&initialContextFactory=com.ibm.mq.jms.Nojndi'
The operation could not be completed.
Review the linked exception for further details.
The method MQBACK failed.
A WebSphere MQ call failed.
Please see the linked exception for more information.</Message><StackTrace> at IBM.XMS.Client.Impl.XmsSessionImpl.Dispose(Boolean disposing)
at IBM.XMS.Client.Impl.XmsSessionImpl.Close()
at IBM.XMS.WCF.XmsSessionResource.RemoveReference(Boolean throwExceptions)
at IBM.XMS.WCF.XmsConnectionManager.Close(Boolean throwExceptions)
at IBM.XMS.WCF.XmsChannelListener`1.CloseInternal(Boolean throwExceptions)</StackTrace><ExceptionString>IBM.XMS.IllegalStateException: The method MQBACK failed.
A WebSphere MQ call failed.
Please see the linked exception for more information.
at IBM.XMS.Client.Impl.XmsSessionImpl.Dispose(Boolean disposing)
at IBM.XMS.Client.Impl.XmsSessionImpl.Close()
at IBM.XMS.WCF.XmsSessionResource.RemoveReference(Boolean throwExceptions)
at IBM.XMS.WCF.XmsConnectionManager.Close(Boolean throwExceptions)
at IBM.XMS.WCF.XmsChannelListener`1.CloseInternal(Boolean throwExceptions)
Linked Exception : CompCode: 2, Reason: 2009

Related

.NET/C# to MySql running on linux - exception on first command, but subsequent commands do work

Have a really crazy situation. I can't post specifics, so I'm just looking for general guidance. We have already opened a ticket with Oracle/MySql support. I'm just looking to see if anyone else has run into this situation or anything similar. Here is our scenario:
Windows 2012 R2 Server with .NET 4.7.1 running.
Simple Windows Forms .NET application.
We are trying to run a simple query against a Linux MySql Server. MySql is Enterprise Version 5.7.x.
On the first attempted connection, the Windows Forms app locks the UI, waits about 15 seconds, and then reports back that there is an error running the command. The error is shown below.
System.ApplicationException: An exception occurred on the following sql command:select * from tablename where compl_date >= '2019-12-17 04:44:34 PM' ---> MySql.Data.MySqlClient.MySqlException: Authentication to host 'ip address' for user 'userid' using method 'mysql_native_password' failed with message: Reading from the stream has failed. ---> MySql.Data.MySqlClient.MySqlException: Reading from the stream has failed. ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
When this error pops up, if I click on the "Continue" button, subsequent calls to the database work as intended (at about a 95% rate).
On the server, the mysqld error logs are shown below for the first call. Subsequent calls do work.
2019-12-16T22:06:29.554171Z 3496 [Warning] IP address 'client ip address' could not be resolved: Name or service not known
2019-12-16T22:06:50.188443Z 3496 [Note] Aborted connection 3496 to db: 'drupaldb' user: 'userid' host: 'ip address' (Got an error reading communication packets)
2019-12-17T02:53:17.832725Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 11355ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2019-12-17T03:25:18.200855Z 3527 [Note] Got an error reading communication packets
2019-12-17T03:25:37.167395Z 3528 [Note] Got packets out of order
2019-12-17T03:25:37.382512Z 3529 [Note] Got packets out of order
2019-12-17T03:25:47.688836Z 3530 [Note] Bad handshake
2019-12-17T14:26:33.619967Z 4803 [Note] Got timeout reading communication packets
2019-12-17T19:34:34.741441Z 4851 [Note] Got timeout reading communication packets
2019-12-17T19:47:47.595426Z 4853 [Note] Got timeout reading communication packets
2019-12-17T19:48:45.586357Z 4854 [Note] Got timeout reading communication packets
If you have some general ideas, let me know.
FYI, we have some other linux/mysql instances, and this runs just fine.
At this point, we think we have solved the problem, at least for the short term. Both server and client are sitting on a private network. We think that the database server is trying to send a certificate to the windows client. The windows client is also on this private network. We think the Windows Client is not accepting the ssl certificate and that this is causing the failure on the first connection attempt. By adding the option "SslMode=None", this seems to resolve the issue.
Blog post we found that helped us: https://blog.csdn.net/fancyf/article/details/78295964

.NET System.Security.Authentication.AuthenticationException

We are connecting to a specific website using a TLS connection. We are enforcing TLS 1.2 as the only allowed protocol in the client code. In about 99% of all cases connection setup is OK and shows no errors. However from time to time we receive the following exception:
System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The buffers supplied to a function was too small
--- End of inner exception stack trace ---
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
at Fw.Connections.Ssl.Private.ClientInstance.AuthenticateClientCallback(IAsyncResult result);
We have tested the remote server with SSL labs and we receive an A+ with no failures or problems reported, it's not a server under our control so the remote environment is not very well known.. We have tested the client code on Windows server 2012 (datacenter) and Windows7 clients. Both show the error from time to time. Is this a known bug in the .NET framework?

Issues connecting ibm mq client to a lower version

I am using 7x (7.5 mq client amqmdnet.dll) via .net and using MQPutMessageOptions and MQGetMessageOptions, this code works fine with mq 7.5 ibm client, however
IBM link
says 7x mq client will be backward compatible with 6x, when i try to connect, i get this error (am in a windows 7 64-bit OS).
System.TypeInitializationException: The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception. ---> System.TypeInitializationException: The type initializer for 'IBM.WMQ.CommonServices' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at IBM.WMQ.CommonServices..cctor()
--- End of inner exception stack trace ---
at IBM.WMQ.CommonServices.TraceEnabled()
at IBM.WMQ.MQBase..ctor()
at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)
at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)
at IBM.WMQ.MQQueueManager..cctor()
The line that throws the above error is :
MQQueueManager mqQMgr = new MQQueueManager("My queue manager" , "my channel name" ,"my connection name");
PS: the above line with the same params work fine in 7.5 mq client , but fails when a 6x (for ex: 6.0.2.5 mq client is installed, i have done 'typical' installation (full installation of 6x mq client).
Any idea how to make it work with 6.0.2.5?
Yes, that link is correct. What the link is saying if you have MQ v7.5 client installed, you will be able to work with MQ v6.0 queue manager running on a remote machine. But what you are trying appears to be different. You appear to have compiled the application with MQ v7.5 client but trying to run it on MQ v6.0.x client. This will not work.

NServiceBus exception and subscriber not able to read queue

I've been battling with this for a few days now with no luck. I've setup a NServiceBus project by following the guidelines on the getting started guide.
My MVC site successfully pushed messages onto my queue, but the subscriber never reads them off. No error messages until after about a minute, where the following pops up on the console:
2012-06-26 13:05:43,648 [1] FATAL NServiceBus.Hosting.GenericHost [(null)] <(null)> - Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Raven.Client.IDocumentStore)' on type 'RavenTimeoutPersistence'. ---> System.Net.WebException: The operation has timed out at System.Net.HttpWebRequest.GetResponse()
at Raven.Client.Connection.HttpJsonRequest.ReadStringInternal(Func`1 getRespo
nse)
at Raven.Client.Connection.HttpJsonRequest.ReadResponseString()
at Raven.Client.Connection.HttpJsonRequest.ReadResponseJson()
I can successfully connect to Raven via the web portal, and I can see my queues listed there - so am at a loss as to why NServiceBus cannot read the messages on the queue. I've reinstalled MSMQ, rebooted machine, re-installed NServiceBus - nothing seems to work.
Does anyone have any idea as to whats going wrong here?
This turned out to be another victim of Kaspersky Anti Virus. Even though firewall was set to "Allow all network connections", turning it off solved the issue.

Visual Studio 2010 - web deploy times out - what to do?

My MVC2 web project is deployed using the VS 2010 "web deploy" feature. It used to run fine but now it is timing out more often than not with this error message:
Web deployment task failed.((10/11/2010 1:01:59 a.m.) An error occurred
when the request was processed on the remote computer.)
(10/11/2010 1:01:59 a.m.) An error occurred when the request was processed on the remote
computer. The remote host closed the connection. The error code is 0x800704CD.
Searching for the error code 0x800704CD does not return anything helpful.
Is there a way to increase the timeout period, or should I be looking for an alternative method and forgetting about web deploy?
I haven't answered the timeout problem (could not see any problems on the server log). But I did find a workaround:
Physically copy the webdeploy.zip file to the web server.
In IIS select the website, right click and choose "Deploy - Import Application ..."
Select the zip file copied in #1
Forget the error message. That error message is the local one. You are not interested in this - the reason it fails is that the remote host closed the connection. What you want is to see the server side logs for the server side error message. Could be a timeout, but the server side should have more information. Start with the IIS logs and event logs.

Categories