MQ

 View Only

 MQI Error. Comp2, Reason 2058: FAILED: MQRC_Q_MGR_NAME_ERROR

Hemalatha Bhupathiraju's profile image
Hemalatha Bhupathiraju posted Tue April 21, 2026 10:24 AM

Hi,

We are trying to connect to a Queue Manager using PyPi's ibmmq, and we are running into this Error: MQI Error. Comp2, Reason 2058: FAILED: MQRC_Q_MGR_NAME_ERROR.

We were able to connect to the same Queue using a Spring boot application and NodeJs. Double checked the QMgr name and nothing seems amiss.This is happening when we are trying to connect to MQ Server on-prem from a Python application deployed  on ROSA /Docker Desktop (for local testing). We have TLS and OAuth enforced and following is the code used : 

cd = ibmmq.CD()

cd.ChannelName = channel.encode("utf-8")

cd.ConnectionName= conn_name.encode("utf-8")

cd.SSLCipherSpec = cipher

cd.TransportType = 2

sco = ibmmq.SCO()

sco.KeyRepository = key_repo

csp = ibmmq.CSP()

csp.AuthenticationType = 1

csp.UserId = ""

csp.Password = token.encode("utf-8")

conn_opts = ibmmq.CNO()

conn_opts.ClientConn = cd

conn_opts.SSLConfig = sco

conn_opts.SecurityParams = csp

mgr = ibmmq.QueueManager(None)

mgr.connect(qmgr_name,conn_opts)

return qmgr

Getting the Error at ibmmq.QueueManager(None)...It did not work, even when we tried passing the QMgr name as the parameter directly. 

Following is the AUTHINFO: 

AUTHINFO(ENTRA)

AUTHTYPE(IDPWOS)

CHCKCLNT(REQUIRED)

CHKLOCL(OPTIONAL)

FAILDLAY(1)

AUTHENMD(OS)

Morag Hughson's profile image
Morag Hughson IBM Champion

This sounds like it is not making a client connection and instead attempting a local connection to which it then reports that there is no queue manager with that name locally.

To test my theory, set the environment variable MQ_CONNECT_TYPE to the value CLIENT.

If that works you can permanently set this in the code by setting the cno Options field to MQCNO_CLIENT_BINDING.

See https://community.ibm.com/community/user/blogs/morag-hughson/2017/12/13/ibm-mq-little-gem-30-mq-connect-type for more about this.

Cheers,

Morag

YVES MOYROUD's profile image
YVES MOYROUD

Hi,

looking at https://github.com/ibm-messaging/mq-mqi-python/blob/main/code/ibmmq/mqqmgr.py,

you might be good if you pass from mgr.connect(qmgr_name,conn_opts) to mgr.connect_with_options(qmgr_name,conn_opts)