ibm-messaging / kafka-connect-mq-sink

This repository contains a Kafka Connect sink connector for copying data from Apache Kafka into IBM MQ.
Apache License 2.0
35 stars 43 forks source link

Connection with SSL issue #9

Closed ty17383 closed 6 years ago

ty17383 commented 6 years ago

Hello,

I am facing an issue connecting to an mq cluster that uses SSL for authentication. I am able to connect to MQ using a separate app and what I think are the exact same properties. The only difference I can find is that the other app uses an IBM connection factory(com.ibm.mq.jms.MQXAConnectionFactory). The error which I am receiving is below. I am fairly positive that the username and password are correct and that the ssl cert is making a successful handshake. I think maybe after the SSL handshake is when the error occurs? Here is the relevant portion of the error I am receiving:

[2018-10-18 15:35:47,093] INFO Connection to MQ could not be established (com.ibm.eventstreams.connect.mqsink.JMSWriter:170) [2018-10-18 15:35:47,093] ERROR JMS exception {} (com.ibm.eventstreams.connect.mqsink.JMSWriter:171) com.ibm.msg.client.jms.DetailedJMSSecurityRuntimeException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'QMQM123' with connection mode 'Client' and host name 'abcd0101(1234),abcd0101(1234),abcd0101(1234)'. Please check if the supplied username and password are correct on the QueueManager to which you are connecting. at com.ibm.msg.client.jms.DetailedJMSSecurityException.getUnchecked(DetailedJMSSecurityException.java:270) at com.ibm.msg.client.jms.internal.JmsErrorUtils.convertJMSException(JmsErrorUtils.java:173) at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createContext(JmsConnectionFactoryImpl.java:628) at com.ibm.eventstreams.connect.mqsink.JMSWriter.connect(JMSWriter.java:156) at com.ibm.eventstreams.connect.mqsink.MQSinkTask.start(MQSinkTask.java:63) at org.apache.kafka.connect.runtime.WorkerSinkTask.initializeAndStart(WorkerSinkTask.java:301) at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:190) at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175) at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED'). at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203) at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:424) at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8475) at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7815) at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:303) at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createContext(JmsConnectionFactoryImpl.java:606) ... 11 more

AndrewJSchofield commented 6 years ago

It looks like an authorization problem rather than an SSL problem to me. Look at the queue manager logs and see why the connection is being refused. I think the MQCONN is being bounced with MQRC_NOT_AUTHORIZED.

ty17383 commented 6 years ago

You were correct. I was trying to feed in a username when there was no username needed. Thank you!