ibm-messaging / cphtestp

Environment for creating a docker image running cph performance tests for Persistent and Non-Persistent messaging against an MQ Queue Manager.
Apache License 2.0
6 stars 9 forks source link

MQRC 2059 error when C Perfharness connects to QMGR #3

Closed abudavis closed 2 years ago

abudavis commented 2 years ago

We are doing a test to check the MQ performance of a QMGR (MQ1) (the MQ Server) on version 9.2.0.2 running on a VM running Ubuntu OS using C Perfharness which is installed on a VM running CentOS with MQ Client 9.2.0.4 (the client) and we get the following error when trying to connect using SSL, the kdb is setup correctly on the client and MQ server. When the same test is done using MQ sample program "amqssslc" the connection succeeds making us think the issue is with the Perfharness we run.

Please see the MQ trace files attached taken during the test on both client and MQ server. Kindly go through them and let us know where the issue could be.

./cph -tc PutGet -jc TEST01.QMGR.CL01 -d TEST01.PERFHARNESS.LOOPBACK.REQUEST01 -rl 60 -jb MQ1 -jh 9.250.234.115 -jp 1414 -to -1 -ms 1000 -ss 5 -nt 1 -sh -vo 4 -tx -wt 10 wi 0 -jl TLS_RSA_WITH_AES_256_CBC_SHA256
Command line: ./cph -tc PutGet -jc TEST01.QMGR.CL01 -d TEST01.PERFHARNESS.LOOPBACK.REQUEST01 -rl 60 -jb MQ1 -jh 9.250.234.115 -jp 1414 -to -1 -ms 1000 -ss 5 -nt 1 -sh -vo 4 -tx -wt 10 wi 0 -jl TLS_RSA_WITH_AES_256_CBC_SHA256
controlThread START
Shared library libmqic_r.so loaded ok
[PutGet0] START
[PutGet0] Connecting to QM: MQ1 (connection: 9.250.234.115(1414); channel: TEST01.QMGR.CL01)

Created Error message to pass to runtime_error()
Call to MQCONNX failed [Completion code: 2; Reason code: 2059]
Sending errorMsg to STDERR
Call to MQCONNX failed [Completion code: 2; Reason code: 2059]
]][PutGet0] Caught exception: Call to MQCONNX failed [Completion code: 2; Reason code: 2059]
]
[PutGet0] STOP
rate=0.00,threads=0
[ControlThread] Caught exception: PutGet0: State ERROR set.
totalIterations=0,totalSeconds=1388361935.44,avgRate=0.00
controlThread STOP
terminate called after throwing an instance of 'std::exception'
what(): std::exception
Aborted (core dumped)

---- The below test worked ---

/opt/mqm/samp/bin/amqssslc -m MQ1 -c TEST01.QMGR.CL01 -k /var/mqm/ssl/key -s TLS_RSA_WITH_AES_256_CBC_SHA256 -x '9.250.234.115(1414)'

Sample AMQSSSLC start
Connecting to queue manager MQ1
Using the server connection channel TEST01.QMGR.CL01
on connection name 9.250.234.115(1414).
Using SSL CipherSpec TLS_RSA_WITH_AES_256_CBC_SHA256
Using SSL key repository stem /var/mqm/ssl/key
No OCSP configuration specified.
Connection established to queue manager MQ1
Sample AMQSSSLC end

-- mqclient.ini config on the client side --

#****************************************************************************************#
#* Module name : mqclient.ini *#
#* Type : IBM MQ client configuration file *#
#* Function : Define the client configuration *#
#* *#
#****************************************************************************************#

SSL:
AllowTLSV13=FALSE
SSLKeyRepository=/var/mqm/ssl/key
SSLKeyResetCount=0
OCSPAuthentication=OPTIONAL
OCSPCheckExtensions=NO
CDPCheckExtensions=NO
ClientExitPath:
ExitsDefaultPath=/var/mqm/exits
ExitsDefaultPath64=/var/mqm/exits64

---- MQ channel ---

dis chl(TEST01.QMGR.CL01)
2 : dis chl(TEST01.QMGR.CL01)
AMQ8414I: Display Channel details.
CHANNEL(TEST01.QMGR.CL01) CHLTYPE(SVRCONN)
ALTDATE(2022-02-22) ALTTIME(15.45.26)
CERTLABL( ) COMPHDR(NONE)
COMPMSG(NONE) DESCR( )
DISCINT(0) HBINT(300)
KAINT(AUTO) MAXINST(999999999)
MAXINSTC(999999999) MAXMSGL(4194304)
MCAUSER(mqdef01) MONCHL(QMGR)
RCVDATA( ) RCVEXIT( )
SCYDATA( ) SCYEXIT( )
SENDDATA( ) SENDEXIT( )
SHARECNV(10) SSLCAUTH(OPTIONAL)
SSLCIPH(TLS_RSA_WITH_AES_256_CBC_SHA256)
SSLPEER( ) TRPTYPE(TCP)

Attachments:

runmqras_MQclient.zip

runmqras_MQserver.zip

stmassey commented 2 years ago

Firstly, this is a cph issue and should have been raised against the cph repo (https://github.com/ot4i/perf-harness/issues).

For TLS/SSL cph requires a CCDT. This is indicated in your /var/mqm/errors/AMQERR01.LOG: 02/22/22 15:12:58 - Process(27737.1) User(mqm) Program(cph) Host(ip-172-31-42-9) Installation(Installation1) VRMF(9.2.0.4) Time(2022-02-22T15:12:58.864Z) ArithInsert1(1013) CommentInsert1(/var/mqm/AMQCLCHL.TAB)

AMQ9518E: File '/var/mqm/AMQCLCHL.TAB' not found.

EXPLANATION: The program requires that the file '/var/mqm/AMQCLCHL.TAB' is present and available. ACTION: This error may be caused by the program specifying an incorrect file location programmatically via MQCNO value through CCDTUrlPtr or CCDTUrlOffset. If the program has not specified the file location, the environment variables MQCHLLIB, MQCHLTAB or MQCCDTURL may have been specified. If none of these environment variables are set, the location of the file may have been specified in the mqclient.ini through ChannelDefinitionDirectory and ChannelDefinitionFile attributes under the Channels stanza. If the location was not configured programmatically, by environment variable or by mqclient.ini values then '/var/mqm/AMQCLCHL.TAB' represents a default location and filename for this installation. Ensure that file location is correctly configured and that the file is available to the program.

This either needs to be copied from the QMGR to the client, or recreated on the client using runmqsc. If you were using this repo (cphtestp) - this would have been created for you.